1var n7=Object.defineProperty;var i7=(n,t,e)=>t in n?n7(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var y=(n,t,e)=>(i7(n,typeof t!="symbol"?t+"":t,e),e),Ex=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var g=(n,t,e)=>(Ex(n,t,"read from private field"),e?e.call(n):t.get(n)),F=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},V=(n,t,e,i)=>(Ex(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e);var Gi=(n,t,e,i)=>({set _(s){V(n,t,s,e)},get _(){return g(n,t,i)}}),W=(n,t,e)=>(Ex(n,t,"access private method"),e);import{$ as s7}from"./jquery-45d882b3.js";import{g as zI,c as r7}from"./_commonjsHelpers-de833af9.js";function C5(n,t){return function(){return n.apply(t,arguments)}}const{toString:o7}=Object.prototype,{getPrototypeOf:$I}=Object,qS=(n=>t=>{const e=o7.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),go=n=>(n=n.toLowerCase(),t=>qS(t)===n),KS=n=>t=>typeof t===n,{isArray:Tm}=Array,wb=KS("undefined");function a7(n){return n!==null&&!wb(n)&&n.constructor!==null&&!wb(n.constructor)&&Gs(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const k5=go("ArrayBuffer");function l7(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&k5(n.buffer),t}const c7=KS("string"),Gs=KS("function"),I5=KS("number"),XS=n=>n!==null&&typeof n=="object",u7=n=>n===!0||n===!1,j_=n=>{if(qS(n)!=="object")return!1;const t=$I(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},d7=go("Date"),h7=go("File"),f7=go("Blob"),g7=go("FileList"),m7=n=>XS(n)&&Gs(n.pipe),p7=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||Gs(n.append)&&((t=qS(n))==="formdata"||t==="object"&&Gs(n.toString)&&n.toString()==="[object FormData]"))},b7=go("URLSearchParams"),[w7,v7,y7,_7]=["ReadableStream","Request","Response","Headers"].map(go),E7=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function hy(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let i,s;if(typeof n!="object"&&(n=[n]),Tm(n))for(i=0,s=n.length;i<s;i++)t.call(null,n[i],i,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),o=r.length;let a;for(i=0;i<o;i++)a=r[i],t.call(null,n[a],a,n)}}function P5(n,t){t=t.toLowerCase();const e=Object.keys(n);let i=e.length,s;for(;i-- >0;)if(s=e[i],t===s.toLowerCase())return s;return null}const Cu=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),M5=n=>!wb(n)&&n!==Cu;function $A(){const{caseless:n}=M5(this)&&this||{},t={},e=(i,s)=>{const r=n&&P5(t,s)||s;j_(t[r])&&j_(i)?t[r]=$A(t[r],i):j_(i)?t[r]=$A({},i):Tm(i)?t[r]=i.slice():t[r]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&hy(arguments[i],e);return t}const S7=(n,t,e,{allOwnKeys:i}={})=>(hy(t,(s,r)=>{e&&Gs(s)?n[r]=C5(s,e):n[r]=s},{allOwnKeys:i}),n),T7=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),x7=(n,t,e,i)=>{n.prototype=Object.create(t.prototype,i),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},A7=(n,t,e,i)=>{let s,r,o;const a={};if(t=t||{},n==null)return t;do{for(s=Object.getOwnPropertyNames(n),r=s.length;r-- >0;)o=s[r],(!i||i(o,n,t))&&!a[o]&&(t[o]=n[o],a[o]=!0);n=e!==!1&&$I(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},C7=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const i=n.indexOf(t,e);return i!==-1&&i===e},k7=n=>{if(!n)return null;if(Tm(n))return n;let t=n.length;if(!I5(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},I7=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&$I(Uint8Array)),P7=(n,t)=>{const i=(n&&n[Symbol.iterator]).call(n);let s;for(;(s=i.next())&&!s.done;){const r=s.value;t.call(n,r[0],r[1])}},M7=(n,t)=>{let e;const i=[];for(;(e=n.exec(t))!==null;)i.push(e);return i},O7=go("HTMLFormElement"),D7=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,i,s){return i.toUpperCase()+s}),nD=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),R7=go("RegExp"),O5=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),i={};hy(e,(s,r)=>{let o;(o=t(s,r,n))!==!1&&(i[r]=o||s)}),Object.defineProperties(n,i)},L7=n=>{O5(n,(t,e)=>{if(Gs(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const i=n[e];if(Gs(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},F7=(n,t)=>{const e={},i=s=>
1{s.forEach(r=>{e[r]=!0})};return Tm(n)?i(n):i(String(n).split(t)),e},N7=()=>{},B7=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t,Sx="abcdefghijklmnopqrstuvwxyz",iD="0123456789",D5={DIGIT:iD,ALPHA:Sx,ALPHA_DIGIT:Sx+Sx.toUpperCase()+iD},V7=(n=16,t=D5.ALPHA_DIGIT)=>{let e="";const{length:i}=t;for(;n--;)e+=t[Math.random()*i|0];return e};function H7(n){return!!(n&&Gs(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const z7=n=>{const t=new Array(10),e=(i,s)=>{if(XS(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[s]=i;const r=Tm(i)?[]:{};return hy(i,(o,a)=>{const l=e(o,s+1);!wb(l)&&(r[a]=l)}),t[s]=void 0,r}}return i};return e(n,0)},$7=go("AsyncFunction"),W7=n=>n&&(XS(n)||Gs(n))&&Gs(n.then)&&Gs(n.catch),R5=((n,t)=>n?setImmediate:t?((e,i)=>(Cu.addEventListener("message",({source:s,data:r})=>{s===Cu&&r===e&&i.length&&i.shift()()},!1),s=>{i.push(s),Cu.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Gs(Cu.postMessage)),U7=typeof queueMicrotask<"u"?queueMicrotask.bind(Cu):typeof process<"u"&&process.nextTick||R5,ue={isArray:Tm,isArrayBuffer:k5,isBuffer:a7,isFormData:p7,isArrayBufferView:l7,isString:c7,isNumber:I5,isBoolean:u7,isObject:XS,isPlainObject:j_,isReadableStream:w7,isRequest:v7,isResponse:y7,isHeaders:_7,isUndefined:wb,isDate:d7,isFile:h7,isBlob:f7,isRegExp:R7,isFunction:Gs,isStream:m7,isURLSearchParams:b7,isTypedArray:I7,isFileList:g7,forEach:hy,merge:$A,extend:S7,trim:E7,stripBOM:T7,inherits:x7,toFlatObject:A7,kindOf:qS,kindOfTest:go,endsWith:C7,toArray:k7,forEachEntry:P7,matchAll:M7,isHTMLForm:O7,hasOwnProperty:nD,hasOwnProp:nD,reduceDescriptors:O5,freezeMethods:L7,toObjectSet:F7,toCamelCase:D7,noop:N7,toFiniteNumber:B7,findKey:P5,global:Cu,isContextDefined:M5,ALPHABET:D5,generateString:V7,isSpecCompliantForm:H7,toJSONObject:z7,isAsyncFn:$7,isThenable:W7,setImmediate:R5,asap:U7};function at(n,t,e,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}ue.inherits(at,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ue.toJSONObject(this.config),code:this.code,status:this.status}}});const L5=at.prototype,F5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{F5[n]={value:n}});Object.defineProperties(at,F5);Object.defineProperty(L5,"isAxiosError",{value:!0});at.from=(n,t,e,i,s,r)=>{const o=Object.create(L5);return ue.toFlatObject(n,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),at.call(o,n.message,t,e,i,s),o.cause=n,o.name=n.name,r&&Object.assign(o,r),o};const j7=null;function WA(n){return ue.isPlainObject(n)||ue.isArray(n)}function N5(n){return ue.endsWith(n,"[]")?n.slice(0,-2):n}function sD(n,t,e){return n?n.concat(t).map(function(s,r){return s=N5(s),!e&&r?"["+s+"]":s}).join(e?".":""):t}function G7(n){return ue.isArray(n)&&!n.some(WA)}const Y7=ue.toFlatObject(ue,{},null,function(t){return/^is[A-Z]/.test(t)});function JS(n,t,e){if(!ue.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=ue.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,E){return!ue.isUndefined(E[v])});const i=e.metaTokens,s=e.visitor||u,r=e.dots,o=e.indexes,l=(e.Blob||typeof Blob<"u"&&Blob)&&ue.isSpecCompliantForm(t);if(!ue.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(ue.isDate(p))return p.toISOString();if(!l&&ue.isBlob(p))throw new at("Blob is not supported. Use a Buffer instead.");return ue.isArrayBuffer(p)||ue.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,v,E){let x=p;if(p&&!E&&typeof p=="object"){if(ue.endsWith(v,"{}"))v=i?v:v.slice(0,-2),p=JSON.stringify(p);
vendor: 8,776 bytes, lines 1-3
1else if(ue.isArray(p)&&G7(p)||(ue.isFileList(p)||ue.endsWith(v,"[]"))&&(x=ue.toArray(p)))return v=N5(v),x.forEach(function(O,I){!(ue.isUndefined(O)||O===null)&&t.append(o===!0?sD([v],I,r):o===null?v:v+"[]",c(O))}),!1}return WA(p)?!0:(t.append(sD(E,v,r),c(p)),!1)}const d=[],h=Object.assign(Y7,{defaultVisitor:u,convertValue:c,isVisitable:WA});function f(p,v){if(!ue.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(p),ue.forEach(p,function(x,A){(!(ue.isUndefined(x)||x===null)&&s.call(t,x,ue.isString(A)?A.trim():A,v,h))===!0&&f(x,v?v.concat(A):[A])}),d.pop()}}if(!ue.isObject(n))throw new TypeError("data must be an object");return f(n),t}function rD(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function WI(n,t){this._pairs=[],n&&JS(n,this,t)}const B5=WI.prototype;B5.append=function(t,e){this._pairs.push([t,e])};B5.toString=function(t){const e=t?function(i){return t.call(this,i,rD)}:rD;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function q7(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function V5(n,t,e){if(!t)return n;const i=e&&e.encode||q7;ue.isFunction(e)&&(e={serialize:e});const s=e&&e.serialize;let r;if(s?r=s(t,e):r=ue.isURLSearchParams(t)?t.toString():new WI(t,e).toString(i),r){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class K7{constructor(){this.handlers=[]}use(t,e,i){return this.handlers.push({fulfilled:t,rejected:e,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ue.forEach(this.handlers,function(i){i!==null&&t(i)})}}const oD=K7,H5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},X7=typeof URLSearchParams<"u"?URLSearchParams:WI,J7=typeof FormData<"u"?FormData:null,Z7=typeof Blob<"u"?Blob:null,Q7={isBrowser:!0,classes:{URLSearchParams:X7,FormData:J7,Blob:Z7},protocols:["http","https","file","blob","url","data"]},UI=typeof window<"u"&&typeof document<"u",UA=typeof navigator=="object"&&navigator||void 0,ej=UI&&(!UA||["ReactNative","NativeScript","NS"].indexOf(UA.product)<0),tj=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),nj=UI&&window.location.href||"http://localhost",ij=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:UI,hasStandardBrowserEnv:ej,hasStandardBrowserWebWorkerEnv:tj,navigator:UA,origin:nj},Symbol.toStringTag,{value:"Module"})),Fi={...ij,...Q7};function sj(n,t){return JS(n,new Fi.classes.URLSearchParams,Object.assign({visitor:function(e,i,s,r){return Fi.isNode&&ue.isBuffer(e)?(this.append(i,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function rj(n){return ue.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function oj(n){const t={},e=Object.keys(n);let i;const s=e.length;let r;for(i=0;i<s;i++)r=e[i],t[r]=n[r];return t}function z5(n){function t(e,i,s,r){let o=e[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=r>=e.length;return o=!o&&ue.isArray(s)?s.length:o,l?(ue.hasOwnProp(s,o)?s[o]=[s[o],i]:s[o]=i,!a):((!s[o]||!ue.isObject(s[o]))&&(s[o]=[]),t(e,i,s[o],r)&&ue.isArray(s[o])&&(s[o]=oj(s[o])),!a)}if(ue.isFormData(n)&&ue.isFunction(n.entries)){const e={};return ue.forEachEntry(n,(i,s)=>{t(rj(i),s,e,0)}),e}return null}function aj(n,t,e){if(ue.isString(n))try{return(t||JSON.parse)(n),ue.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(e||JSON.stringify)(n)}const jI={transitional:H5,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const i=e.getContentType()||"",s=i.indexOf("application/json")>-1,r=ue.isObject(t);if(r&&ue.isHTMLForm(t)&&(t=new FormData(t)),ue.isFormData(t))return s?JSON.stringify(z5(t)):t;if(ue.isArrayBuffer(t)||ue.isBuffer(t)||ue.isStream(t)||ue.isFile(t)||ue.isBlob(t)||ue.isReadableStream(t))return t;if(ue.isArrayBufferView(t))return t.buffer;if(ue.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return sj(t,this.formSerializer).toString();if((a=ue.isFileList(t))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return JS(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return r||s?(e.setContentType("application/json",!1),aj(t)):t}],transformResponse:[function(t){const e=this.transitional||jI.transitional,i=e&&e.forcedJSONParsing,s=this.responseType==="json";if(ue.isResponse(t)||ue.isReadableStream(t))return t;if(t&&ue.isString(t)&&(i&&!this.responseType||s)){const o=!(e&&e.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?at.from(a,at.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Fi.classes.FormData,Blob:Fi.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ue.forEach(["delete","get","head","post","put","patch"],n=>{jI.headers[n]={}});const GI=jI,lj=ue.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),cj=n=>{const t={};let e,i,s;return n&&n.split(` 2`).forEach(function(o){s=o.indexOf(":"),e=o.substring(0,s).trim().toLowerCase(),i=o.substring(s+1).trim(),!(!e||t[e]&&lj[e])&&(e==="set-cookie"?t[e]?t[e].push(i):t[e]=[i]:t[e]=t[e]?t[e]+", "+i:i)}),t},aD=Symbol("internals");function Xm(n){return n&&String(n).trim().toLowerCase()}function G_(n){return n===!1||n==null?n:ue.isArray(n)?n.map(G_):String(n)}function uj(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=e.exec(n);)t[i[1]]=i[2];return t}const dj=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Tx(n,t,e,i,s){if(ue.isFunction(i))return i.call(this,t,e);if(s&&(t=e),!!ue.isString(t)){if(ue.isString(i))return t.indexOf(i)!==-1;if(ue.isRegExp(i))return i.test(t)}}function hj(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,i)=>e.toUpperCase()+i)}function fj(n,t){const e=ue.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(n,i+e,{value:function(s,r,o){return this[i].call(this,t,s,r,o)},configurable:!0})})}class ZS{constructor(t){t&&this.set(t)}set(t,e,i){const s=this;function r(a,l,c){const u=Xm(l);if(!u)throw new Error("header name must be a non-empty string");const d=ue.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||l]=G_(a))}const o=(a,l)=>ue.forEach(a,(c,u)=>r(c,u,l));if(ue.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(ue.isString(t)&&(t=t.trim())&&!dj(t))o(cj(t),e);else if(ue.isHeaders(t))for(const[a,l]of t.entries())r(l,a,i);else t!=null&&r(e,t,i);return this}get(t,e){if(t=Xm(t),t){const i=ue.findKey(this,t);if(i){const s=this[i];if(!e)return s;if(e===!0)return uj(s);if(ue.isFunction(e))return e.call(this,s,i);if(ue.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Xm(t),t){const i=ue.findKey(this,t);return!!(i&&this[i]!==void 0&&(!e||Tx(this,this[i],i,e)))}return!1}delete(t,e){const i=this;let s=!1;function r(o){if(o=Xm(o),o){const a=ue.findKey(i,o);a&&(!e||Tx(i,i[a],a,e))&&(delete i[a],s=!0)}}return ue.isArray(t)?t.forEach(r):r(t),s}clear(t){const e=Object.keys(this);let i=e.length,s=!1;for(;i--;){const r=e[i];(!t||Tx(this,this[r],r,t,!0))&&(delete this[r],s=!0)}return s}normalize(t){const e=this,i={};return ue.forEach(this,(s,r)=>{const o=ue.findKey(i,r);if(o){e[o]=G_(s),delete e[r];return}const a=t?hj(r):String(r).trim();a!==r&&delete e[r],e[a]=G_(s),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return ue.forEach(this,(i,s)=>{i!=null&&i!==!1&&(e[s]=t&&ue.isArray(i)?i.join(", "):i)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(` 3`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const i=new this(t);return e.forEach(s=>i.set(s)),i}static accessor(t){const i=(this[aD]=this[aD]={accessors:{}}).accessors,s=this.prototype;function r(o){const a=Xm(o);
3i[a]||(fj(s,o),i[a]=!0)}return ue.isArray(t)?t.forEach(r):r(t),this}}ZS.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ue.reduceDescriptors(ZS.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(i){this[e]=i}}});ue.freezeMethods(ZS);const no=ZS;function xx(n,t){const e=this||GI,i=t||e,s=no.from(i.headers);let r=i.data;return ue.forEach(n,function(a){r=a.call(e,r,s.normalize(),t?t.status:void 0)}),s.normalize(),r}function $5(n){return!!(n&&n.__CANCEL__)}function xm(n,t,e){at.call(this,n??"canceled",at.ERR_CANCELED,t,e),this.name="CanceledError"}ue.inherits(xm,at,{__CANCEL__:!0});function W5(n,t,e){const i=e.config.validateStatus;!e.status||!i||i(e.status)?n(e):t(new at("Request failed with status code "+e.status,[at.ERR_BAD_REQUEST,at.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function gj(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function mj(n,t){n=n||10;const e=new Array(n),i=new Array(n);let s=0,r=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=i[r];o||(o=c),e[s]=l,i[s]=c;let d=r,h=0;for(;d!==s;)h+=e[d++],d=d%n;if(s=(s+1)%n,s===r&&(r=(r+1)%n),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function pj(n,t){let e=0,i=1e3/t,s,r;const o=(c,u=Date.now())=>{e=u,s=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-e;d>=i?o(c,u):(s=c,r||(r=setTimeout(()=>{r=null,o(s)},i-d)))},()=>s&&o(s)]}const X0=(n,t,e=3)=>{let i=0;const s=mj(50,250);return pj(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,l=o-i,c=s(l),u=o<=a;i=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};n(d)},e)},lD=(n,t)=>{const e=n!=null;return[i=>t[0]({lengthComputable:e,total:n,loaded:i}),t[1]]},cD=n=>(...t)=>ue.asap(()=>n(...t)),bj=Fi.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,Fi.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(Fi.origin),Fi.navigator&&/(msie|trident)/i.test(Fi.navigator.userAgent)):()=>!0,wj=Fi.hasStandardBrowserEnv?{write(n,t,e,i,s,r){const o=[n+"="+encodeURIComponent(t)];ue.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),ue.isString(i)&&o.push("path="+i),ue.isString(s)&&o.push("domain="+s),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function vj(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function yj(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function U5(n,t){return n&&!vj(t)?yj(n,t):t}const uD=n=>n instanceof no?{...n}:n;function lh(n,t){t=t||{};const e={};function i(c,u,d,h){return ue.isPlainObject(c)&&ue.isPlainObject(u)?ue.merge.call({caseless:h},c,u):ue.isPlainObject(u)?ue.merge({},u):ue.isArray(u)?u.slice():u}function s(c,u,d,h){if(ue.isUndefined(u)){if(!ue.isUndefined(c))return i(void 0,c,d,h)}else return i(c,u,d,h)}function r(c,u){if(!ue.isUndefined(u))return i(void 0,u)}function o(c,u){if(ue.isUndefined(u)){if(!ue.isUndefined(c))return i(void 0,c)}else return i(void 0,u)}function a(c,u,d){if(d in t)return i(c,u);if(d in n)return i(void 0,c)}const l={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>s(uD(c),uD(u),d,!0)};return ue.forEach(Object.keys(Object.assign({},n,t)),function(u){const d=l[u]||s,h=d(n[u],t[u],u);ue.isUndefined(h)&&d!==a||(e[u]=h)}),e}const j5=n=>{const t=lh({},n);let{data:e,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=no.from(o),t.url=V5(U5(t.baseURL,t.url),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(ue.isFormData(e)){if(Fi.hasStandardBrowserEnv||Fi.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>
3d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Fi.hasStandardBrowserEnv&&(i&&ue.isFunction(i)&&(i=i(t)),i||i!==!1&&bj(t.url))){const c=s&&r&&wj.read(r);c&&o.set(s,c)}return t},_j=typeof XMLHttpRequest<"u",Ej=_j&&function(n){return new Promise(function(e,i){const s=j5(n);let r=s.data;const o=no.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,u,d,h,f,p;function v(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function x(){if(!E)return;const O=no.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),T={data:!a||a==="text"||a==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:O,config:n,request:E};W5(function(k){e(k),v()},function(k){i(k),v()},T),E=null}"onloadend"in E?E.onloadend=x:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(x)},E.onabort=function(){E&&(i(new at("Request aborted",at.ECONNABORTED,n,E)),E=null)},E.onerror=function(){i(new at("Network Error",at.ERR_NETWORK,n,E)),E=null},E.ontimeout=function(){let I=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const T=s.transitional||H5;s.timeoutErrorMessage&&(I=s.timeoutErrorMessage),i(new at(I,T.clarifyTimeoutError?at.ETIMEDOUT:at.ECONNABORTED,n,E)),E=null},r===void 0&&o.setContentType(null),"setRequestHeader"in E&&ue.forEach(o.toJSON(),function(I,T){E.setRequestHeader(T,I)}),ue.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),a&&a!=="json"&&(E.responseType=s.responseType),c&&([h,p]=X0(c,!0),E.addEventListener("progress",h)),l&&E.upload&&([d,f]=X0(l),E.upload.addEventListener("progress",d),E.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(u=O=>{E&&(i(!O||O.type?new xm(null,n,E):O),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const A=gj(s.url);if(A&&Fi.protocols.indexOf(A)===-1){i(new at("Unsupported protocol "+A+":",at.ERR_BAD_REQUEST,n));return}E.send(r||null)})},Sj=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let i=new AbortController,s;const r=function(c){if(!s){s=!0,a();const u=c instanceof Error?c:this.reason;i.abort(u instanceof at?u:new xm(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,r(new at(`timeout ${t}
3 of ms exceeded`,at.ETIMEDOUT))},t);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:l}=i;return l.unsubscribe=()=>ue.asap(a),l}},Tj=Sj,xj=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let i=0,s;for(;i<e;)s=i+t,yield n.slice(i,s),i=s},Aj=async function*(n,t){for await(const e of Cj(n))yield*xj(e,t)},Cj=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:i}=await t.read();if(e)break;yield i}}finally{await t.cancel()}},dD=(n,t,e,i)=>{const s=Aj(n,t);let r=0,o,a=l=>{o||(o=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(e){let h=r+=d;e(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},QS=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",G5=QS&&typeof ReadableStream=="function",kj=QS&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Y5=(n,...t)=>{try{return!!n(...t)}catch{return!1}},Ij=G5&&Y5(()=>{let n=!1;const t=new Request(Fi.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),hD=64*1024,jA=G5&&Y5(()=>ue.isReadableStream(new Response("").body)),J0={stream:jA&&(n=>n.body)};QS&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!J0[t]&&(J0[t]=ue.isFunction(n[t])?e=>e[t]():(e,i)=>{throw new at(`Response type '${t}' is not supported`,at.ERR_NOT_SUPPORT,i)})})})(new Response);const Pj=async n=>{if(n==null)return 0;if(ue.isBlob(n))return n.size;if(ue.isSpecCompliantForm(n))return(await new Request(Fi.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(ue.isArrayBufferView(n)||ue.isArrayBuffer(n))return n.byteLength;if(ue.isURLSearchParams(n)&&(n=n+""),ue.isString(n))return(await kj(n)).byteLength},Mj=async(n,t)=>{const e=ue.toFiniteNumber(n.getContentLength());return e??Pj(t)},Oj=QS&&(async n=>{let{url:t,method:e,data:i,signal:s,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:h}=j5(n);c=c?(c+"").toLowerCase():"text";let f=Tj([s,r&&r.toAbortSignal()],o),p;const v=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let E;try{if(l&&Ij&&e!=="get"&&e!=="head"&&(E=await Mj(u,i))!==0){let T=new Request(t,{method:"POST",body:i,duplex:"half"}),P;if(ue.isFormData(i)&&(P=T.headers.get("content-type"))&&u.setContentType(P),T.body){const[k,D]=lD(E,X0(cD(l)));i=dD(T.body,hD,k,D)}}ue.isString(d)||(d=d?"include":"omit");const x="credentials"in Request.prototype;p=new Request(t,{...h,signal:f,method:e.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:x?d:void 0});let A=await fetch(p);const O=jA&&(c==="stream"||c==="response");if(jA&&(a||O&&v)){const T={};["status","statusText","headers"].forEach(U=>{T[U]=A[U]});const P=ue.toFiniteNumber(A.headers.get("content-length")),[k,D]=a&&lD(P,X0(cD(a),!0))||[];A=new Response(dD(A.body,hD,k,()=>{D&&D(),v&&v()}),T)}c=c||"text";let I=await J0[ue.findKey(J0,c)||"text"](A,n);return!O&&v&&v(),await new Promise((T,P)=>{W5(T,P,{data:I,headers:no.from(A.headers),status:A.status,statusText:A.statusText,config:n,request:p})})}catch(x){throw v&&v(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new at("Network Error",at.ERR_NETWORK,n,p),{cause:x.cause||x}):at.from(x,x&&x.code,n,p)}}),GA={http:j7,xhr:Ej,fetch:Oj};ue.forEach(GA,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const fD=n=>`- ${n}`,Dj=n=>ue.isFunction(n)||n===null||n===!1,q5={getAdapter:n=>{n=ue.isArray(n)?n:[n];const{length:t}=n;let e,i;const s={};for(let r=0;r<t;r++){e=n[r];let o;if(i=e,!Dj(e)&&(i=GA[(o=String(e)).toLowerCase()],i===void 0))throw new at(`Unknown adapter '${o}'`);if(i)break;s[o||"#"+r]=i}if(!i){const r=Object.entries(s).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?r.length>1?`since : 4`+r.map(fD).join(` 5`):" "+fD(r[0]):"as no adapter specified";throw new at("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:GA};function Ax(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new xm(null,n)}function gD(n){return Ax(n),n.headers=no.from(n.headers),n.data=xx.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),q5.getAdapter(n.adapter||GI.adapter)(n).then(function(i){return Ax(n),i.data=xx.call(n,n.transformResponse,i),i.headers=no.from(i.headers),i},function(i){return $5(i)||(Ax(n),i&&i.response&&(i.response.data=xx.call(n,n.transformResponse,i.response),i.response.headers=no.from(i.response.headers))),Promise.reject(i)})}const K5="1.7.9",eT={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{eT[n]=function(i){return typeof i===n||"a"+(t<1?"n ":" ")+n}});const mD={};
vendor: 4,441 bytes, lines 5-6
5eT.transitional=function(t,e,i){function s(r,o){return"[Axios v"+K5+"] Transitional option '"+r+"'"+o+(i?". "+i:"")}return(r,o,a)=>{if(t===!1)throw new at(s(o," has been removed"+(e?" in "+e:"")),at.ERR_DEPRECATED);return e&&!mD[o]&&(mD[o]=!0,console.warn(s(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,o,a):!0}};eT.spelling=function(t){return(e,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function Rj(n,t,e){if(typeof n!="object")throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE);const i=Object.keys(n);let s=i.length;for(;s-- >0;){const r=i[s],o=t[r];if(o){const a=n[r],l=a===void 0||o(a,r,n);if(l!==!0)throw new at("option "+r+" must be "+l,at.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new at("Unknown option "+r,at.ERR_BAD_OPTION)}}const Y_={assertOptions:Rj,validators:eT},bo=Y_.validators;class Z0{constructor(t){this.defaults=t,this.interceptors={request:new oD,response:new oD}}async request(t,e){try{return await this._request(t,e)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const r=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+=` 6`+r):i.stack=r}catch{}}throw i}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=lh(this.defaults,e);const{transitional:i,paramsSerializer:s,headers:r}=e;i!==void 0&&Y_.assertOptions(i,{silentJSONParsing:bo.transitional(bo.boolean),forcedJSONParsing:bo.transitional(bo.boolean),clarifyTimeoutError:bo.transitional(bo.boolean)},!1),s!=null&&(ue.isFunction(s)?e.paramsSerializer={serialize:s}:Y_.assertOptions(s,{encode:bo.function,serialize:bo.function},!0)),Y_.assertOptions(e,{baseUrl:bo.spelling("baseURL"),withXsrfToken:bo.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&ue.merge(r.common,r[e.method]);r&&ue.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=no.concat(o,r);const a=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(e)===!1||(l=l&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let u,d=0,h;if(!l){const p=[gD.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(e);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=e;for(d=0;d<h;){const p=a[d++],v=a[d++];try{f=p(f)}catch(E){v.call(this,E);break}}try{u=gD.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=lh(this.defaults,t);const e=U5(t.baseURL,t.url);return V5(e,t.params,t.paramsSerializer)}}ue.forEach(["delete","get","head","options"],function(t){Z0.prototype[t]=function(e,i){return this.request(lh(i||{},{method:t,url:e,data:(i||{}).data}))}});ue.forEach(["post","put","patch"],function(t){function e(i){return function(r,o,a){return this.request(lh(a||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Z0.prototype[t]=e(),Z0.prototype[t+"Form"]=e(!0)});const q_=Z0;class YI{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const i=this;this.promise.then(s=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](s);i._listeners=null}),this.promise.then=s=>{let r;const o=new Promise(a=>{i.subscribe(a),r=a}).then(s);return o.cancel=function(){i.unsubscribe(r)},o},t(function(r,o,a){i.reason||(i.reason=new xm(r,o,a),e(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=i=>{t.abort(i)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new YI(function(s){t=s}),cancel:t}}}const Lj=YI;function Fj(n){return function(e){return n.apply(null,e)}}function Nj(n){return ue.isObject(n)&&n.isAxiosError===!0}const YA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,Re
6setContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(YA).forEach(([n,t])=>{YA[t]=n});const Bj=YA;function X5(n){const t=new q_(n),e=C5(q_.prototype.request,t);return ue.extend(e,q_.prototype,t,{allOwnKeys:!0}),ue.extend(e,t,null,{allOwnKeys:!0}),e.create=function(s){return X5(lh(n,s))},e}const Wn=X5(GI);Wn.Axios=q_;Wn.CanceledError=xm;Wn.CancelToken=Lj;Wn.isCancel=$5;Wn.VERSION=K5;Wn.toFormData=JS;Wn.AxiosError=at;Wn.Cancel=Wn.CanceledError;Wn.all=function(t){return Promise.all(t)};Wn.spread=Fj;Wn.isAxiosError=Nj;Wn.mergeConfig=lh;Wn.AxiosHeaders=no;Wn.formToJSON=n=>z5(ue.isHTMLForm(n)?new FormData(n):n);Wn.getAdapter=q5.getAdapter;Wn.HttpStatusCode=Bj;Wn.default=Wn;const Vj=Wn;/*! 7 * @kurkle/color v0.3.4 8 * https://github.com/kurkle/color#readme 9 * (c) 2024 Jukka Kurkela 10 * Released under the MIT License 11 */function fy(n){return n+.5|0}const vc=(n,t,e)=>Math.max(Math.min(n,e),t);function Sp(n){return vc(fy(n*2.55),0,255)}function Ic(n){return vc(fy(n*255),0,255)}function _a(n){return vc(fy(n/2.55)/100,0,1)}function pD(n){return vc(fy(n*100),0,100)}const sr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},qA=[..."0123456789ABCDEF"],Hj=n=>qA[n&15],zj=n=>qA[(n&240)>>4]+qA[n&15],Zy=n=>(n&240)>>4===(n&15),$j=n=>Zy(n.r)&&Zy(n.g)&&Zy(n.b)&&Zy(n.a);function Wj(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&sr[n[1]]*17,g:255&sr[n[2]]*17,b:255&sr[n[3]]*17,a:t===5?sr[n[4]]*17:255}:(t===7||t===9)&&(e={r:sr[n[1]]<<4|sr[n[2]],g:sr[n[3]]<<4|sr[n[4]],b:sr[n[5]]<<4|sr[n[6]],a:t===9?sr[n[7]]<<4|sr[n[8]]:255})),e}const Uj=(n,t)=>n<255?t(n):"";function jj(n){var t=$j(n)?Hj:zj;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Uj(n.a,t):void 0}const Gj=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function J5(n,t,e){const i=t*Math.min(e,1-e),s=(r,o=(r+n/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Yj(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function qj(n,t,e){const i=J5(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function Kj(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function qI(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),o=Math.min(e,i,s),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=Kj(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function KI(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ic)}function XI(n,t,e){return KI(J5,n,t,e)}function Xj(n,t,e){return KI(qj,n,t,e)}function Jj(n,t,e){return KI(Yj,n,t,e)}function Z5(n){return(n%360+360)%360}function Zj(n){const t=Gj.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Sp(+t[5]):Ic(+t[5]));const s=Z5(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Xj(s,r,o):t[1]==="hsv"?i=Jj(s,r,o):i=XI(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Qj(n,t){var e=qI(n);e[0]=Z5(e[0]+t),e=XI(e),n.r=e[0],n.g=e[1],n.b=e[2]}function e8(n){if(!n)return;const t=qI(n),e=t[0],i=pD(t[1]),s=pD(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${_a(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const bD={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},wD={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",K
11ocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function t8(){const n={},t=Object.keys(wD),e=Object.keys(bD);let i,s,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],s=0;s<e.length;s++)r=e[s],a=a.replace(r,bD[r]);r=parseInt(wD[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let Qy;function n8(n){Qy||(Qy=t8(),Qy.transparent=[0,0,0,0]);const t=Qy[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const i8=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function s8(n){const t=i8.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?Sp(o):vc(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Sp(i):vc(i,0,255)),s=255&(t[4]?Sp(s):vc(s,0,255)),r=255&(t[6]?Sp(r):vc(r,0,255)),{r:i,g:s,b:r,a:e}}}function r8(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${_a(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Cx=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Bh=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function o8(n,t,e){const i=Bh(_a(n.r)),s=Bh(_a(n.g)),r=Bh(_a(n.b));return{r:Ic(Cx(i+e*(Bh(_a(t.r))-i))),g:Ic(Cx(s+e*(Bh(_a(t.g))-s))),b:Ic(Cx(r+e*(Bh(_a(t.b))-r))),a:n.a+e*(t.a-n.a)}}function e_(n,t,e){if(n){let i=qI(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=XI(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Q5(n,t){return n&&Object.assign(t||{},n)}function vD(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Ic(n[3]))):(t=Q5(n,{r:0,g:0,b:0,a:1}),t.a=Ic(t.a)),t}function a8(n){return n.charAt(0)==="r"?s8(n):Zj(n)}class vb{constructor(t){if(t instanceof vb)return t;const e=typeof t;let i;e==="object"?i=vD(t):e==="string"&&(i=Wj(t)||n8(t)||a8(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Q5(this._rgb);return t&&(t.a=_a(t.a)),t}set rgb(t){this._rgb=vD(t)}rgbString(){return this._valid?r8(this._rgb):void 0}hexString(){return this._valid?jj(this._rgb):void 0}hslString(){return this._valid?e8(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=o8(this._rgb,t._rgb,e)),this}clone(){return new vb(this.rgb)}alpha(t){return this._rgb.a=Ic(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=fy(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return e_(this._rgb,2,t),this}darken(t){return e_(this._rgb,2,-t),this}saturate(t){return e_(this._rgb,1,t),this}desaturate(t){return e_(this._rgb,1,-t),this}rotate(t){return Qj(this._rgb,t),this}}/*! 12 * Chart.js v4.4.7 13 * https://www.chartjs.org 14 * (c) 2024 Chart.js Contributors 15 * Released under the MIT License 16 */function aa(){}const l8=(()=>{let n=0;return()=>n++})();function Ot(n){return n==null}function rn(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);
16return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function St(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Tn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function As(n,t){return Tn(n)?n:t}function lt(n,t){return typeof n>"u"?t:n}const c8=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,eB=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Qt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function $t(n,t,e,i){let s,r,o;if(rn(n))if(r=n.length,i)for(s=r-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<r;s++)t.call(e,n[s],s);else if(St(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Q0(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function eE(n){if(rn(n))return n.map(eE);if(St(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=eE(n[e[s]]);return t}return n}function tB(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function u8(n,t,e,i){if(!tB(n))return;const s=t[n],r=e[n];St(s)&&St(r)?yb(s,r,i):t[n]=eE(r)}function yb(n,t,e){const i=rn(t)?t:[t],s=i.length;if(!St(n))return n;e=e||{};const r=e.merger||u8;let o;for(let a=0;a<s;++a){if(o=i[a],!St(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function Xp(n,t){return yb(n,t,{merger:d8})}function d8(n,t,e){if(!tB(n))return;const i=t[n],s=e[n];St(i)&&St(s)?Xp(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=eE(s))}const yD={"":n=>n,x:n=>n.x,y:n=>n.y};function h8(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function f8(n){const t=h8(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Nc(n,t){return(yD[t]||(yD[t]=f8(t)))(n)}function JI(n){return n.charAt(0).toUpperCase()+n.slice(1)}const _b=n=>typeof n<"u",Bc=n=>typeof n=="function",_D=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function g8(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const an=Math.PI,on=2*an,m8=on+an,tE=Number.POSITIVE_INFINITY,p8=an/180,Dn=an/2,au=an/4,ED=an*2/3,yc=Math.log10,Ko=Math.sign;function Jp(n,t,e){return Math.abs(n-t)<e}function SD(n){const t=Math.round(n);n=Jp(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(yc(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function b8(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function am(n){return!isNaN(parseFloat(n))&&isFinite(n)}function w8(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function nB(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Zr(n){return n*(an/180)}function ZI(n){return n*(180/an)}function TD(n){if(!Tn(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function iB(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*an&&(r+=on),{angle:r,distance:s}}function KA(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function v8(n,t){return(n-t+m8)%on-an}function zs(n){return(n%on+on)%on}function Eb(n,t,e,i){const s=zs(n),r=zs(t),o=zs(e),a=zs(r-s),l=zs(o-s),c=zs(s-r),u=zs(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function ui(n,t,e){return Math.max(t,Math.min(e,n))}function y8(n){return ui(n,-32768,32767)}function el(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function QI(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const tl=(n,t,e,i)=>QI(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),_8=(n,t,e)=>QI(n,e,i=>n[i][t]>=e);function E8(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const sB=["push","pop","shift","splice","unshift"];function S8(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}
16),sB.forEach(e=>{const i="_onData"+JI(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function xD(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(sB.forEach(r=>{delete n[r]}),delete n._chartjs)}function rB(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const oB=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function aB(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,oB.call(window,()=>{i=!1,n.apply(t,e)}))}}function T8(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const eP=n=>n==="start"?"left":n==="end"?"right":"center",Ri=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,x8=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function lB(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,_parsed:a}=n,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:h}=o.getUserBounds();d&&(s=ui(Math.min(tl(a,l,c).lo,e?i:tl(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=ui(Math.max(tl(a,o.axis,u,!0).hi+1,e?0:tl(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function cB(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const t_=n=>n===0||n===1,AD=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*on/e)),CD=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*on/e)+1,Zp={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Dn)+1,easeOutSine:n=>Math.sin(n*Dn),easeInOutSine:n=>-.5*(Math.cos(an*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>t_(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>t_(n)?n:AD(n,.075,.3),easeOutElastic:n=>t_(n)?n:CD(n,.075,.3),easeInOutElastic(n){return t_(n)?n:n<.5?.5*AD(n*2,.1125,.45):.5+.5*CD(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Zp.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Zp.easeInBounce(n*2)*.5:Zp.easeOutBounce(n*2-1)*.5+.5};function tP(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function kD(n){return tP(n)?n:new vb(n)}function kx(n){return tP(n)?n:new vb(n).saturate(.5).darken(.1).hexString()}const A8=["x","y","borderWidth","radius","tension"],C8=["color","borderColor","backgroundColor"];function k8(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:C8},numbers:{type:"number",properties:A8}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function I8(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ID=new Map;function P8(n,t){t=t||{};const e=n+JSON.stringify(t);let i=ID.get(e);
16return i||(i=new Intl.NumberFormat(n,t),ID.set(e,i)),i}function gy(n,t,e){return P8(t,e).format(n)}const uB={values(n){return rn(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=M8(n,e)}const o=yc(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),gy(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(yc(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?uB.numeric.call(this,n,t,e):""}};function M8(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var tT={formatters:uB};function O8(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:tT.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ch=Object.create(null),XA=Object.create(null);function Qp(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Ix(n,t,e){return typeof t=="string"?yb(Qp(n,t),e):yb(Qp(n,""),t)}class D8{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>kx(s.backgroundColor),this.hoverBorderColor=(i,s)=>kx(s.borderColor),this.hoverColor=(i,s)=>kx(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={}
vendor: 5,107 bytes, line 16
16,this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ix(this,t,e)}get(t){return Qp(this,t)}describe(t,e){return Ix(XA,t,e)}override(t,e){return Ix(ch,t,e)}route(t,e,i,s){const r=Qp(this,t),o=Qp(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return St(l)?Object.assign({},c,l):lt(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var pn=new D8({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[k8,I8,O8]);function R8(n){return!n||Ot(n.size)||Ot(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function nE(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function L8(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,h;for(l=0;l<a;l++)if(d=e[l],d!=null&&!rn(d))o=nE(n,s,r,o,d);else if(rn(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!rn(h)&&(o=nE(n,s,r,o,h));n.restore();const f=r.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[r[l]];r.splice(0,f)}return o}function lu(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function PD(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function JA(n,t,e,i){dB(n,t,e,i,null)}function dB(n,t,e,i,s){let r,o,a,l,c,u,d,h;const f=t.pointStyle,p=t.rotation,v=t.radius;let E=(p||0)*p8;if(f&&typeof f=="object"&&(r=f.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(E),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),f){default:s?n.ellipse(e,i,s/2,v,0,0,on):n.arc(e,i,v,0,on),n.closePath();break;case"triangle":u=s?s/2:v,n.moveTo(e+Math.sin(E)*u,i-Math.cos(E)*v),E+=ED,n.lineTo(e+Math.sin(E)*u,i-Math.cos(E)*v),E+=ED,n.lineTo(e+Math.sin(E)*u,i-Math.cos(E)*v),n.closePath();break;case"rectRounded":c=v*.516,l=v-c,o=Math.cos(E+au)*l,d=Math.cos(E+au)*(s?s/2-c:l),a=Math.sin(E+au)*l,h=Math.sin(E+au)*(s?s/2-c:l),n.arc(e-d,i-a,c,E-an,E-Dn),n.arc(e+h,i-o,c,E-Dn,E),n.arc(e+d,i+a,c,E,E+Dn),n.arc(e-h,i+o,c,E+Dn,E+an),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*v,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}E+=au;case"rectRot":d=Math.cos(E)*(s?s/2:v),o=Math.cos(E)*v,a=Math.sin(E)*v,h=Math.sin(E)*(s?s/2:v),n.moveTo(e-d,i-a),n.lineTo(e+h,i-o),n.lineTo(e+d,i+a),n.lineTo(e-h,i+o),n.closePath();break;case"crossRot":E+=au;case"cross":d=Math.cos(E)*(s?s/2:v),o=Math.cos(E)*v,a=Math.sin(E)*v,h=Math.sin(E)*(s?s/2:v),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o);break;case"star":d=Math.cos(E)*(s?s/2:v),o=Math.cos(E)*v,a=Math.sin(E)*v,h=Math.sin(E)*(s?s/2:v),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o),E+=au,d=Math.cos(E)*(s?s/2:v),o=Math.cos(E)*v,a=Math.sin(E)*v,h=Math.sin(E)*(s?s/2:v),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o);break;case"line":o=s?s/2:Math.cos(E)*v,a=Math.sin(E)*v,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(E)*(s?s/2:v),i+Math.sin(E)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function nl(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function nT(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function iT(n){n.restore()}function F8(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function N8(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function B8(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),Ot(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function V8(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function H8(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function uh(n,t,e,i,s,r={}){const o=rn(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,B8(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&H8(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),Ot(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),V8(n,e,i,c,r),i+=Number(s.lineHeight);
16n.restore()}function Sb(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*an,an,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,an,Dn,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,Dn,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-Dn,!0),n.lineTo(e+o.topLeft,i)}const z8=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,$8=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function W8(n,t){const e=(""+n).match(z8);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const U8=n=>+n||0;function nP(n,t){const e={},i=St(t),s=i?Object.keys(t):t,r=St(n)?i?o=>lt(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=U8(r(o));return e}function hB(n){return nP(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Zd(n){return nP(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Hi(n){const t=hB(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Xn(n,t){n=n||{},t=t||pn.font;let e=lt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=lt(n.style,t.style);i&&!(""+i).match($8)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:lt(n.family,t.family),lineHeight:W8(lt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:lt(n.weight,t.weight),string:""};return s.string=R8(s),s}function Tp(n,t,e,i){let s=!0,r,o,a;for(r=0,o=n.length;r<o;++r)if(a=n[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&rn(a)&&(a=a[e%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function j8(n,t,e){const{min:i,max:s}=n,r=eB(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function qc(n,t){return Object.assign(Object.create(n),t)}function iP(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=pB("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>iP([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return gB(a,l,()=>Q8(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return OD(a).includes(l)},ownKeys(a){return OD(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function lm(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:fB(n,i),setContext:r=>lm(n,r,e,i),override:r=>lm(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return gB(r,o,()=>Y8(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function fB(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Bc(e)?e:()=>e,isIndexable:Bc(i)?i:()=>i}}const G8=(n,t)=>n?n+JI(t):t,sP=(n,t)=>St(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gB(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Y8(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return Bc(a)&&o.isScriptable(t)&&(a=q8(t,a,n,e)),rn(a)&&a.length&&(a=K8(t,a,n,o.isIndexable)),sP(t,a)&&(a=lm(a,s,r&&r[t],o)),a}function q8(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),sP(n,l)&&(l=rP(s._scopes,s,n,l)),l}function K8(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];
vendor: 5,800 bytes, line 16
16if(St(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=rP(c,s,n,u);t.push(lm(d,r,o&&o[n],a))}}return t}function mB(n,t,e){return Bc(n)?n(t,e):n}const X8=(n,t)=>n===!0?t:typeof n=="string"?Nc(t,n):void 0;function J8(n,t,e,i,s){for(const r of t){const o=X8(e,r);if(o){n.add(o);const a=mB(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function rP(n,t,e,i){const s=t._rootScopes,r=mB(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=MD(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=MD(a,o,r,l,i),l===null)?!1:iP(Array.from(a),[""],s,r,()=>Z8(t,e,i))}function MD(n,t,e,i,s){for(;e;)e=J8(n,t,e,i,s);return e}function Z8(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return rn(s)&&St(e)?e:s||{}}function Q8(n,t,e,i){let s;for(const r of t)if(s=pB(G8(r,n),e),typeof s<"u")return sP(n,s)?rP(e,i,n,s):s}function pB(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function OD(n){let t=n._keys;return t||(t=n._keys=eG(n._scopes)),t}function eG(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function bB(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(Nc(u,r),c)};return o}const tG=Number.EPSILON||1e-14,cm=(n,t)=>t<n.length&&!n[t].skip&&n[t],wB=n=>n==="x"?"y":"x";function nG(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=KA(r,s),l=KA(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function iG(n,t,e){const i=n.length;let s,r,o,a,l,c=cm(n,0);for(let u=0;u<i-1;++u)if(l=c,c=cm(n,u+1),!(!l||!c)){if(Jp(t[u],0,tG)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function sG(n,t,e="x"){const i=wB(e),s=n.length;let r,o,a,l=cm(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=cm(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function rG(n,t="x"){const e=wB(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=cm(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=cm(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?Ko(s[o-1])!==Ko(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}iG(n,s,r),sG(n,r,t)}function n_(n,t,e){return Math.max(Math.min(n,e),t)}function oG(n,t){let e,i,s,r,o,a=nl(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&nl(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=n_(s.cp1x,t.left,t.right),s.cp1y=n_(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=n_(s.cp2x,t.left,t.right),s.cp2y=n_(s.cp2y,t.top,t.bottom)))}function aG(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")rG(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=nG(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&oG(n,e)}function oP(){return typeof window<"u"&&typeof document<"u"}function aP(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function iE(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const sT=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function lG(n,t){return sT(n).getPropertyValue(t)}const cG=["top","right","bottom","left"];function Qd(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=cG[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const uG=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function dG(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(uG(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function wu(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=sT(e),r=s.boxSizing==="border-box",o=Qd(s,"padding"),a=Qd(s,"border","width"),{x:l,y:c,box:u}=dG(n,e),d=o.left+(u&&a.left),h=o.top+(u&&a.top);let{width:f,height:p}=t;return r&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-h)/p*e.height/i)}}function hG(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&aP(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=sT(r),l=Qd(a,"border","width"),c=Qd(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=iE(a.maxWidth,r,"clientWidth"),s=iE(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||tE,maxHeight:s||tE}}const i_=n=>Math.round(n*10)/10;function fG(n,t,e,i){const s=sT(n),r=Qd(s,"margin"),o=iE(s.maxWidth,n,"clientWidth")||tE,a=iE(s.maxHeight,n,"clientHeight")||tE,l=hG(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=Qd(s,"border","width"),f=Qd(s,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=i_(Math.min(c,o,l.maxWidth)),u=i_(Math.min(u,a,l.maxHeight)),c&&!u&&(u=i_(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=i_(Math.floor(u*i))),{width:c,height:u}}function DD(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const gG=function(){let n=!1;
16try{const t={get passive(){return n=!0,!1}};oP()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function RD(n,t){const e=lG(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vu(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function mG(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function pG(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=vu(n,s,e),a=vu(s,r,e),l=vu(r,t,e),c=vu(o,a,e),u=vu(a,l,e);return vu(c,u,e)}const bG=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},wG=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function wf(n,t,e){return n?bG(t,e):wG()}function vB(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function yB(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function _B(n){return n==="angle"?{between:Eb,compare:v8,normalize:zs}:{between:el,compare:(t,e)=>t-e,normalize:t=>t}}function LD({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function vG(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=_B(i),l=t.length;let{start:c,end:u,loop:d}=n,h,f;if(d){for(c+=l,u+=l,h=0,f=l;h<f&&o(a(t[c%l][i]),s,r);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function EB(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=_B(i),{start:u,end:d,loop:h,style:f}=vG(n,t,e),p=[];let v=!1,E=null,x,A,O;const I=()=>l(s,O,x)&&a(s,O)!==0,T=()=>a(r,x)===0||l(r,O,x),P=()=>v||I(),k=()=>!v||T();for(let D=u,U=u;D<=d;++D)A=t[D%o],!A.skip&&(x=c(A[i]),x!==O&&(v=l(x,s,r),E===null&&P()&&(E=a(x,s)===0?D:U),E!==null&&k()&&(p.push(LD({start:E,end:D,loop:h,count:o,style:f})),E=null),U=D,O=x));return E!==null&&p.push(LD({start:E,end:d,loop:h,count:o,style:f})),p}function SB(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=EB(i[s],n.points,t);r.length&&e.push(...r)}return e}function yG(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function _G(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function EG(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=yG(e,s,r,i);if(i===!0)return FD(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return FD(n,_G(e,o,l,c),e,t)}function FD(n,t,e,i){return!i||!i.setContext||!e?t:SG(n,t,e,i)}function SG(n,t,e,i){const s=n._chart.getContext(),r=ND(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,h=d;function f(p,v,E,x){const A=a?-1:1;if(p!==v){for(p+=l;e[p%l].skip;)p-=A;for(;e[v%l].skip;)v+=A;p%l!==v%l&&(c.push({start:p%l,end:v%l,loop:E,style:x}),u=x,d=v%l)}}for(const p of t){d=a?d:p.start;let v=e[d%l],E;for(h=d+1;h<=p.end;h++){const x=e[h%l];E=ND(i.setContext(qc(s,{type:"segment",p0:v,p1:x,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),TG(E,u)&&f(d,h-1,p.loop,u),v=x,u=E}d<h-1&&f(d,h-1,p.loop,u)}return c}function ND(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function TG(n,t){if(!t)return!1;const e=[],i=function(s,r){return tP(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*! 17 * Chart.js v4.4.7 18 * https://www.chartjs.org 19 * (c) 2024 Chart.js Contributors 20 * Released under the MIT License 21 */class xG{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=oB.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;
21this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var da=new xG;const BD="transparent",AG={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=kD(n||BD),s=i.valid&&kD(t||BD);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class CG{constructor(t,e,i,s){const r=e[i];s=Tp([t.to,s,r,t.from]);const o=Tp([t.from,r,s]);this._active=!0,this._fn=t.fn||AG[t.type||typeof o],this._easing=Zp[t.easing]||Zp.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Tp([t.to,e,s,t.from]),this._from=Tp([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class TB{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!St(t))return;const e=Object.keys(pn.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!St(r))return;const o={};for(const a of e)o[a]=r[a];(rn(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=IG(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&kG(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new CG(h,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return da.add(this._chart,i),!0}}function kG(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function IG(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function VD(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function PG(n,t,e){if(e===!1)return!1;const i=VD(n,e),s=VD(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function MG(n){let t,e,i,s;return St(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function xB(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function HD(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(u=!0,i.all)continue;break}c=n.values[l],Tn(c)&&(r||t===0||Ko(t)===Ko(c))&&(t+=c)}return!u&&!i.all?0:t}function OG(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function Px(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function DG(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function RG(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function LG(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function zD(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function $D(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=DG(r,o,i),d=t.length;let h;for(let f=0;f<d;++f){const p=t[f],{[l]:v,[c]:E}=p,x=p._stacks||(p._stacks={});h=x[c]=LG(s,u,v),h[a]=E,h._top=zD(h,o,!0,i.type),h._bottom=zD(h,o,!1,i.type);const A=h._visualValues||(h._visualValues={});A[a]=E}}function Mx(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function FG(n,t){return qc(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function NG(n,t,e){return qc(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Jm(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;
vendor: 5,066 bytes, line 21
21if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Ox=n=>n==="reset"||n==="none",WD=(n,t)=>t?n:Object.assign({},n),BG=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:xB(e,!0),values:null};class io{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Px(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Jm(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,r=e.xAxisID=lt(i.xAxisID,Mx(t,"x")),o=e.yAxisID=lt(i.yAxisID,Mx(t,"y")),a=e.rAxisID=lt(i.rAxisID,Mx(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&xD(this._data,this),t._stacked&&Jm(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(St(e)){const s=this._cachedMeta;this._data=OG(e,s)}else if(i!==e){if(i){xD(i,this);const s=this._cachedMeta;Jm(s),s._parsed=[]}e&&Object.isExtensible(e)&&S8(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Px(e.vScale,e),e.stack!==i.stack&&(s=!0,Jm(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&($D(this,e._parsed),e._stacked=Px(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{rn(s[t])?h=this.parseArrayData(i,s,t,e):St(s[t])?h=this.parseObjectData(i,s,t,e):h=this.parsePrimitiveData(i,s,t,e);const f=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(f()&&(l=!1),c=d);i._sorted=l}o&&$D(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let h,f,p;for(h=0,f=s;h<f;++h)p=h+i,d[h]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,h,f;for(u=0,d=s;u<d;++u)h=u+i,f=e[h],c[u]={x:r.parse(Nc(f,a),h),y:o.parse(Nc(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:xB(s,!0),values:e._stacks[t.axis]._visualValues};return HD(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=HD(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=BG(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=RG(a);let h,f;function p(){f=s[h];const v=f[a.axis];return!Tn(f[t.axis])||u>v||d<v}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),r));++h);if(r){for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Tn(o)&&i.push(o);return i}getMaxOverflow(){return!1}
vendor: 5,770 bytes, line 21
21getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=MG(lt(this.options.clip,PG(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=NG(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=FG(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&_b(i);if(a)return WD(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),f=Object.keys(pn.elements[t]),p=()=>this.getContext(i,s,e),v=c.resolveNamedOptions(h,f,p,d);return v.$shared&&(v.$shared=l,r[o]=Object.freeze(WD(v,l))),v}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new TB(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ox(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Ox(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ox(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Jm(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}y(io,"defaults",{}),y(io,"datasetElementType",null),y(io,"dataElementType",null);function VG(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=rB(i.sort((s,r)=>s-r))}return n._cache.$bar}function HG(n){const t=n.iScale,e=VG(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(_b(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function zG(n,t,e,i){const s=e.barThickness;let r,o;return Ot(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function $G(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function WG(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}
vendor: 5,793 bytes, line 21
21function AB(n,t,e,i){return rn(n)?WG(n,t,e,i):t[e.axis]=e.parse(n,i),t}function UD(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(AB(h,d,r,c));return l}function Dx(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function UG(n,t,e){return n!==0?Ko(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function jG(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function GG(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=jG(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[jD(u,o,a,l)]=!0,s=c)),r[jD(s,o,a,l)]=!0,n.borderSkipped=r}function jD(n,t,e,i){return i?(n=YG(n,t,e),n=GD(n,e,t)):n=GD(n,t,e),n}function YG(n,t,e){return n===t?e:n===e?t:n}function GD(n,t,e){return n==="start"?t:n==="end"?e:n}function qG(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class K_ extends io{parsePrimitiveData(t,e,i,s){return UD(t,e,i,s)}parseArrayData(t,e,i,s){return UD(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let h,f,p,v;for(h=i,f=i+s;h<f;++h)v=e[h],p={},p[r.axis]=r.parse(Nc(v,c),h),d.push(AB(Nc(v,u),p,o,h));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Dx(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const p=this.getParsed(f),v=r||Ot(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),E=this._calculateBarIndexPixels(f,u),x=(p._stacks||{})[a.axis],A={horizontal:c,base:v.base,enableBorderRadius:!x||Dx(p._custom)||o===x._top||o===x._bottom,x:c?v.head:E.center,y:c?E.center:v.head,height:c?E.size:Math.abs(v.size),width:c?Math.abs(v.size):E.size};h&&(A.options=d||this.resolveDataElementOptions(f,t[f].active?"active":s));const O=A.options||t[f].options;GG(A,O,x,o),qG(A,O,u.ratio),this.updateElement(t[f],f,A,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(f=>f[i.axis]===l),h=d&&d[u.vScale.axis];if(Ot(h)||isNaN(h))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||HG(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Dx(c);let d=l[e.axis],h=0,f=i?this.applyStack(e,l,i):d,p,v;f!==d&&(h=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&Ko(d)!==Ko(c.barEnd)&&(h=0),h+=d);const E=!Ot(r)&&!u?r:h;let x=e.getPixelForValue(E);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+f):p=x,v=p-x,Math.abs(v)<o){v=UG(v,e,a)*o,d===a&&(x-=v/2);const A=e.getPixelForDecimal(0),O=e.getPixelForDecimal(1),I=Math.min(A,O),T=Math.max(A,O);x=Math.max(Math.min(x,T),I),p=x+v,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(x))}if(x===e.getPixelForValue(a)){const A=Ko(v)*e.getLineWidthForValue(a)/2;x+=A,v-=A}return{size:v,base:x,head:p,center:p+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=lt(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?$G(t,e,s,c):zG(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}y(K_,"id","bar"),y(K_,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),y(K_,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class X_ extends io{initialize(){this.enableOptionSharing=!0,super.initialize()}
vendor: 4,316 bytes, line 21
21parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=lt(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=lt(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let h=e;h<e+i;h++){const f=t[h],p=!r&&this.getParsed(h),v={},E=v[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),x=v[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);v.skip=isNaN(E)||isNaN(x),c&&(v.options=l||this.resolveDataElementOptions(h,f.active?"active":s),r&&(v.options.radius=0)),this.updateElement(f,h,v,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=lt(i&&i._custom,r),s}}y(X_,"id","bubble"),y(X_,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),y(X_,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function KG(n,t,e){let i=1,s=1,r=0,o=0;if(t<on){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),f=(O,I,T)=>Eb(O,a,l,!0)?1:Math.max(I,I*e,T,T*e),p=(O,I,T)=>Eb(O,a,l,!0)?-1:Math.min(I,I*e,T,T*e),v=f(0,c,d),E=f(Dn,u,h),x=p(an,c,d),A=p(an+Dn,u,h);i=(v-x)/2,s=(E-A)/2,r=-(v+x)/2,o=-(E+A)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class ku extends io{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(St(i[t])){const{key:l="value"}=this._parsing;r=c=>+Nc(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Zr(this.options.rotation-90)}_getCircumference(){return Zr(this.options.circumference)}_getRotationExtents(){let t=on,e=-on;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(c8(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:p,offsetY:v}=KG(d,u,l),E=(i.width-o)/h,x=(i.height-o)/f,A=Math.max(Math.min(E,x)/2,0),O=eB(this.options.radius,A),I=Math.max(O*l,0),T=(O-I)/this._getVisibleDatasetWeightTotal();this.offsetX=p*O,this.offsetY=v*O,s.total=this.calculateTotal(),this.outerRadius=O-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/on)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=r&&c.animateScale,f=h?0:this.innerRadius,p=
vendor: 9,718 bytes, line 21
21h?0:this.outerRadius,{sharedOptions:v,includeOptions:E}=this._getSharedOptions(e,s);let x=this._getRotation(),A;for(A=0;A<e;++A)x+=this._circumference(A,r);for(A=e;A<e+i;++A){const O=this._circumference(A,r),I=t[A],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+O,circumference:O,outerRadius:p,innerRadius:f};E&&(T.options=v||this.resolveDataElementOptions(A,I.active?"active":s)),x+=O,this.updateElement(I,A,T,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?on*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=gy(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(lt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}y(ku,"id","doughnut"),y(ku,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),y(ku,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),y(ku,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class J_ extends io{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=lB(e,s,o);this._drawStart=a,this._drawCount=l,cB(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),h=o.axis,f=a.axis,{spanGaps:p,segment:v}=this.options,E=am(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||r||s==="none",A=e+i,O=t.length;let I=e>0&&this.getParsed(e-1);for(let T=0;T<O;++T){const P=t[T],k=x?P:{};if(T<e||T>=A){k.skip=!0;continue}const D=this.getParsed(T),U=Ot(D[f]),Y=k[h]=o.getPixelForValue(D[h],T),K=k[f]=r||U?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[f],T);k.skip=isNaN(Y)||isNaN(K)||U,k.stop=T>0&&Math.abs(D[h]-I[h])>E,v&&(k.parsed=D,k.raw=c.data[T]),d&&(k.options=u||this.resolveDataElementOptions(T,P.active?"active":s)),x||this.updateElement(P,T,k,s),I=D}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}y(J_,"id","line"),y(J_,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),y(J_,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class eb extends io{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=gy(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return bB.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*an;let f=h,p;const v=360/this.countVisibleElements();for(p=0;p<e;++p)f+=this._computeAngle(p,s,v);for(p=e;p<e+i;p++){const E=t[p];let x=f,A=f+this._computeAngle(p,s,v),O=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=A,r&&(l.animateScale&&(O=0),l.animateRotate&&(x=A=h));const I={x:u,y:d,innerRadius:0,outerRadius:O,startAngle:x,endAngle:A,options:this.resolveDataElementOptions(p,E.active?"active":s)};this.updateElement(E,p,I,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Zr(this.resolveDataElementOptions(t,e).angle||i):0}}y(eb,"id","polarArea"),y(eb,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),y(eb,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ZA extends ku{}y(ZA,"id","pie"),y(ZA,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Z_ extends io{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return bB.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,h=o?r.yCenter:u.y,f={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,f,s)}}}y(Z_,"id","radar"),y(Z_,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),y(Z_,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Q_ extends io{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=lB(e,i,s);if(this._drawStart=r,this._drawCount=o,cB(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),h=this.includeOptions(s,d),f=
21o.axis,p=a.axis,{spanGaps:v,segment:E}=this.options,x=am(v)?v:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||r||s==="none";let O=e>0&&this.getParsed(e-1);for(let I=e;I<e+i;++I){const T=t[I],P=this.getParsed(I),k=A?T:{},D=Ot(P[p]),U=k[f]=o.getPixelForValue(P[f],I),Y=k[p]=r||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],I);k.skip=isNaN(U)||isNaN(Y)||D,k.stop=I>0&&Math.abs(P[f]-O[f])>x,E&&(k.parsed=P,k.raw=c.data[I]),h&&(k.options=d||this.resolveDataElementOptions(I,T.active?"active":s)),A||this.updateElement(T,I,k,s),O=P}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}y(Q_,"id","scatter"),y(Q_,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),y(Q_,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var XG=Object.freeze({__proto__:null,BarController:K_,BubbleController:X_,DoughnutController:ku,LineController:J_,PieController:ZA,PolarAreaController:eb,RadarController:Z_,ScatterController:Q_});function cu(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class lP{constructor(t){y(this,"options");this.options=t||{}}static override(t){Object.assign(lP.prototype,t)}init(){}formats(){return cu()}parse(){return cu()}format(){return cu()}add(){return cu()}diff(){return cu()}startOf(){return cu()}endOf(){return cu()}}var CB={_date:lP};function JG(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?_8:tl;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function my(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:h}=JG(r[a],t,o,s);for(let f=d;f<=h;++f){const p=u[f];p.skip||i(p,c,f)}}}function ZG(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Rx(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||my(n,e,t,function(a,l,c){!s&&!nl(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function QG(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=iB(o,{x:t.x,y:t.y});Eb(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return my(n,e,t,r),s}function e9(n,t,e,i,s,r){let o=[];const a=ZG(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const f=u.inRange(t.x,t.y,s);if(i&&!f)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!f)return;const E=a(t,p);E<l?(o=[{element:u,datasetIndex:d,index:h}],l=E):E===l&&o.push({element:u,datasetIndex:d,index:h})}return my(n,e,t,c),o}function Lx(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?QG(n,t,e,s):e9(n,t,e,i,s,r)}function YD(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return my(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var t9={evaluateInteractionItems:my,modes:{index(n,t,e,i){const s=wu(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Rx(n,s,r,i,o):Lx(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=wu(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Rx(n,s,r,i,o):Lx(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=wu(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Rx(n,s,r,i,o)},nearest(n,t,e,i){const s=wu(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Lx(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=wu(t,n);return YD(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=wu(t,n);return YD(n,s,"y",e.intersect,i)}}};const kB=["left","top","right","bottom"];function Zm(n,t){return n.filter(e=>e.pos===t)}function qD(n,t){return n.filter(e=>kB.indexOf(e.pos)===-1&&e.box.axis===t)}function Qm(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;
vendor: 4,337 bytes, line 21
21return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function n9(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function i9(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!kB.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function s9(n,t){const e=i9(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function r9(n){const t=n9(n),e=Qm(t.filter(c=>c.box.fullSize),!0),i=Qm(Zm(t,"left"),!0),s=Qm(Zm(t,"right")),r=Qm(Zm(t,"top"),!0),o=Qm(Zm(t,"bottom")),a=qD(t,"x"),l=qD(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Zm(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function KD(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function IB(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function o9(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!St(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&IB(o,r.getPadding());const a=Math.max(0,t.outerWidth-KD(o,n,"left","right")),l=Math.max(0,t.outerHeight-KD(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function a9(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function l9(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function xp(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,l9(a.horizontal,t));const{same:d,other:h}=o9(t,e,a,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(a)}return c&&xp(s,t,e,i)||u}function s_(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function XD(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,h=c.size||l.height;_b(c.start)&&(o=c.start),l.fullSize?s_(l,s.left,o,e.outerWidth-s.right-s.left,h):s_(l,t.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,h=c.size||l.width;_b(c.start)&&(r=c.start),l.fullSize?s_(l,r,s.top,h,e.outerHeight-s.bottom-s.top):s_(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var Bi={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Hi(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=r9(n.boxes),l=a.vertical,c=a.horizontal;$t(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const u=l.reduce((v,E)=>E.box.options&&E.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);IB(h,Hi(i));const f=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=s9(l.concat(c),d);xp(a.fullSize,f,d,p),xp(l,f,d,p),xp(c,f,d,p)&&xp(l,f,d,p),a9(f),XD(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,XD(a.rightAndBottom,f,d,p),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},$t(a.chartArea,v=>{const E=v.box;Object.assign(E,n.chartArea),E.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class PB{acquireContext(t,e){}releaseContext(t){return!1}
21addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class c9 extends PB{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const e0="$chartjs",u9={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},JD=n=>n===null||n==="";function d9(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[e0]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",JD(s)){const r=RD(n,"width");r!==void 0&&(n.width=r)}if(JD(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=RD(n,"height");r!==void 0&&(n.height=r)}return n}const MB=gG?{passive:!0}:!1;function h9(n,t,e){n&&n.addEventListener(t,e,MB)}function f9(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,MB)}function g9(n,t){const e=u9[n.type]||n.type,{x:i,y:s}=wu(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function sE(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function m9(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||sE(a.addedNodes,i),o=o&&!sE(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function p9(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||sE(a.removedNodes,i),o=o&&!sE(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Tb=new Map;let ZD=0;function OB(){const n=window.devicePixelRatio;n!==ZD&&(ZD=n,Tb.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function b9(n,t){Tb.size||window.addEventListener("resize",OB),Tb.set(n,t)}function w9(n){Tb.delete(n),Tb.size||window.removeEventListener("resize",OB)}function v9(n,t,e){const i=n.canvas,s=i&&aP(i);if(!s)return;const r=aB((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),b9(n,r),o}function Fx(n,t,e){e&&e.disconnect(),t==="resize"&&w9(n)}function y9(n,t,e){const i=n.canvas,s=aB(r=>{n.ctx!==null&&e(g9(r,n))},n);return h9(i,t,s),s}class _9 extends PB{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(d9(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[e0])return!1;const i=e[e0].initial;["height","width"].forEach(r=>{const o=i[r];Ot(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[e0],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:m9,detach:p9,resize:v9}[e]||y9;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Fx,detach:Fx,resize:Fx}[e]||f9)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return fG(t,e,i,s)}isAttached(t){const e=t&&aP(t);return!!(e&&e.isConnected)}}function E9(n){return!oP()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?c9:_9}var U_;let vl=(U_=class{constructor(){y(this,"x");y(this,"y");y(this,"active",!1);y(this,"options");y(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return am(this.x)&&am(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}},y(U_,"defaults",{}),y(U_,"defaultRoutes"),U_);function S9(n,t){const e=n.options.ticks,i=T9(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?A9(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return C9(t,c,r,o/s),c;const u=x9(r,t,s);if(o>0){let d,h;const f=o>1?Math.round((l-a)/(o-1)):null;for(r_(t,c,u,Ot(f)?0:a-f,a),d=0,h=o-1;d<h;d++)r_(t,c,u,r[d],r[d+1]);return r_(t,c,u,l,Ot(f)?t.length:l+f),c}return r_(t,c,u),c}function T9(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function x9(n,t,e){const i=k9(n),s=t.length/e;if(!i)return Math.max(s,1);const r=b8(i);for(let o=0,a=r.length-1;o<a;
21o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function A9(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function C9(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function r_(n,t,e,i,s){const r=lt(i,0),o=Math.min(lt(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function k9(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const I9=n=>n==="left"?"right":n==="right"?"left":n,QD=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,eR=(n,t)=>Math.min(t||n,n);function tR(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function P9(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function M9(n,t){$t(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function ep(n){return n.drawTicks?n.tickLength:0}function nR(n,t){if(!n.display)return 0;const e=Xn(n.font,t),i=Hi(n.padding);return(rn(n.text)?n.text.length:1)*e.lineHeight+i.height}function O9(n,t){return qc(n,{scale:t,type:"scale"})}function D9(n,t,e){return qc(n,{tick:e,index:t,type:"tick"})}function R9(n,t,e){let i=eP(n);return(e&&t!=="right"||!e&&t==="right")&&(i=I9(i)),i}function L9(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,f,p;const v=o-s,E=a-r;if(n.isHorizontal()){if(f=Ri(i,r,a),St(e)){const x=Object.keys(e)[0],A=e[x];p=u[x].getPixelForValue(A)+v-t}else e==="center"?p=(c.bottom+c.top)/2+v-t:p=QD(n,e,t);h=a-r}else{if(St(e)){const x=Object.keys(e)[0],A=e[x];f=u[x].getPixelForValue(A)-E+t}else e==="center"?f=(c.left+c.right)/2-E+t:f=QD(n,e,t);p=Ri(i,o,s),d=e==="left"?-Dn:Dn}return{titleX:f,titleY:p,maxWidth:h,rotation:d}}class wh extends vl{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=As(t,Number.POSITIVE_INFINITY),e=As(e,Number.NEGATIVE_INFINITY),i=As(i,Number.POSITIVE_INFINITY),s=As(s,Number.NEGATIVE_INFINITY),{min:As(t,i),max:As(e,s),minDefined:Tn(t),maxDefined:Tn(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:As(e,As(i,e)),max:As(i,As(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}
vendor: 5,034 bytes, line 21
21getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=j8(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?tR(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=S9(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Qt(this.options.afterUpdate,[this])}beforeSetDimensions(){Qt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Qt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Qt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Qt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=Qt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){Qt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Qt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=eR(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=ui(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-ep(t.grid)-e.padding-nR(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=ZI(Math.min(Math.asin(ui((u.highest.height+6)/a,-1,1)),Math.asin(ui(l/c,-1,1))-Math.asin(ui(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){Qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=nR(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=ep(r)+l):(t.height=this.maxHeight,t.width=ep(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=Zr(this.labelRotation),v=Math.cos(p),E=Math.sin(p);if(a){const x=i.mirror?0:E*d.width+v*h.height;t.height=Math.min(this.maxHeight,t.height+x+f)}else{const x=i.mirror?0:v*d.width+E*h.height;t.width=Math.min(this.maxWidth,t.width+x+f)}this._calculatePadding(c,u,E,v)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=s*t.width,f=i*e.height):(h=i*t.height,f=s*e.width):r==="start"?f=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,f=e.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=
21d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Qt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)Ot(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=tR(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/eR(e,i));let c=0,u=0,d,h,f,p,v,E,x,A,O,I,T;for(d=0;d<e;d+=l){if(p=t[d].label,v=this._resolveTickFontOptions(d),s.font=E=v.string,x=r[E]=r[E]||{data:{},gc:[]},A=v.lineHeight,O=I=0,!Ot(p)&&!rn(p))O=nE(s,x.data,x.gc,O,p),I=A;else if(rn(p))for(h=0,f=p.length;h<f;++h)T=p[h],!Ot(T)&&!rn(T)&&(O=nE(s,x.data,x.gc,O,T),I+=A);o.push(O),a.push(I),c=Math.max(O,c),u=Math.max(I,u)}M9(r,e);const P=o.indexOf(c),k=a.indexOf(u),D=U=>({width:o[U]||0,height:a[U]||0});return{first:D(0),last:D(e-1),widest:D(P),highest:D(k),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return y8(this._alignToPixels?lu(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=D9(this.getContext(),t,i))}return this.$context||(this.$context=O9(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Zr(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=ep(r),f=[],p=a.setContext(this.getContext()),v=p.display?p.width:0,E=v/2,x=function(_){return lu(i,_,v)};let A,O,I,T,P,k,D,U,Y,K,j,L;if(o==="top")A=x(this.bottom),k=this.bottom-h,U=A-E,K=x(t.top)+E,L=t.bottom;else if(o==="bottom")A=x(this.top),K=t.top,L=x(t.bottom)-E,k=A+E,U=this.top+h;else if(o==="left")A=x(this.right),P=this.right-h,D=A-E,Y=x(t.left)+E,j=t.right;else if(o==="right")A=x(this.left),Y=t.left,j=x(t.right)-E,P=A+E,D=this.left+h;else if(e==="x"){if(o==="center")A=x((t.top+t.bottom)/2+.5);else if(St(o)){const _=Object.keys(o)[0],C=o[_];A=x(this.chart.scales[_].getPixelForValue(C))}K=t.top,L=t.bottom,k=A+E,U=k+h}else if(e==="y"){if(o==="center")A=x((t.left+t.right)/2);else if(St(o)){const _=Object.keys(o)[0],C=o[_];A=x(this.chart.scales[_].getPixelForValue(C))}P=A-E,D=P-h,Y=t.left,j=t.right}const N=lt(s.ticks.maxTicksLimit,d),m=Math.max(1,Math.ceil(d/N));for(O=0;O<d;O+=m){const _=this.getContext(O),C=r.setContext(_),B=a.setContext(_),$=C.lineWidth,X=C.color,Z=B.dash||[],ie=B.dashOffset,fe=C.tickWidth,ae=C.tickColor,ge=C.tickBorderDash||[],he=C.tickBorderDashOffset;I=P9(this,O,l),I!==void 0&&(T=lu(i,I,$),c?P=D=Y=j=T:k=U=K=L=T,f.push({tx1:P,ty1:k,tx2:D,ty2:U,x1:Y,y1:K,x2:j,y2:L,width:$,color:X,borderDash:Z,borderDashOffset:ie,tickWidth:fe,tickColor:ae,tickBorderDash:ge,tickBorderDashOffset:he}))}return this._ticksLength=d,this._borderValue=A,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,h=ep(i.grid),f=h+u,p=d?-u:f,v=-Zr(this.labelRotation),E=[];let x,A,O,I,T,P,k,D,U,Y,K,j,L="middle";if(s==="top")P=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")P=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){const m=this._getYAxisLabelAlignment(h);k=m.textAlign,T=m.x}else if(s==="right"){const m=this._getYAxisLabelAlignment(h);k=m.textAlign,T=m.x}else if(e==="x"){if(s==="center")P=(t.top+t.bottom)/2+f;else if(St(s)){const m=Object.keys(s)[0],_=s[m];P=this.chart.scales[m].getPixelForValue(_)+f}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")T=(t.left+t.right)/2-f;else if(St(s)){const m=Object.keys(s)[0],_=s[m];T=this.chart.scales[m].getPixelForValue(_)}k=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?L="top":l==="end"&&(L="bottom"));const N=this._getLabelSizes();for(x=0,A=a.length;x<A;++x){O=a[x],I=O.label;const m=r.setContext(this.getContext(x));D=this.getPixelForTick(x)+r.labelOffset,U=this._resolveTickFontOptions(x),Y=U.lineHeight,K=rn(I)?I.length:1;const _=K/2,C=m.color,B=m.textStrokeColor,$=m.textStrokeWidth;let X=k;
vendor: 1,924 bytes, line 21
21o?(T=D,k==="inner"&&(x===A-1?X=this.options.reverse?"left":"right":x===0?X=this.options.reverse?"right":"left":X="center"),s==="top"?c==="near"||v!==0?j=-K*Y+Y/2:c==="center"?j=-N.highest.height/2-_*Y+Y:j=-N.highest.height+Y/2:c==="near"||v!==0?j=Y/2:c==="center"?j=N.highest.height/2-_*Y:j=N.highest.height-K*Y,d&&(j*=-1),v!==0&&!m.showLabelBackdrop&&(T+=Y/2*Math.sin(v))):(P=D,j=(1-K)*Y/2);let Z;if(m.showLabelBackdrop){const ie=Hi(m.backdropPadding),fe=N.heights[x],ae=N.widths[x];let ge=j-ie.top,he=0-ie.left;switch(L){case"middle":ge-=fe/2;break;case"bottom":ge-=fe;break}switch(k){case"center":he-=ae/2;break;case"right":he-=ae;break;case"inner":x===A-1?he-=ae:x>0&&(he-=ae/2);break}Z={left:he,top:ge,width:ae+ie.width,height:fe+ie.height,color:m.backdropColor}}E.push({label:I,font:U,textOffset:j,options:{rotation:v,color:C,strokeColor:B,strokeWidth:$,textAlign:X,textBaseline:L,translation:[T,P],backdrop:Z}})}return E}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Zr(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};
vendor: 4,873 bytes, line 21
21if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=lu(t,this.left,o)-o/2,u=lu(t,this.right,a)+a/2,d=h=l):(d=lu(t,this.top,o)-o/2,h=lu(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&nT(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;uh(i,c,0,u,l,a)}s&&iT(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=Xn(i.font),o=Hi(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||St(e)?(l+=o.bottom,rn(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=L9(this,l,e,a);uh(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:R9(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=lt(t.grid&&t.grid.z,-1),s=lt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==wh.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Xn(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class o_{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;B9(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,F9(t,o,i),this.override&&pn.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in pn[s]&&(delete pn[s][i],this.override&&delete ch[i])}}function F9(n,t,e){const i=yb(Object.create(null),[e?pn.get(e):{},pn.get(t),n.defaults]);pn.set(t,i),n.defaultRoutes&&N9(t,n.defaultRoutes),n.descriptors&&pn.describe(t,n.descriptors)}function N9(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");pn.route(r,s,l,a)})}function B9(n){return"id"in n&&"defaults"in n}class V9{constructor(){this.controllers=new o_(io,"datasets",!0),this.elements=new o_(vl,"elements"),this.plugins=new o_(Object,"plugins"),this.scales=new o_(wh,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}
21removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):$t(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=JI(t);Qt(i["before"+s],[],i),e[t](i),Qt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var To=new V9;class H9{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(Qt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Ot(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=lt(i.options&&i.options.plugins,{}),r=z9(i);return s===!1&&!e?[]:W9(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function z9(n){const t={},e=[],i=Object.keys(To.plugins.items);for(let r=0;r<i.length;r++)e.push(To.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function $9(n,t){return!t&&n===!1?null:n===!0?{}:n}function W9(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=$9(i[l],s);c!==null&&r.push({plugin:a,options:U9(n.config,{plugin:a,local:e[l]},c,o)})}return r}function U9(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function QA(n,t){const e=pn.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function j9(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function G9(n,t){return n===t?"_index_":"_value_"}function iR(n){if(n==="x"||n==="y"||n==="r")return n}function Y9(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function eC(n,...t){if(iR(n))return n;for(const e of t){const i=e.axis||Y9(e.position)||n.length>1&&iR(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function sR(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function q9(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return sR(n,"x",e[0])||sR(n,"y",e[0])}return{}}function K9(n,t){const e=ch[n.type]||{scales:{}},i=t.scales||{},s=QA(n.type,t),r=Object.create(null);
21return Object.keys(i).forEach(o=>{const a=i[o];if(!St(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=eC(o,a,q9(o,n),pn.scales[a.type]),c=G9(l,s),u=e.scales||{};r[o]=Xp(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||QA(a,t),u=(ch[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=j9(d,l),f=o[h+"AxisID"]||h;r[f]=r[f]||Object.create(null),Xp(r[f],[{axis:h},i[f],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];Xp(a,[pn.scales[a.type],pn.scale])}),r}function DB(n){const t=n.options||(n.options={});t.plugins=lt(t.plugins,{}),t.scales=K9(n,t)}function RB(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function X9(n){return n=n||{},n.data=RB(n.data),DB(n),n}const rR=new Map,LB=new Set;function a_(n,t){let e=rR.get(n);return e||(e=t(),rR.set(n,e),LB.add(e)),e}const tp=(n,t,e)=>{const i=Nc(t,e);i!==void 0&&n.add(i)};let J9=class{constructor(t){this._config=X9(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=RB(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),DB(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return a_(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return a_(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return a_(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return a_(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>tp(l,t,d))),u.forEach(d=>tp(l,s,d)),u.forEach(d=>tp(l,ch[r]||{},d)),u.forEach(d=>tp(l,pn,d)),u.forEach(d=>tp(l,XA,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),LB.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ch[e]||{},pn.datasets[e]||{},{type:e},pn,XA]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=oR(this._resolverCache,t,s);let l=o;if(Q9(o,e)){r.$shared=!1,i=Bc(i)?i():i;const c=this.createResolver(t,i,a);l=lm(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=oR(this._resolverCache,t,i);return St(e)?lm(r,e,void 0,s):r}};function oR(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);
21return r||(r={resolver:iP(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Z9=n=>St(n)&&Object.getOwnPropertyNames(n).some(t=>Bc(n[t]));function Q9(n,t){const{isScriptable:e,isIndexable:i}=fB(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(Bc(a)||Z9(a))||o&&rn(a))return!0}return!1}var eY="4.4.7";const tY=["top","bottom","left","right","chartArea"];function aR(n,t){return n==="top"||n==="bottom"||tY.indexOf(n)===-1&&t==="x"}function lR(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function cR(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Qt(e&&e.onComplete,[n],t)}function nY(n){const t=n.chart,e=t.options.animation;Qt(e&&e.onProgress,[n],t)}function FB(n){return oP()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const t0={},uR=n=>{const t=FB(n);return Object.values(t0).filter(e=>e.canvas===t).pop()};function iY(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function sY(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function l_(n,t,e){return n.options.clip?n[e]:t[e]}function rY(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:l_(e,t,"left"),right:l_(e,t,"right"),top:l_(i,t,"top"),bottom:l_(i,t,"bottom")}:t}class Ea{static register(...t){To.add(...t),dR()}static unregister(...t){To.remove(...t),dR()}constructor(t,e){const i=this.config=new J9(e),s=FB(t),r=uR(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||E9(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=l8(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new H9,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=T8(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],t0[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}da.listen(this,"complete",cR),da.listen(this,"progress",nY),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return Ot(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return To}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():DD(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return PD(this.canvas,this.ctx),this}stop(){return da.stop(this),this}resize(t,e){da.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,DD(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Qt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};$t(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=eC(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$t(r,o=>{const a=o.options,l=a.id,c=eC(l,a),u=lt(a.type,o.dtype);(a.position===void 0||aR(a.position,c)!==aR(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=To.getScale(u);
21d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),$t(s,(o,a)=>{o||delete i[a]}),$t(i,o=>{Bi.configure(this,o,o.options),Bi.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(lR("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||QA(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=To.getController(a),{datasetElementType:c,dataElementType:u}=pn.datasets[a];Object.assign(l,{dataElementType:To.getElement(u),datasetElementType:c&&To.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){$t(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||$t(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(lR("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$t(this.scales,t=>{Bi.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!_D(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;iY(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!_D(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Bi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],$t(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Bc(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(da.has(this)?this.attached&&!da.running(this)&&da.start(this):(this.draw(),cR({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=rY(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};
21this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&nT(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&iT(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return nl(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=t9.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=qc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);_b(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),da.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),PD(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete t0[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};$t(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){$t(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},$t(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Q0(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=g8(t),c=sY(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Qt(r.onHover,[t,a,this],this),l&&Qt(r.onClick,[t,a,this],this));const u=!Q0(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}}y(Ea,"defaults",pn),y(Ea,"instances",t0),y(Ea,"overrides",ch),y(Ea,"registry",To),y(Ea,"version",eY),y(Ea,"getChart",uR);function dR(){return $t(Ea.instances,n=>n._plugins.invalidate())}function oY(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;
vendor: 7,606 bytes, line 21
21let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Dn,i-Dn),n.closePath(),n.clip()}function aY(n){return nP(n,["outerStart","outerEnd","innerStart","innerEnd"])}function lY(n,t,e,i){const s=aY(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return ui(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:ui(s.innerStart,0,o),innerEnd:ui(s.innerEnd,0,o)}}function Vh(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function rE(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let f=0;const p=s-l;if(i){const m=u>0?u-i:0,_=d>0?d-i:0,C=(m+_)/2,B=C!==0?p*C/(C+i):p;f=(p-B)/2}const v=Math.max(.001,p*d-e/an)/d,E=(p-v)/2,x=l+E+f,A=s-E-f,{outerStart:O,outerEnd:I,innerStart:T,innerEnd:P}=lY(t,h,d,A-x),k=d-O,D=d-I,U=x+O/k,Y=A-I/D,K=h+T,j=h+P,L=x+T/K,N=A-P/j;if(n.beginPath(),r){const m=(U+Y)/2;if(n.arc(o,a,d,U,m),n.arc(o,a,d,m,Y),I>0){const $=Vh(D,Y,o,a);n.arc($.x,$.y,I,Y,A+Dn)}const _=Vh(j,A,o,a);if(n.lineTo(_.x,_.y),P>0){const $=Vh(j,N,o,a);n.arc($.x,$.y,P,A+Dn,N+Math.PI)}const C=(A-P/h+(x+T/h))/2;if(n.arc(o,a,h,A-P/h,C,!0),n.arc(o,a,h,C,x+T/h,!0),T>0){const $=Vh(K,L,o,a);n.arc($.x,$.y,T,L+Math.PI,x-Dn)}const B=Vh(k,x,o,a);if(n.lineTo(B.x,B.y),O>0){const $=Vh(k,U,o,a);n.arc($.x,$.y,O,x-Dn,U)}}else{n.moveTo(o,a);const m=Math.cos(U)*d+o,_=Math.sin(U)*d+a;n.lineTo(m,_);const C=Math.cos(Y)*d+o,B=Math.sin(Y)*d+a;n.lineTo(C,B)}n.closePath()}function cY(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){rE(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%on||on))}return rE(n,t,e,i,l,s),n.fill(),l}function uY(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,f=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,f?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){rE(n,t,e,i,p,s);for(let v=0;v<r;++v)n.stroke();isNaN(a)||(p=o+(a%on||on))}f&&oY(n,t,p),r||(rE(n,t,e,i,p,s),n.stroke())}class Ap extends vl{constructor(e){super();y(this,"circumference");y(this,"endAngle");y(this,"fullCircles");y(this,"innerRadius");y(this,"outerRadius");y(this,"pixelMargin");y(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=iB(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,p=lt(h,c-l),v=Eb(o,l,c)&&l!==c,E=p>=on||v,x=el(a,u+f,d+f);return E&&x}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>on?Math.floor(s/on):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(an,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,cY(e,this,u,o,a),uY(e,this,u,o,a),e.restore()}}y(Ap,"id","arc"),y(Ap,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),y(Ap,"defaultRoutes",{backgroundColor:"backgroundColor"}),y(Ap,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function NB(n,t,e=t){n.lineCap=lt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(lt(e.borderDash,t.borderDash)),n.lineDashOffset=lt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=lt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=lt(e.borderWidth,t.borderWidth),n.strokeStyle=lt(e.borderColor,t.borderColor)}function dY(n,t,e){n.lineTo(e.x,e.y)}function hY(n){return n.stepped?F8:n.tension||n.cubicInterpolationMode==="monotone"?N8:dY}function BB(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function fY(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=BB(s,e,i),u=hY(r);let{move:d=!0,reverse:h}=i||{},f,p,v;for(f=0;f<=c;++f)p=s[(a+(h?c-f:f))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,v,p,h,r.stepped),v=p);return l&&(p=s[(a+(h?c:0))%o],u(n,v,p,h,r.stepped)),!!l}function gY(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=BB(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,f,p,v,E,x;const A=I=>(o+(c?a-I:I))%r,O=()=>{v!==E&&(n.lineTo(u,E),n.lineTo(u,v),n.lineTo(u,x))};for(l&&(f=s[A(0)],n.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[A(h)],f.skip)continue;const I=f.x,T=f.y,P=I|0;P===p?(T<v?v=T:T>E&&(E=T),u=(d*u+I)/++d):(O(),n.lineTo(I,T),p=P,d=0,v=E=T),x=T}O()}function tC(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?gY:fY}function mY(n){return n.stepped?mG:n.tension||n.cubicInterpolationMode==="monotone"?pG:vu}function pY(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),NB(n,t.options),n.stroke(s)}function bY(n,t,e,i){const{segments:s,options:r}=t,o=tC(t);for(const a of s)NB(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const wY=typeof Path2D=="function";function vY(n,t,e,i){wY&&!t.options.segment?pY(n,t,e,i):bY(n,t,e,i)}class _c extends vl{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;aG(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=EG(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=SB(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=mY(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],f=r[d],p=r[h];if(f===p){a.push(f);continue}const v=Math.abs((s-f[e])/(p[e]-f[e])),E=l(f,p,v,i.stepped);E[e]=t[e],a.push(E)}return a.length===1?a[0]:a}pathSegment(t,e,i){return tC(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=tC(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),vY(t,this,i,s),t.restore(
21)),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}y(_c,"id","line"),y(_c,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),y(_c,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),y(_c,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function hR(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class n0 extends vl{constructor(e){super();y(this,"parsed");y(this,"skip");y(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return hR(this,e,"x",i)}inYRange(e,i){return hR(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!nl(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,JA(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}y(n0,"id","point"),y(n0,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),y(n0,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function VB(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Ec(n,t,e,i){return n?0:ui(t,e,i)}function yY(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=hB(i);return{t:Ec(s.top,r.top,0,e),r:Ec(s.right,r.right,0,t),b:Ec(s.bottom,r.bottom,0,e),l:Ec(s.left,r.left,0,t)}}function _Y(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=Zd(s),o=Math.min(t,e),a=n.borderSkipped,l=i||St(s);return{topLeft:Ec(!l||a.top||a.left,r.topLeft,0,o),topRight:Ec(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Ec(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Ec(!l||a.bottom||a.right,r.bottomRight,0,o)}}function EY(n){const t=VB(n),e=t.right-t.left,i=t.bottom-t.top,s=yY(n,e/2,i/2),r=_Y(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function Nx(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&VB(n,i);return a&&(s||el(t,a.left,a.right))&&(r||el(e,a.top,a.bottom))}function SY(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function TY(n,t){n.rect(t.x,t.y,t.w,t.h)}function Bx(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class i0 extends vl{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=EY(this),a=SY(o.radius)?Sb:TY;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,Bx(o,e,r)),t.clip(),a(t,Bx(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Bx(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Nx(this,t,e,i)}inXRange(t,e){return Nx(this,t,null,e)}inYRange(t,e){return Nx(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}y(i0,"id","bar"),y(i0,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmou
21nt:"auto",pointStyle:void 0}),y(i0,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var xY=Object.freeze({__proto__:null,ArcElement:Ap,BarElement:i0,LineElement:_c,PointElement:n0});const nC=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],fR=nC.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function HB(n){return nC[n%nC.length]}function zB(n){return fR[n%fR.length]}function AY(n,t){return n.borderColor=HB(t),n.backgroundColor=zB(t),++t}function CY(n,t){return n.backgroundColor=n.data.map(()=>HB(t++)),t}function kY(n,t){return n.backgroundColor=n.data.map(()=>zB(t++)),t}function IY(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof ku?t=CY(e,t):s instanceof eb?t=kY(e,t):s&&(t=AY(e,t))}}function gR(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function PY(n){return n&&(n.borderColor||n.backgroundColor)}function MY(){return pn.borderColor!=="rgba(0,0,0,0.1)"||pn.backgroundColor!=="rgba(0,0,0,0.1)"}var OY={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=gR(i)||PY(s)||r&&gR(r)||MY();if(!e.forceOverride&&o)return;const a=IY(n);i.forEach(a)}};function DY(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,h,f,p,v;for(o[l++]=n[u],d=0;d<r-2;d++){let E=0,x=0,A;const O=Math.floor((d+1)*a)+1+t,I=Math.min(Math.floor((d+2)*a)+1,e)+t,T=I-O;for(A=O;A<I;A++)E+=n[A].x,x+=n[A].y;E/=T,x/=T;const P=Math.floor(d*a)+1+t,k=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:D,y:U}=n[u];for(f=p=-1,A=P;A<k;A++)p=.5*Math.abs((D-E)*(n[A].y-U)-(D-n[A].x)*(x-U)),p>f&&(f=p,h=n[A],v=A);o[l++]=h,u=v}return o[l++]=n[c],o}function RY(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,h,f,p,v;const E=[],x=t+e-1,A=n[t].x,I=n[x].x-A;for(o=t;o<t+e;++o){a=n[o],l=(a.x-A)/I*i,c=a.y;const T=l|0;if(T===u)c<p?(p=c,d=o):c>v&&(v=c,h=o),s=(r*s+a.x)/++r;else{const P=o-1;if(!Ot(d)&&!Ot(h)){const k=Math.min(d,h),D=Math.max(d,h);k!==f&&k!==P&&E.push({...n[k],x:s}),D!==f&&D!==P&&E.push({...n[D],x:s})}o>0&&P!==f&&E.push(n[P]),E.push(a),u=T,r=0,p=v=c,d=h=f=o}}return E}function $B(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function mR(n){n.data.datasets.forEach(t=>{$B(t)})}function LY(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=ui(tl(t,r.axis,o).lo,0,e-1)),c?s=ui(tl(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var FY={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){mR(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Tp([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:h}=LY(l,c);const f=e.threshold||4*i;if(h<=f){$B(s);return}Ot(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let p;switch(e.algorithm){case"lttb":p=DY(c,d,h,i,e);break;case"min-max":p=RY(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){mR(n)}};function NY(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=cP(l,c,s);const u=iC(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=SB(t,u);for(const h of d){const f=iC(e,r[h.start],r[h.end],h.loop),p=EB(a,s,f);for(const v of p)o.push({source:v,target:h,start:{[e]:pR(u,f,"start",Math.max)},end:{[e]:pR(u,f,"end",Math.min)}})}}return o}function iC(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=zs(s),r=zs(r)),{property:n,start:s,end:r}}function BY(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];
21return t.segments.forEach(({start:o,end:a})=>{a=cP(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function cP(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function pR(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function WB(n,t){let e=[],i=!1;return rn(n)?(i=!0,e=n):e=BY(n,t),e.length?new _c({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function bR(n){return n&&n.fill!==!1}function VY(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Tn(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function HY(n,t,e){const i=UY(n);if(St(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Tn(s)&&Math.floor(s)===s?zY(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function zY(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function $Y(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:St(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function WY(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:St(n)?i=n.value:i=t.getBaseValue(),i}function UY(n){const t=n.options,e=t.fill;let i=lt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function jY(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=GY(t,e);a.push(WB({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)YY(s,o[u],a)}return new _c({points:s,options:{}})}function GY(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function YY(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=qY(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function qY(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],h=o[u.end][e];if(el(s,d,h)){a=s===d,l=s===h;break}}return{first:a,last:l,point:i}}class UB{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:on},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function KY(n){const{chart:t,fill:e,line:i}=n;if(Tn(e))return XY(t,e);if(e==="stack")return jY(n);if(e==="shape")return!0;const s=JY(n);return s instanceof UB?s:WB(s,i)}function XY(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function JY(n){return(n.scale||{}).getPointPositionForValue?QY(n):ZY(n)}function ZY(n){const{scale:t={},fill:e}=n,i=$Y(e,t);if(Tn(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function QY(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=WY(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new UB({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function Vx(n,t,e){const i=KY(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(nT(n,e),eq(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),iT(n))}function eq(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&(wR(n,i,o.top),vR(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),wR(n,i,o.bottom)),vR(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function wR(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[cP(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function vR(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=NY(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=r}={}}=l,f=i!==!0;n.save(),n.fillStyle=h,tq(n,o,f&&iC(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let v;if(f){p?n.closePath():yR(n,i,d,s);const E=!!i.pathSegment(n,c,{move:p,reverse:!0});v=p&&E,v||yR(n,i,u,s)}
vendor: 5,586 bytes, line 21
21n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function tq(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function yR(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var nq={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof _c&&(l={visible:n.isDatasetVisible(o),index:o,fill:HY(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=VY(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Vx(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;bR(r)&&Vx(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!bR(i)||e.drawTime!=="beforeDatasetDraw"||Vx(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const _R=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},iq=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ER extends vl{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Qt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=Xn(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=_R(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,v)=>{const E=i+e/2+r.measureText(p.text).width;(v===0||c[c.length-1]+E+2*a>o)&&(d+=u,c[c.length-(v>0?0:1)]=0,f+=u,h++),l[v]={left:0,top:f,row:h,width:E,height:s},c[c.length-1]+=E+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,f=0,p=0,v=0;return this.legendItems.forEach((E,x)=>{const{itemWidth:A,itemHeight:O}=sq(i,e,r,E,s);x>0&&f+O+2*a>u&&(d+=h+a,c.push({width:h,height:f}),p+=h+a,v++,h=f=0),l[x]={left:p,top:f,col:v,width:A,height:O},h=Math.max(h,A),f+=O+a}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=wf(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ri(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Ri(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ri(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Ri(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;nT(t,this),this._draw(),iT(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=pn.color,l=wf(t.rtl,this.left,this.width),c=Xn(o.font),{padding:u}=o,d=c.size,h=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:v,itemHeight:E}=_R(o,d),x=function(P,k,D){if(isNaN(p)||p<=0||isNaN(v)||v<0)return;s.save();const U=lt(D.lineWidth,1);if(s.fillStyle=lt(D.fillStyle,a),s.lineCap=lt(D.lineCap,"butt"),s.lineDashOffset=lt(D.lineDashOffset,0),s.lineJoin=lt(D.lineJoin,"miter"),s.lineWidth=U,s.strokeStyle=lt(D.strokeStyle,a),s.setLineDash(lt(D.lineDash,[])),o.usePointStyle){const Y={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:U},K=l.xPlus(P,p/2),j=k+h;dB(s,Y,K,j,o.pointStyleWidth&&p)}else{const Y=k+Math.max((d-v)/2,0),K=l.leftForLtr(P,p),j=Zd(D.borderRadius);s.beginPath(),Object.values(j).some(L=>
21L!==0)?Sb(s,{x:K,y:Y,w:p,h:v,radius:j}):s.rect(K,Y,p,v),s.fill(),U!==0&&s.stroke()}s.restore()},A=function(P,k,D){uh(s,D.text,P,k+E/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},O=this.isHorizontal(),I=this._computeTitleHeight();O?f={x:Ri(r,this.left+u,this.right-i[0]),y:this.top+u+I,line:0}:f={x:this.left+u,y:Ri(r,this.top+I+u,this.bottom-e[0].height),line:0},vB(this.ctx,t.textDirection);const T=E+u;this.legendItems.forEach((P,k)=>{s.strokeStyle=P.fontColor,s.fillStyle=P.fontColor;const D=s.measureText(P.text).width,U=l.textAlign(P.textAlign||(P.textAlign=o.textAlign)),Y=p+h+D;let K=f.x,j=f.y;l.setWidth(this.width),O?k>0&&K+Y+u>this.right&&(j=f.y+=T,f.line++,K=f.x=Ri(r,this.left+u,this.right-i[f.line])):k>0&&j+T>this.bottom&&(K=f.x=K+e[f.line].width+u,f.line++,j=f.y=Ri(r,this.top+I+u,this.bottom-e[f.line].height));const L=l.x(K);if(x(L,j,P),K=x8(U,K+p+h,O?K+Y:this.right,t.rtl),A(l.x(K),j,P),O)f.x+=Y+u;else if(typeof P.text!="string"){const N=c.lineHeight;f.y+=jB(P,N)+u}else f.y+=T}),yB(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Xn(e.font),s=Hi(e.padding);if(!e.display)return;const r=wf(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Ri(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((v,E)=>Math.max(v,E.height),0);u=c+Ri(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Ri(a,d,d+h);o.textAlign=r.textAlign(eP(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,uh(o,e.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,e=Xn(t.font),i=Hi(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(el(t,this.left,this.right)&&el(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],el(t,s.left,s.left+s.width)&&el(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!aq(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=iq(s,i);s&&!r&&Qt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&Qt(e.onHover,[t,i,this],this)}else i&&Qt(e.onClick,[t,i,this],this)}}function sq(n,t,e,i,s){const r=rq(i,n,t,e),o=oq(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function rq(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function oq(n,t,e){let i=n;return typeof t.text!="string"&&(i=jB(t,e)),i}function jB(n,t){const e=n.text?n.text.length:0;return t*e}function aq(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var lq={id:"legend",_element:ER,start(n,t,e){const i=n.legend=new ER({ctx:n.ctx,options:e,chart:n});Bi.configure(n,i,e),Bi.addBox(n,i)},stop(n){Bi.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Bi.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;
21return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Hi(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class uP extends vl{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=rn(i.text)?i.text.length:1;this._padding=Hi(i.padding);const r=s*Xn(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ri(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=Ri(a,s,e),l=an*-.5):(u=r-t,d=Ri(a,e,s),l=an*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Xn(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);uh(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:eP(e.align),textBaseline:"middle",translation:[o,a]})}}function cq(n,t){const e=new uP({ctx:n.ctx,options:t,chart:n});Bi.configure(n,e,t),Bi.addBox(n,e),n.titleBlock=e}var uq={id:"title",_element:uP,start(n,t,e){cq(n,e)},stop(n){const t=n.titleBlock;Bi.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Bi.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const c_=new WeakMap;var dq={id:"subtitle",start(n,t,e){const i=new uP({ctx:n.ctx,options:e,chart:n});Bi.configure(n,i,e),Bi.addBox(n,i),c_.set(n,i)},stop(n){Bi.removeBox(n,c_.get(n)),c_.delete(n)},beforeUpdate(n,t,e){const i=c_.get(n);Bi.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cp={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=KA(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Eo(n,t){return t&&(rn(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ha(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(` 22`)>-1?n.split(` 23`):n}function hq(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function SR(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=Xn(t.bodyFont),c=Xn(t.titleFont),u=Xn(t.footerFont),d=r.length,h=s.length,f=i.length,p=Hi(t.padding);let v=p.height,E=0,x=i.reduce((I,T)=>I+T.before.length+T.lines.length+T.after.length,0);if(x+=n.beforeBody.length+n.afterBody.length,d&&(v+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const I=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;v+=f*I+(x-f)*l.lineHeight+(x-1)*t.bodySpacing}
23h&&(v+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let A=0;const O=function(I){E=Math.max(E,e.measureText(I).width+A)};return e.save(),e.font=c.string,$t(n.title,O),e.font=l.string,$t(n.beforeBody.concat(n.afterBody),O),A=t.displayColors?o+2+t.boxPadding:0,$t(i,I=>{$t(I.before,O),$t(I.lines,O),$t(I.after,O)}),A=0,e.font=u.string,$t(n.footer,O),e.restore(),E+=p.width,{width:E,height:v}}function fq(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function gq(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function mq(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),gq(c,n,t,e)&&(c="center"),c}function TR(n,t,e){const i=e.yAlign||t.yAlign||fq(n,e);return{xAlign:e.xAlign||t.xAlign||mq(n,t,e,i),yAlign:i}}function pq(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function bq(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function xR(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Zd(o);let p=pq(t,a);const v=bq(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,f)+s),{x:ui(p,0,i.width-t.width),y:ui(v,0,i.height-t.height)}}function u_(n,t,e){const i=Hi(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function AR(n){return Eo([],ha(n))}function wq(n,t,e){return qc(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function CR(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const GB={beforeTitle:aa,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:aa,beforeBody:aa,beforeLabel:aa,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return Ot(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:aa,afterBody:aa,beforeFooter:aa,footer:aa,afterFooter:aa};function os(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?GB[t].call(e,i):s}class sC extends vl{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new TB(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=wq(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=os(i,"beforeTitle",this,t),r=os(i,"title",this,t),o=os(i,"afterTitle",this,t);let a=[];return a=Eo(a,ha(s)),a=Eo(a,ha(r)),a=Eo(a,ha(o)),a}getBeforeBody(t,e){return AR(os(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return $t(t,r=>{const o={before:[],lines:[],after:[]},a=CR(i,r);Eo(o.before,ha(os(a,"beforeLabel",this,r))),Eo(o.lines,os(a,"label",this,r)),Eo(o.after,ha(os(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return AR(os(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=os(i,"beforeFooter",this,t),r=os(i,"footer",this,t),o=os(i,"afterFooter",this,t);let a=[];return a=Eo(a,ha(s)),a=Eo(a,ha(r)),a=Eo(a,ha(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(hq(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),$t(a,u=>{const d=CR(t.callbacks,u);s.push(os(d,"labelColor",this,u)),r.push(os(d,"labelPointStyle",this,u)),o.push(os(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0}
vendor: 18,647 bytes, line 23
23);else{const a=Cp[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=SR(this,i),c=Object.assign({},a,l),u=TR(this.chart,i,c),d=xR(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Zd(a),{x:h,y:f}=t,{width:p,height:v}=e;let E,x,A,O,I,T;return r==="center"?(I=f+v/2,s==="left"?(E=h,x=E-o,O=I+o,T=I-o):(E=h+p,x=E+o,O=I-o,T=I+o),A=E):(s==="left"?x=h+Math.max(l,u)+o:s==="right"?x=h+p-Math.max(c,d)-o:x=this.caretX,r==="top"?(O=f,I=O-o,E=x-o,A=x+o):(O=f+v,I=O+o,E=x+o,A=x-o),T=O),{x1:E,x2:x,x3:A,y1:O,y2:I,y3:T}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=wf(i.rtl,this.x,this.width);for(t.x=u_(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=Xn(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Xn(r.bodyFont),d=u_(this,"left",r),h=s.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+f;if(r.usePointStyle){const v={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},E=s.leftForLtr(h,c)+c/2,x=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,JA(t,v,E,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,JA(t,v,E,x)}else{t.lineWidth=St(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const v=s.leftForLtr(h,c),E=s.leftForLtr(s.xPlus(h,1),c-2),x=Zd(o.borderRadius);Object.values(x).some(A=>A!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Sb(t,{x:v,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Sb(t,{x:E,y:p+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(v,p,c,l),t.strokeRect(v,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(E,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=Xn(i.bodyFont);let h=d.lineHeight,f=0;const p=wf(i.rtl,this.x,this.width),v=function(D){e.fillText(D,p.x(t.x+f),t.y+h/2),t.y+=h+r},E=p.textAlign(o);let x,A,O,I,T,P,k;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=u_(this,E,i),e.fillStyle=i.bodyColor,$t(this.beforeBody,v),f=a&&E!=="right"?o==="center"?c/2+u:c+2+u:0,I=0,P=s.length;I<P;++I){for(x=s[I],A=this.labelTextColors[I],e.fillStyle=A,$t(x.before,v),O=x.lines,a&&O.length&&(this._drawColorBox(e,t,I,p,i),h=Math.max(d.lineHeight,l)),T=0,k=O.length;T<k;++T)v(O[T]),h=d.lineHeight;$t(x.after,v)}f=0,h=d.lineHeight,$t(this.afterBody,v),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=wf(i.rtl,this.x,this.width);for(t.x=u_(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=Xn(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=Zd(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,l+u),e.quadraticCurveTo(a,l+u,a,l+u-f),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Cp[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=SR(this,t),l=Object.assign({},o,this._size),c=TR(e,t,l),u=xR(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Hi(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),vB(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),yB(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Q0(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Q0(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=Cp[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}y(sC,"positioners",Cp);var vq={id:"tooltip",_element:sC,positioners:Cp,afterInit(n,t,e){e&&(n.tooltip=new sC({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:GB},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},yq=Object.freeze({__proto__:null,Colors:OY,Decimation:FY,Filler:nq,Legend:lq,SubTitle:dq,Title:uq,Tooltip:vq});const _q=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Eq(n,t,e,i){const s=n.indexOf(t);if(s===-1)return _q(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Sq=(n,t)=>n===null?null:ui(Math.round(n),0,t);function kR(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class rC extends wh{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Ot(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Eq(i,t,lt(e,t),this._addedLabels),Sq(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return kR.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}y(rC,"id","category"),y(rC,"defaults",{ticks:{callback:kR}});function Tq(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,f=r||1,p=u-1,{min:v,max:E}=t,x=!Ot(o),A=!Ot(a),O=!Ot(c),I=(E-v)/(d+1);let T=SD((E-v)/p/f)*f,P,k,D,U;if(T<1e-14&&!x&&!A)return[{value:v},{value:E}];U=Math.ceil(E/T)-Math.floor(v/T),U>p&&(T=SD(U*T/p/f)*f),Ot(l)||(P=Math.pow(10,l),T=Math.ceil(T*P)/P),s==="ticks"?(k=Math.floor(v/T)*T,D=Math.ceil(E/T)*T):(k=v,D=E),x&&A&&r&&w8((a-o)/r,T/1e3)?(U=Math.round(Math.min((a-o)/T,u)),T=(a-o)/U,k=o,D=a):O?(k=x?o:k,D=A?a:D,U=c-1,T=(D-k)/U):(U=(D-k)/T,Jp(U,Math.round(U),T/1e3)?U=Math.round(U):U=Math.ceil(U));const Y=Math.max(TD(T),TD(k));P=Math.pow(10,Ot(l)?Y:l),k=Math.round(k*P)/P,D=Math.round(D*P)/P;let K=0;for(x&&(h&&k!==o?(e.push({value:o}),k<o&&K++,Jp(Math.round((k+K*T)*P)/P,o,IR(o,I,n))&&K++):k<o&&K++);K<U;++K){const j=Math.round((k+K*T)*P)/P;if(A&&j>a)break;e.push({value:j})}return A&&h&&D!==a?e.length&&Jp(e[e.length-1].value,a,IR(a,I,n))?e[e.length-1].value=a:e.push({value:a}):(!A||D===a)&&e.push({value:D}),e}function IR(n,t,{horizontal:e,minRotation:i}){const s=Zr(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class oE extends wh{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Ot(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=Ko(s),c=Ko(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Tq(s,r);return t.bounds==="ticks"&&nB(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return gy(t,this.chart.options.locale,this.options.ticks.format)}}class oC extends oE{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Tn(t)?t:0,this.max=Tn(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Zr(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}y(oC,"id","linear"),y(oC,"defaults",{ticks:{callback:tT.formatters.numeric}});const xb=n=>Math.floor(yc(n)),uu=(n,t)=>Math.pow(10,xb(n)+t);function PR(n){return n/Math.pow(10,xb(n))===1}function MR(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function xq(n,t){const e=t-n;let i=xb(e);for(;MR(n,t,i)>10;)i++;for(;MR(n,t,i)<10;)i--;return Math.min(i,xb(n))}function Aq(n,{min:t,max:e}){t=As(n.min,t);const i=[],s=xb(t);let r=xq(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=As(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:PR(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const f=As(n.max,h);return i.push({value:f,major:PR(f),significand:d}),i}class aC extends wh{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=oE.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Tn(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Tn(t)?Math.max(0,t):null,this.max=Tn(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Tn(this._userMin)&&(this.min=t===uu(this.min,0)?uu(this.min,-1):uu(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(uu(i,-1)),o(uu(s,1)))),i<=0&&r(uu(s,-1)),s<=0&&o(uu(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Aq(e,this);return t.bounds==="ticks"&&nB(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":gy(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=yc(t),this._valueRange=yc(this.max)-yc(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yc(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}y(aC,"id","logarithmic"),y(aC,"defaults",{ticks:{callback:tT.formatters.logarithmic,major:{enabled:!0}}});function lC(n){const t=n.ticks;if(t.display&&n.display){const e=Hi(t.backdropPadding);return lt(t.font&&t.font.size,pn.font.size)+e.height}return 0}function Cq(n,t,e){return e=rn(e)?e:[e],{w:L8(n,t.string,e),h:e.length*t.lineHeight}}function OR(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function kq(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?an/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=Xn(c.font),h=Cq(n.ctx,d,n._pointLabels[l]);i[l]=h;const f=zs(n.getIndexAngle(l)+a),p=Math.round(ZI(f)),v=OR(p,u.x,h.w,0,180),E=OR(p,u.y,h.h,90,270);Iq(e,t,f,v,E)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Oq(n,i,s)}function Iq(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function Pq(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(ZI(zs(l.angle+Dn))),u=Lq(l.y,a.h,c),d=Dq(c),h=Rq(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function Mq(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(nl({x:e,y:i},t)||nl({x:e,y:r},t)||nl({x:s,y:i},t)||nl({x:s,y:r},t))}function Oq(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:lC(r)/2,additionalAngle:o?an/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=Pq(n,u,l);i.push(d),a==="auto"&&(d.visible=Mq(d,c),d.visible&&(c=d))}return i}function Dq(n){return n===0||n===180?"center":n<180?"left":"right"}function Rq(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Lq(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Fq(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!Ot(a)){const l=Zd(t.borderRadius),c=Hi(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,f=o-s+c.height;
vendor: 4,440 bytes, line 23
23Object.values(l).some(p=>p!==0)?(n.beginPath(),Sb(n,{x:u,y:d,w:h,h:f,radius:l}),n.fill()):n.fillRect(u,d,h,f)}}function Nq(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));Fq(e,o,r);const a=Xn(o.font),{x:l,y:c,textAlign:u}=r;uh(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function YB(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,on);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function Bq(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),YB(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function Vq(n,t,e){return qc(n,{label:e,index:t,type:"pointLabel"})}class kp extends oE{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Hi(lC(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Tn(t)&&!isNaN(t)?t:0,this.max=Tn(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/lC(this.options))}generateTickLabels(t){oE.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Qt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?kq(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=on/(this._pointLabels.length||1),i=this.options.startAngle||0;return zs(t*e+Zr(i))}getDistanceFromCenterForValue(t){if(Ot(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Ot(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Vq(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Dn+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),YB(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&Nq(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=s.setContext(h),p=r.setContext(h);Bq(this,f,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Xn(c.font);
vendor: 5,170 bytes, line 23
23if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Hi(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}uh(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}y(kp,"id","radialLinear"),y(kp,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:tT.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),y(kp,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),y(kp,"descriptors",{angleLines:{_fallback:"grid"}});const rT={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},bs=Object.keys(rT);function DR(n,t){return n-t}function RR(n,t){if(Ot(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Tn(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(am(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function LR(n,t,e,i){const s=bs.length;for(let r=bs.indexOf(n);r<s-1;++r){const o=rT[bs[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return bs[r]}return bs[s-1]}function Hq(n,t,e,i,s){for(let r=bs.length-1;r>=bs.indexOf(e);r--){const o=bs[r];if(rT[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return bs[e?bs.indexOf(e):0]}function zq(n){for(let t=bs.indexOf(n)+1,e=bs.length;t<e;++t)if(rT[bs[t]].common)return bs[t]}function FR(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=QI(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function $q(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function NR(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:$q(n,i,s,e)}class Ab extends wh{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new CB._date(t.adapters.date);s.init(e),Xp(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:RR(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Tn(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Tn(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=E8(s,r,o);return this._unit=e.unit||(i.autoSkip?LR(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Hq(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:zq(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),NR(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=ui(e,0,o),i=ui(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||LR(r.minUnit,e,i,this._getLabelCapacity(e)),a=lt(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=am(l)||l===!0,u={};let d=e,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<i;h=+t.add(h,a,o),f++)FR(u,h,p);
vendor: 1,361 bytes, line 23
23return(h===i||s.bounds==="ticks"||f===1)&&FR(u,h,p),Object.keys(u).sort(DR).map(v=>+v)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return Qt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[e],f=c&&d&&h&&h.major;return this._adapter.format(t,s||(f?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Zr(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tick
23FormatFunction(t,0,NR(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(RR(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rB(t.sort(DR))}}y(Ab,"id","time"),y(Ab,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function d_(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tl(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tl(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class cC extends Ab{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=d_(e,this.min),this._tableRange=d_(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(d_(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return d_(this._table,i*this._tableRange+this._minPos,!0)}}y(cC,"id","timeseries"),y(cC,"defaults",Ab.defaults);var Wq=Object.freeze({__proto__:null,CategoryScale:rC,LinearScale:oC,LogarithmicScale:aC,RadialLinearScale:kp,TimeScale:Ab,TimeSeriesScale:cC});const Uq=[XG,xY,yq,Wq];Ea.register(...Uq);//! moment.js 24//! version : 2.30.1 25//! authors : Tim Wood, Iskren Chernev, Moment.js contributors 26//! license : MIT 27//! momentjs.com 28var qB;function ke(){return qB.apply(null,arguments)}function jq(n){qB=n}function oo(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function eh(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function Lt(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function dP(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var t;for(t in n)if(Lt(n,t))return!1;return!0}function us(n){return n===void 0}function fl(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function py(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function KB(n,t){var e=[],i,s=n.length;for(i=0;i<s;++i)e.push(t(n[i],i));return e}function Sc(n,t){for(var e in t)Lt(t,e)&&(n[e]=t[e]);return Lt(t,"toString")&&(n.toString=t.toString),Lt(t,"valueOf")&&(n.valueOf=t.valueOf),n}function ta(n,t,e,i){return wV(n,t,e,i,!0).utc()}function Gq(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function dt(n){return n._pf==null&&(n._pf=Gq()),n._pf}var uC;
vendor: 24,100 bytes, lines 28-31
28Array.prototype.some?uC=Array.prototype.some:uC=function(n){var t=Object(this),e=t.length>>>0,i;for(i=0;i<e;i++)if(i in t&&n.call(this,t[i],i,t))return!0;return!1};function hP(n){var t=null,e=!1,i=n._d&&!isNaN(n._d.getTime());if(i&&(t=dt(n),e=uC.call(t.parsedDateParts,function(s){return s!=null}),i=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&e),n._strict&&(i=i&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=i;else return i;return n._isValid}function oT(n){var t=ta(NaN);return n!=null?Sc(dt(t),n):dt(t).userInvalidated=!0,t}var BR=ke.momentProperties=[],Hx=!1;function fP(n,t){var e,i,s,r=BR.length;if(us(t._isAMomentObject)||(n._isAMomentObject=t._isAMomentObject),us(t._i)||(n._i=t._i),us(t._f)||(n._f=t._f),us(t._l)||(n._l=t._l),us(t._strict)||(n._strict=t._strict),us(t._tzm)||(n._tzm=t._tzm),us(t._isUTC)||(n._isUTC=t._isUTC),us(t._offset)||(n._offset=t._offset),us(t._pf)||(n._pf=dt(t)),us(t._locale)||(n._locale=t._locale),r>0)for(e=0;e<r;e++)i=BR[e],s=t[i],us(s)||(n[i]=s);return n}function by(n){fP(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Hx===!1&&(Hx=!0,ke.updateOffset(this),Hx=!1)}function ao(n){return n instanceof by||n!=null&&n._isAMomentObject!=null}function XB(n){ke.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function Tr(n,t){var e=!0;return Sc(function(){if(ke.deprecationHandler!=null&&ke.deprecationHandler(null,n),e){var i=[],s,r,o,a=arguments.length;for(r=0;r<a;r++){if(s="",typeof arguments[r]=="object"){s+=` 29[`+r+"] ";for(o in arguments[0])Lt(arguments[0],o)&&(s+=o+": "+arguments[0][o]+", ");s=s.slice(0,-2)}else s=arguments[r];i.push(s)}XB(n+` 30Arguments: `+Array.prototype.slice.call(i).join("")+` 31`+new Error().stack),e=!1}return t.apply(this,arguments)},t)}var VR={};function JB(n,t){ke.deprecationHandler!=null&&ke.deprecationHandler(n,t),VR[n]||(XB(t),VR[n]=!0)}ke.suppressDeprecationWarnings=!1;ke.deprecationHandler=null;function na(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function Yq(n){var t,e;for(e in n)Lt(n,e)&&(t=n[e],na(t)?this[e]=t:this["_"+e]=t);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function dC(n,t){var e=Sc({},n),i;for(i in t)Lt(t,i)&&(eh(n[i])&&eh(t[i])?(e[i]={},Sc(e[i],n[i]),Sc(e[i],t[i])):t[i]!=null?e[i]=t[i]:delete e[i]);for(i in n)Lt(n,i)&&!Lt(t,i)&&eh(n[i])&&(e[i]=Sc({},e[i]));return e}function gP(n){n!=null&&this.set(n)}var hC;Object.keys?hC=Object.keys:hC=function(n){var t,e=[];for(t in n)Lt(n,t)&&e.push(t);return e};var qq={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Kq(n,t,e){var i=this._calendar[n]||this._calendar.sameElse;return na(i)?i.call(t,e):i}function Jo(n,t,e){var i=""+Math.abs(n),s=t-i.length,r=n>=0;return(r?e?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+i}var mP=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,h_=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,zx={},vf={};function Ke(n,t,e,i){var s=i;typeof i=="string"&&(s=function(){return this[i]()}),n&&(vf[n]=s),t&&(vf[t[0]]=function(){return Jo(s.apply(this,arguments),t[1],t[2])}),e&&(vf[e]=function(){return this.localeData().ordinal(s.apply(this,arguments),n)})}function Xq(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function Jq(n){var t=n.match(mP),e,i;for(e=0,i=t.length;e<i;e++)vf[t[e]]?t[e]=vf[t[e]]:t[e]=Xq(t[e]);return function(s){var r="",o;for(o=0;o<i;o++)r+=na(t[o])?t[o].call(s,n):t[o];return r}}function s0(n,t){return n.isValid()?(t=ZB(t,n.localeData()),zx[t]=zx[t]||Jq(t),zx[t](n)):n.localeData().invalidDate()}function ZB(n,t){var e=5;function i(s){return t.longDateFormat(s)||s}for(h_.lastIndex=0;e>=0&&h_.test(n);)n=n.replace(h_,i),h_.lastIndex=0,e-=1;return n}var Zq={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Qq(n){var t=this._longDateFormat[n],e=this._longDateFormat[n.toUpperCase()];return t||!e?t:(this._longDateFormat[n]=e.match(mP).map(function(i){return i==="MMMM"||i==="MM"||i==="DD"||i==="dddd"?i.slice(1):i}).join(""),this._longDateFormat[n])}var eK="Invalid date";function tK(){return this._invalidDate}var nK="%d",iK=/\d{1,2}/;function sK(n){return this._ordinal.replace("%d",n)}var rK={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function oK(n,t,e,i){var s=this._relativeTime[e];return na(s)?s(n,t,e,i):s.replace(/%d/i,n)}function aK(n,t){var e=this._relativeTime[n>0?"future":"past"];return na(e)?e(t):e.replace(/%s/i,t)}var HR={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function xr(n){return typeof n=="string"?HR[n]||HR[n.toLowerCase()]:void 0}function pP(n){var t={},e,i;for(i in n)Lt(n,i)&&(e=xr(i),e&&(t[e]=n[i]));return t}var lK={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function cK(n){var t=[],e;for(e in n)Lt(n,e)&&t.push({unit:e,priority:lK[e]});return t.sort(function(i,s){return i.priority-s.priority}),t}var QB=/\d/,Xs=/\d\d/,eV=/\d{3}/,bP=/\d{4}/,aT=/[+-]?\d{6}/,cn=/\d\d?/,tV=/\d\d\d\d?/,nV=/\d\d\d\d\d\d?/,lT=/\d{1,3}/,wP=/\d{1,4}/,cT=/[+-]?\d{1,6}/,Am=/\d+/,uT=/[+-]?\d+/,uK=/Z|[+-]\d\d:?\d\d/gi,dT=/Z|[+-]\d\d(?::?\d\d)?/gi,dK=/[+-]?\d+(\.\d{1,3})?/,wy=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Cm=/^[1-9]\d?/,vP=/^([1-9]\d|\d)/,aE;aE={};function Fe(n,t,e){aE[n]=na(t)?t:function(i,s){return i&&e?e:t}}function hK(n,t){return Lt(aE,n)?aE[n](t._strict,t._locale):new RegExp(fK(n))}function fK(n){return ol(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,s,r){return e||i||s||r}))}function ol(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function vr(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function Tt(n){var t=+n,e=0;return t!==0&&isFinite(t)&&(e=vr(t)),e}var fC={};function Yt(n,t){var e,i=t,s;for(typeof n=="string"&&(n=[n]),fl(t)&&(i=function(r,o){o[t]=Tt(r)}),s=n.length,e=0;e<s;e++)fC[n[e]]=i}function vy(n,t){Yt(n,function(e,i,s,r){s._w=s._w||{},t(e,s._w,s,r)})}function gK(n,t,e){t!=null&&Lt(fC,n)&&fC[n](t,e._a,e,n)}function hT(n){return n%4===0&&n%100!==0||n%400===0}var Vi=0,il=1,Go=2,Jn=3,Qr=4,sl=5,Iu=6,mK=7,pK=8;Ke("Y",0,0,function(){var n=this.year();return n<=9999?Jo(n,4):"+"+n});Ke(0,["YY",2],0,function(){return this.year()%100});Ke(0,["YYYY",4],0,"year");Ke(0,["YYYYY",5],0,"year");Ke(0,["YYYYYY",6,!0],0,"year");Fe("Y",uT);Fe("YY",cn,Xs);Fe("YYYY",wP,bP);Fe("YYYYY",cT,aT);Fe("YYYYYY",cT,aT);Yt(["YYYYY","YYYYYY"],Vi);Yt("YYYY",function(n,t){t[Vi]=n.length===2?ke.parseTwoDigitYear(n):Tt(n)});Yt("YY",function(n,t){t[Vi]=ke.parseTwoDigitYear(n)});Yt("Y",function(n,t){t[Vi]=parseInt(n,10)});function tb(n){return hT(n)?366:365}ke.parseTwoDigitYear=function(n){return Tt(n)+(Tt(n)>68?1900:2e3)};var iV=km("FullYear",!0);function bK(){return hT(this.year())}function km(n,t){return function(e){return e!=null?(sV(this,n,e),ke.updateOffset(this,t),this):Cb(this,n)}}function Cb(n,t){if(!n.isValid())return NaN;var e=n._d,i=n._isUTC;switch(t){case"Milliseconds":return i?e.getUTCMilliseconds():e.getMilliseconds();case"Seconds":return i?e.getUTCSeconds():e.getSeconds();case"Minutes":return i?e.getUTCMinutes():e.getMinutes();case"Hours":return i?e.getUTCHours():e.getHours();case"Date":return i?e.getUTCDate():e.getDate();case"Day":return i?e.getUTCDay():e.getDay();case"Month":return i?e.getUTCMonth():e.getMonth();case"FullYear":return i?e.getUTCFullYear():e.getFullYear();default:return NaN}}function sV(n,t,e){var i,s,r,o,a;if(!(!n.isValid()||isNaN(e))){switch(i=n._d,s=n._isUTC,t){case"Milliseconds":return void(s?i.setUTCMilliseconds(e):i.setMilliseconds(e));case"Seconds":return void(s?i.setUTCSeconds(e):i.setSeconds(e));case"Minutes":return void(s?i.setUTCMinutes(e):i.setMinutes(e));case"Hours":return void(s?i.setUTCHours(e):i.setHours(e));case"Date":return void(s?i.setUTCDate(e):i.setDate(e));case"FullYear":break;default:return}r=e,o=n.month(),a=n.date(),a=a===29&&o===1&&!hT(r)?28:a,s?i.setUTCFullYear(r,o,a):i.setFullYear(r,o,a)}}function wK(n){return n=xr(n),na(this[n])?this[n]():this}function vK(n,t){if(typeof n=="object"){n=pP(n);var e=cK(n),i,s=e.length;for(i=0;i<s;i++)this[e[i].unit](n[e[i].unit])}else if(n=xr(n),na(this[n]))return this[n](t);return this}function yK(n,t){return(n%t+t)%t}var In;Array.prototype.indexOf?In=Array.prototype.indexOf:In=function(n){var t;for(t=0;t<this.length;++t)if(this[t]===n)return t;return-1};function yP(n,t){if(isNaN(n)||isNaN(t))return NaN;var e=yK(t,12);return n+=(t-e)/12,e===1?hT(n)?29:28:31-e%7%2}Ke("M",["MM",2],"Mo",function(){return this.month()+1});Ke("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)});Ke("MMMM",0,0,function(n){return this.localeData().months(this,n)});Fe("M",cn,Cm);Fe("MM",cn,Xs);Fe("MMM",function(n,t){return t.monthsShortRegex(n)});Fe("MMMM",function(n,t){return t.monthsRegex(n)});Yt(["M","MM"],function(n,t){t[il]=Tt(n)-1});Yt(["MMM","MMMM"],function(n,t,e,i){var s=e._locale.monthsParse(n,i,e._strict);s!=null?t[il]=s:dt(e).invalidMonth=n});var _K="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),rV="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),oV=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,EK=wy,SK=wy;function TK(n,t){return n?oo(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||oV).test(t)?"format":"standalone"][n.month()]:oo(this._months)?this._months:this._months.standalone}function xK(n,t){return n?oo(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[oV.test(t)?"format":"standalone"][n.month()]:oo(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function AK(n,t,e){var i,s,r,o=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=ta([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return e?t==="MMM"?(s=In.call(this._shortMonthsParse,o),s!==-1?s:null):(s=In.call(this._longMonthsParse,o),s!==-1?s:null):t==="MMM"?(s=In.call(this._shortMonthsParse,o),s!==-1?s:(s=In.call(this._longMonthsParse,o),s!==-1?s:null)):(s=In.call(this._longMonthsParse,o),s!==-1?s:(s=In.call(this._shortMonthsParse,o),s!==-1?s:null))}function CK(n,t,e){var i,s,r;if(this._monthsParseExact)return AK.call(this,n,t,e);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(s=ta([2e3,i]),e&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!e&&!this._monthsParse[i]&&(r="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),e&&t==="MMMM"&&this._longMonthsParse[i].test(n))return i;if(e&&t==="MMM"&&this._shortMonthsParse[i].test(n))return i;if(!e&&this._monthsParse[i].test(n))return i}}function aV(n,t){if(!n.isValid())return n;if(typeof t=="string"){if(/^\d+$/.test(t))t=Tt(t);else if(t=n.localeData().monthsParse(t),!fl(t))return n}var e=t,i=n.date();return i=i<29?i:Math.min(i,yP(n.year(),e)),n._isUTC?n._d.setUTCMonth(e,i):n._d.setMonth(e,i),n}function lV(n){return n!=null?(aV(this,n),ke.updateOffset(this,!0),this):Cb(this,"Month")}function kK(){return yP(this.year(),this.month())}function IK(n){return this._monthsParseExact?(Lt(this,"_monthsRegex")||cV.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(Lt(this,"_monthsShortRegex")||(this._monthsShortRegex=EK),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function PK(n){return this._monthsParseExact?(Lt(this,"_monthsRegex")||cV.call(this),n?this._monthsStrictRegex:this._monthsRegex):(Lt(this,"_monthsRegex")||(this._monthsRegex=SK),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function cV(){function n(l,c){return c.length-l.length}var t=[],e=[],i=[],s,r,o,a;for(s=0;s<12;s++)r=ta([2e3,s]),o=ol(this.monthsShort(r,"")),a=ol(this.months(r,"")),t.push(o),e.push(a),i.push(a),i.push(o);t.sort(n),e.sort(n),i.sort(n),this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function MK(n,t,e,i,s,r,o){var a;return n<100&&n>=0?(a=new Date(n+400,t,e,i,s,r,o),isFinite(a.getFullYear())&&a.setFullYear(n)):a=new Date(n,t,e,i,s,r,o),a}function kb(n){var t,e;return n<100&&n>=0?(e=Array.prototype.slice.call(arguments),e[0]=n+400,t=new Date(Date.UTC.apply(null,e)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(n)):t=new Date(Date.UTC.apply(null,arguments)),t}function lE(n,t,e){var i=7+t-e,s=(7+kb(n,0,i).getUTCDay()-t)%7;return-s+i-1}function uV(n,t,e,i,s){var r=(7+e-i)%7,o=lE(n,i,s),a=1+7*(t-1)+r+o,l,c;return a<=0?(l=n-1,c=tb(l)+a):a>tb(n)?(l=n+1,c=a-tb(n)):(l=n,c=a),{year:l,dayOfYear:c}}function Ib(n,t,e){var i=lE(n.year(),t,e),s=Math.floor((n.dayOfYear()-i-1)/7)+1,r,o;return s<1?(o=n.year()-1,r=s+al(o,t,e)):s>al(n.year(),t,e)?(r=s-al(n.year(),t,e),o=n.year()+1):(o=n.year(),r=s),{week:r,year:o}}function al(n,t,e){var i=lE(n,t,e),s=lE(n+1,t,e);return(tb(n)-i+s)/7}Ke("w",["ww",2],"wo","week");Ke("W",["WW",2],"Wo","isoWeek");Fe("w",cn,Cm);Fe("ww",cn,Xs);Fe("W",cn,Cm);Fe("WW",cn,Xs);vy(["w","ww","W","WW"],function(n,t,e,i){t[i.substr(0,1)]=Tt(n)});function OK(n){return Ib(n,this._week.dow,this._week.doy).week}var DK={dow:0,doy:6};function RK(){return this._week.dow}function LK(){return this._week.doy}function FK(n){var t=this.localeData().week(this);return n==null?t:this.add((n-t)*7,"d")}function NK(n){var t=Ib(this,1,4).week;return n==null?t:this.add((n-t)*7,"d")}Ke("d",0,"do","day");Ke("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)});Ke("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)});Ke("dddd",0,0,function(n){return this.localeData().weekdays(this,n)});Ke("e",0,0,"weekday");Ke("E",0,0,"isoWeekday");Fe("d",cn);Fe("e",cn);Fe("E",cn);Fe("dd",function(n,t){return t.weekdaysMinRegex(n)});Fe("ddd",function(n,t){return t.weekdaysShortRegex(n)});Fe("dddd",function(n,t){return t.weekdaysRegex(n)});vy(["dd","ddd","dddd"],function(n,t,e,i){var s=e._locale.weekdaysParse(n,i,e._strict);s!=null?t.d=s:dt(e).invalidWeekday=n});vy(["d","e","E"],function(n,t,e,i){t[i]=Tt(n)});function BK(n,t){return typeof n!="string"?n:isNaN(n)?(n=t.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function VK(n,t){return typeof n=="string"?t.weekdaysParse(n)%7||7:isNaN(n)?null:n}function _P(n,t){return n.slice(t,7).concat(n.slice(0,t))}var HK="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),dV="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),zK="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),$K=wy,WK=wy,UK=wy;function jK(n,t){var e=oo(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return n===!0?_P(e,this._week.dow):n?e[n.day()]:e}function GK(n){return n===!0?_P(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function YK(n){return n===!0?_P(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function qK(n,t,e){var i,s,r,o=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=ta([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return e?t==="dddd"?(s=In.call(this._weekdaysParse,o),s!==-1?s:null):t==="ddd"?(s=In.call(this._shortWeekdaysParse,o),s!==-1?s:null):(s=In.call(this._minWeekdaysParse,o),s!==-1?s:null):t==="dddd"?(s=In.call(this._weekdaysParse,o),s!==-1||(s=In.call(this._shortWeekdaysParse,o),s!==-1)?s:(s=In.call(this._minWeekdaysParse,o),s!==-1?s:null)):t==="ddd"?(s=In.call(this._shortWeekdaysParse,o),s!==-1||(s=In.call(this._weekdaysParse,o),s!==-1)?s:(s=In.call(this._minWeekdaysParse,o),s!==-1?s:null)):(s=In.call(this._minWeekdaysParse,o),s!==-1||(s=In.call(this._weekdaysParse,o),s!==-1)?s:(s=In.call(this._shortWeekdaysParse,o),s!==-1?s:null))}function KK(n,t,e){var i,s,r;if(this._weekdaysParseExact)return qK.call(this,n,t,e);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(s=ta([2e3,1]).day(i),e&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),e&&t==="dddd"&&this._fullWeekdaysParse[i].test(n))return i;if(e&&t==="ddd"&&this._shortWeekdaysParse[i].test(n))return i;if(e&&t==="dd"&&this._minWeekdaysParse[i].test(n))return i;if(!e&&this._weekdaysParse[i].test(n))return i}}function XK(n){if(!this.isValid())return n!=null?this:NaN;var t=Cb(this,"Day");return n!=null?(n=BK(n,this.localeData()),this.add(n-t,"d")):t}function JK(n){if(!this.isValid())return n!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return n==null?t:this.add(n-t,"d")}function ZK(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var t=VK(n,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function QK(n){return this._weekdaysParseExact?(Lt(this,"_weekdaysRegex")||EP.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(Lt(this,"_weekdaysRegex")||(this._weekdaysRegex=$K),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function eX(n){return this._weekdaysParseExact?(Lt(this,"_weekdaysRegex")||EP.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Lt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=WK),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function tX(n){return this._weekdaysParseExact?(Lt(this,"_weekdaysRegex")||EP.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Lt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=UK),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function EP(){function n(u,d){return d.length-u.length}var t=[],e=[],i=[],s=[],r,o,a,l,c;for(r=0;r<7;r++)o=ta([2e3,1]).day(r),a=ol(this.weekdaysMin(o,"")),l=ol(this.weekdaysShort(o,"")),c=ol(this.weekdays(o,"")),t.push(a),e.push(l),i.push(c),s.push(a),s.push(l),s.push(c);t.sort(n),e.sort(n),i.sort(n),s.sort(n),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function SP(){return this.hours()%12||12}function nX(){return this.hours()||24}Ke("H",["HH",2],0,"hour");Ke("h",["hh",2],0,SP);Ke("k",["kk",2],0,nX);Ke("hmm",0,0,function(){return""+SP.apply(this)+Jo(this.minutes(),2)});Ke("hmmss",0,0,function(){return""+SP.apply(this)+Jo(this.minutes(),2)+Jo(this.seconds(),2)});Ke("Hmm",0,0,function(){return""+this.hours()+Jo(this.minutes(),2)});Ke("Hmmss",0,0,function(){return""+this.hours()+Jo(this.minutes(),2)+Jo(this.seconds(),2)});function hV(n,t){Ke(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}hV("a",!0);hV("A",!1);function fV(n,t){return t._meridiemParse}Fe("a",fV);Fe("A",fV);Fe("H",cn,vP);Fe("h",cn,Cm);Fe("k",cn,Cm);Fe("HH",cn,Xs);Fe("hh",cn,Xs);Fe("kk",cn,Xs);Fe("hmm",tV);Fe("hmmss",nV);Fe("Hmm",tV);Fe("Hmmss",nV);Yt(["H","HH"],Jn);Yt(["k","kk"],function(n,t,e){var i=Tt(n);t[Jn]=i===24?0:i});Yt(["a","A"],function(n,t,e){e._isPm=e._locale.isPM(n),e._meridiem=n});Yt(["h","hh"],function(n,t,e){t[Jn]=Tt(n),dt(e).bigHour=!0});Yt("hmm",function(n,t,e){var i=n.length-2;t[Jn]=Tt(n.substr(0,i)),t[Qr]=Tt(n.substr(i)),dt(e).bigHour=!0});Yt("hmmss",function(n,t,e){var i=n.length-4,s=n.length-2;t[Jn]=Tt(n.substr(0,i)),t[Qr]=Tt(n.substr(i,2)),t[sl]=Tt(n.substr(s)),dt(e).bigHour=!0});Yt("Hmm",function(n,t,e){var i=n.length-2;t[Jn]=Tt(n.substr(0,i)),t[Qr]=Tt(n.substr(i))});Yt("Hmmss",function(n,t,e){var i=n.length-4,s=n.length-2;t[Jn]=Tt(n.substr(0,i)),t[Qr]=Tt(n.substr(i,2)),t[sl]=Tt(n.substr(s))});function iX(n){return(n+"").toLowerCase().charAt(0)==="p"}var sX=/[ap]\.?m?\.?/i,rX=km("Hours",!0);function oX(n,t,e){return n>11?e?"pm":"PM":e?"am":"AM"}var gV={calendar:qq,longDateFormat:Zq,invalidDate:eK,ordinal:nK,dayOfMonthOrdinalParse:iK,relativeTime:rK,months:_K,monthsShort:rV,week:DK,weekdays:HK,weekdaysMin:zK,weekdaysShort:dV,meridiemParse:sX},fn={},np={},Pb;function aX(n,t){var e,i=Math.min(n.length,t.length);for(e=0;e<i;e+=1)if(n[e]!==t[e])return e;return i}function zR(n){return n&&n.toLowerCase().replace("_","-")}function lX(n){for(var t=0,e,i,s,r;t<n.length;){for(r=zR(n[t]).split("-"),e=r.length,i=zR(n[t+1]),i=i?i.split("-"):null;e>0;){if(s=fT(r.slice(0,e).join("-")),s)return s;if(i&&i.length>=e&&aX(r,i)>=e-1)break;e--}t++}return Pb}function cX(n){return!!(n&&n.match("^[^/\\\\]*$"))}function fT(n){var t=null,e;if(fn[n]===void 0&&typeof module<"u"&&module&&module.exports&&cX(n))try{t=Pb._abbr,e=require,e("./locale/"+n),Pc(t)}catch{fn[n]=null}return fn[n]}function Pc(n,t){var e;return n&&(us(t)?e=yl(n):e=TP(n,t),e?Pb=e:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),Pb._abbr}function TP(n,t){if(t!==null){var e,i=gV;if(t.abbr=n,fn[n]!=null)JB("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=fn[n]._config;else if(t.parentLocale!=null)if(fn[t.parentLocale]!=null)i=fn[t.parentLocale]._config;else if(e=fT(t.parentLocale),e!=null)i=e._config;else return np[t.parentLocale]||(np[t.parentLocale]=[]),np[t.parentLocale].push({name:n,config:t}),null;
vendor: 4,259 bytes, line 31
31return fn[n]=new gP(dC(i,t)),np[n]&&np[n].forEach(function(s){TP(s.name,s.config)}),Pc(n),fn[n]}else return delete fn[n],null}function uX(n,t){if(t!=null){var e,i,s=gV;fn[n]!=null&&fn[n].parentLocale!=null?fn[n].set(dC(fn[n]._config,t)):(i=fT(n),i!=null&&(s=i._config),t=dC(s,t),i==null&&(t.abbr=n),e=new gP(t),e.parentLocale=fn[n],fn[n]=e),Pc(n)}else fn[n]!=null&&(fn[n].parentLocale!=null?(fn[n]=fn[n].parentLocale,n===Pc()&&Pc(n)):fn[n]!=null&&delete fn[n]);return fn[n]}function yl(n){var t;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return Pb;if(!oo(n)){if(t=fT(n),t)return t;n=[n]}return lX(n)}function dX(){return hC(fn)}function xP(n){var t,e=n._a;return e&&dt(n).overflow===-2&&(t=e[il]<0||e[il]>11?il:e[Go]<1||e[Go]>yP(e[Vi],e[il])?Go:e[Jn]<0||e[Jn]>24||e[Jn]===24&&(e[Qr]!==0||e[sl]!==0||e[Iu]!==0)?Jn:e[Qr]<0||e[Qr]>59?Qr:e[sl]<0||e[sl]>59?sl:e[Iu]<0||e[Iu]>999?Iu:-1,dt(n)._overflowDayOfYear&&(t<Vi||t>Go)&&(t=Go),dt(n)._overflowWeeks&&t===-1&&(t=mK),dt(n)._overflowWeekday&&t===-1&&(t=pK),dt(n).overflow=t),n}var hX=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fX=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gX=/Z|[+-]\d\d(?::?\d\d)?/,f_=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],$x=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mX=/^\/?Date\((-?\d+)/i,pX=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,bX={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function mV(n){var t,e,i=n._i,s=hX.exec(i)||fX.exec(i),r,o,a,l,c=f_.length,u=$x.length;if(s){for(dt(n).iso=!0,t=0,e=c;t<e;t++)if(f_[t][1].exec(s[1])){o=f_[t][0],r=f_[t][2]!==!1;break}if(o==null){n._isValid=!1;return}if(s[3]){for(t=0,e=u;t<e;t++)if($x[t][1].exec(s[3])){a=(s[2]||" ")+$x[t][0];break}if(a==null){n._isValid=!1;return}}if(!r&&a!=null){n._isValid=!1;return}if(s[4])if(gX.exec(s[4]))l="Z";else{n._isValid=!1;return}n._f=o+(a||"")+(l||""),CP(n)}else n._isValid=!1}function wX(n,t,e,i,s,r){var o=[vX(n),rV.indexOf(t),parseInt(e,10),parseInt(i,10),parseInt(s,10)];return r&&o.push(parseInt(r,10)),o}function vX(n){var t=parseInt(n,10);return t<=49?2e3+t:t<=999?1900+t:t}function yX(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function _X(n,t,e){if(n){var i=dV.indexOf(n),s=new Date(t[0],t[1],t[2]).getDay();if(i!==s)return dt(e).weekdayMismatch=!0,e._isValid=!1,!1}return!0}function EX(n,t,e){if(n)return bX[n];if(t)return 0;var i=parseInt(e,10),s=i%100,r=(i-s)/100;return r*60+s}function pV(n){var t=pX.exec(yX(n._i)),e;if(t){if(e=wX(t[4],t[3],t[2],t[5],t[6],t[7]),!_X(t[1],e,n))return;n._a=e,n._tzm=EX(t[8],t[9],t[10]),n._d=kb.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),dt(n).rfc2822=!0}else n._isValid=!1}function SX(n){var t=mX.exec(n._i);if(t!==null){n._d=new Date(+t[1]);return}if(mV(n),n._isValid===!1)delete n._isValid;else return;if(pV(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:ke.createFromInputFallback(n)}ke.createFromInputFallback=Tr("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function qh(n,t,e){return n??t??e}
vendor: 25,151 bytes, line 31
31function TX(n){var t=new Date(ke.now());return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function AP(n){var t,e,i=[],s,r,o;if(!n._d){for(s=TX(n),n._w&&n._a[Go]==null&&n._a[il]==null&&xX(n),n._dayOfYear!=null&&(o=qh(n._a[Vi],s[Vi]),(n._dayOfYear>tb(o)||n._dayOfYear===0)&&(dt(n)._overflowDayOfYear=!0),e=kb(o,0,n._dayOfYear),n._a[il]=e.getUTCMonth(),n._a[Go]=e.getUTCDate()),t=0;t<3&&n._a[t]==null;++t)n._a[t]=i[t]=s[t];for(;t<7;t++)n._a[t]=i[t]=n._a[t]==null?t===2?1:0:n._a[t];n._a[Jn]===24&&n._a[Qr]===0&&n._a[sl]===0&&n._a[Iu]===0&&(n._nextDay=!0,n._a[Jn]=0),n._d=(n._useUTC?kb:MK).apply(null,i),r=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[Jn]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==r&&(dt(n).weekdayMismatch=!0)}}function xX(n){var t,e,i,s,r,o,a,l,c;t=n._w,t.GG!=null||t.W!=null||t.E!=null?(r=1,o=4,e=qh(t.GG,n._a[Vi],Ib(ln(),1,4).year),i=qh(t.W,1),s=qh(t.E,1),(s<1||s>7)&&(l=!0)):(r=n._locale._week.dow,o=n._locale._week.doy,c=Ib(ln(),r,o),e=qh(t.gg,n._a[Vi],c.year),i=qh(t.w,c.week),t.d!=null?(s=t.d,(s<0||s>6)&&(l=!0)):t.e!=null?(s=t.e+r,(t.e<0||t.e>6)&&(l=!0)):s=r),i<1||i>al(e,r,o)?dt(n)._overflowWeeks=!0:l!=null?dt(n)._overflowWeekday=!0:(a=uV(e,i,s,r,o),n._a[Vi]=a.year,n._dayOfYear=a.dayOfYear)}ke.ISO_8601=function(){};ke.RFC_2822=function(){};function CP(n){if(n._f===ke.ISO_8601){mV(n);return}if(n._f===ke.RFC_2822){pV(n);return}n._a=[],dt(n).empty=!0;var t=""+n._i,e,i,s,r,o,a=t.length,l=0,c,u;for(s=ZB(n._f,n._locale).match(mP)||[],u=s.length,e=0;e<u;e++)r=s[e],i=(t.match(hK(r,n))||[])[0],i&&(o=t.substr(0,t.indexOf(i)),o.length>0&&dt(n).unusedInput.push(o),t=t.slice(t.indexOf(i)+i.length),l+=i.length),vf[r]?(i?dt(n).empty=!1:dt(n).unusedTokens.push(r),gK(r,i,n)):n._strict&&!i&&dt(n).unusedTokens.push(r);dt(n).charsLeftOver=a-l,t.length>0&&dt(n).unusedInput.push(t),n._a[Jn]<=12&&dt(n).bigHour===!0&&n._a[Jn]>0&&(dt(n).bigHour=void 0),dt(n).parsedDateParts=n._a.slice(0),dt(n).meridiem=n._meridiem,n._a[Jn]=AX(n._locale,n._a[Jn],n._meridiem),c=dt(n).era,c!==null&&(n._a[Vi]=n._locale.erasConvertYear(c,n._a[Vi])),AP(n),xP(n)}function AX(n,t,e){var i;return e==null?t:n.meridiemHour!=null?n.meridiemHour(t,e):(n.isPM!=null&&(i=n.isPM(e),i&&t<12&&(t+=12),!i&&t===12&&(t=0)),t)}function CX(n){var t,e,i,s,r,o,a=!1,l=n._f.length;if(l===0){dt(n).invalidFormat=!0,n._d=new Date(NaN);return}for(s=0;s<l;s++)r=0,o=!1,t=fP({},n),n._useUTC!=null&&(t._useUTC=n._useUTC),t._f=n._f[s],CP(t),hP(t)&&(o=!0),r+=dt(t).charsLeftOver,r+=dt(t).unusedTokens.length*10,dt(t).score=r,a?r<i&&(i=r,e=t):(i==null||r<i||o)&&(i=r,e=t,o&&(a=!0));Sc(n,e||t)}function kX(n){if(!n._d){var t=pP(n._i),e=t.day===void 0?t.date:t.day;n._a=KB([t.year,t.month,e,t.hour,t.minute,t.second,t.millisecond],function(i){return i&&parseInt(i,10)}),AP(n)}}function IX(n){var t=new by(xP(bV(n)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function bV(n){var t=n._i,e=n._f;return n._locale=n._locale||yl(n._l),t===null||e===void 0&&t===""?oT({nullInput:!0}):(typeof t=="string"&&(n._i=t=n._locale.preparse(t)),ao(t)?new by(xP(t)):(py(t)?n._d=t:oo(e)?CX(n):e?CP(n):PX(n),hP(n)||(n._d=null),n))}function PX(n){var t=n._i;us(t)?n._d=new Date(ke.now()):py(t)?n._d=new Date(t.valueOf()):typeof t=="string"?SX(n):oo(t)?(n._a=KB(t.slice(0),function(e){return parseInt(e,10)}),AP(n)):eh(t)?kX(n):fl(t)?n._d=new Date(t):ke.createFromInputFallback(n)}function wV(n,t,e,i,s){var r={};return(t===!0||t===!1)&&(i=t,t=void 0),(e===!0||e===!1)&&(i=e,e=void 0),(eh(n)&&dP(n)||oo(n)&&n.length===0)&&(n=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=e,r._i=n,r._f=t,r._strict=i,IX(r)}function ln(n,t,e,i){return wV(n,t,e,i,!1)}var MX=Tr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=ln.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:oT()}),OX=Tr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=ln.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:oT()});function vV(n,t){var e,i;if(t.length===1&&oo(t[0])&&(t=t[0]),!t.length)return ln();for(e=t[0],i=1;i<t.length;++i)(!t[i].isValid()||t[i][n](e))&&(e=t[i]);return e}function DX(){var n=[].slice.call(arguments,0);return vV("isBefore",n)}function RX(){var n=[].slice.call(arguments,0);return vV("isAfter",n)}var LX=function(){return Date.now?Date.now():+new Date},ip=["year","quarter","month","week","day","hour","minute","second","millisecond"];function FX(n){var t,e=!1,i,s=ip.length;for(t in n)if(Lt(n,t)&&!(In.call(ip,t)!==-1&&(n[t]==null||!isNaN(n[t]))))return!1;for(i=0;i<s;++i)if(n[ip[i]]){if(e)return!1;parseFloat(n[ip[i]])!==Tt(n[ip[i]])&&(e=!0)}return!0}function NX(){return this._isValid}function BX(){return mo(NaN)}function gT(n){var t=pP(n),e=t.year||0,i=t.quarter||0,s=t.month||0,r=t.week||t.isoWeek||0,o=t.day||0,a=t.hour||0,l=t.minute||0,c=t.second||0,u=t.millisecond||0;this._isValid=FX(t),this._milliseconds=+u+c*1e3+l*6e4+a*1e3*60*60,this._days=+o+r*7,this._months=+s+i*3+e*12,this._data={},this._locale=yl(),this._bubble()}function r0(n){return n instanceof gT}function gC(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function VX(n,t,e){var i=Math.min(n.length,t.length),s=Math.abs(n.length-t.length),r=0,o;for(o=0;o<i;o++)(e&&n[o]!==t[o]||!e&&Tt(n[o])!==Tt(t[o]))&&r++;return r+s}function yV(n,t){Ke(n,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+Jo(~~(e/60),2)+t+Jo(~~e%60,2)})}yV("Z",":");yV("ZZ","");Fe("Z",dT);Fe("ZZ",dT);Yt(["Z","ZZ"],function(n,t,e){e._useUTC=!0,e._tzm=kP(dT,n)});var HX=/([\+\-]|\d\d)/gi;function kP(n,t){var e=(t||"").match(n),i,s,r;return e===null?null:(i=e[e.length-1]||[],s=(i+"").match(HX)||["-",0,0],r=+(s[1]*60)+Tt(s[2]),r===0?0:s[0]==="+"?r:-r)}function IP(n,t){var e,i;return t._isUTC?(e=t.clone(),i=(ao(n)||py(n)?n.valueOf():ln(n).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+i),ke.updateOffset(e,!1),e):ln(n).local()}function mC(n){return-Math.round(n._d.getTimezoneOffset())}ke.updateOffset=function(){};function zX(n,t,e){var i=this._offset||0,s;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=kP(dT,n),n===null)return this}else Math.abs(n)<16&&!e&&(n=n*60);return!this._isUTC&&t&&(s=mC(this)),this._offset=n,this._isUTC=!0,s!=null&&this.add(s,"m"),i!==n&&(!t||this._changeInProgress?SV(this,mo(n-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ke.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?i:mC(this)}function $X(n,t){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,t),this):-this.utcOffset()}function WX(n){return this.utcOffset(0,n)}function UX(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(mC(this),"m")),this}function jX(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=kP(uK,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function GX(n){return this.isValid()?(n=n?ln(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function YX(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qX(){if(!us(this._isDSTShifted))return this._isDSTShifted;var n={},t;return fP(n,this),n=bV(n),n._a?(t=n._isUTC?ta(n._a):ln(n._a),this._isDSTShifted=this.isValid()&&VX(n._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function KX(){return this.isValid()?!this._isUTC:!1}function XX(){return this.isValid()?this._isUTC:!1}function _V(){return this.isValid()?this._isUTC&&this._offset===0:!1}var JX=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ZX=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function mo(n,t){var e=n,i=null,s,r,o;return r0(n)?e={ms:n._milliseconds,d:n._days,M:n._months}:fl(n)||!isNaN(+n)?(e={},t?e[t]=+n:e.milliseconds=+n):(i=JX.exec(n))?(s=i[1]==="-"?-1:1,e={y:0,d:Tt(i[Go])*s,h:Tt(i[Jn])*s,m:Tt(i[Qr])*s,s:Tt(i[sl])*s,ms:Tt(gC(i[Iu]*1e3))*s}):(i=ZX.exec(n))?(s=i[1]==="-"?-1:1,e={y:du(i[2],s),M:du(i[3],s),w:du(i[4],s),d:du(i[5],s),h:du(i[6],s),m:du(i[7],s),s:du(i[8],s)}):e==null?e={}:typeof e=="object"&&("from"in e||"to"in e)&&(o=QX(ln(e.from),ln(e.to)),e={},e.ms=o.milliseconds,e.M=o.months),r=new gT(e),r0(n)&&Lt(n,"_locale")&&(r._locale=n._locale),r0(n)&&Lt(n,"_isValid")&&(r._isValid=n._isValid),r}mo.fn=gT.prototype;mo.invalid=BX;function du(n,t){var e=n&&parseFloat(n.replace(",","."));return(isNaN(e)?0:e)*t}function $R(n,t){var e={};return e.months=t.month()-n.month()+(t.year()-n.year())*12,n.clone().add(e.months,"M").isAfter(t)&&--e.months,e.milliseconds=+t-+n.clone().add(e.months,"M"),e}function QX(n,t){var e;return n.isValid()&&t.isValid()?(t=IP(t,n),n.isBefore(t)?e=$R(n,t):(e=$R(t,n),e.milliseconds=-e.milliseconds,e.months=-e.months),e):{milliseconds:0,months:0}}function EV(n,t){return function(e,i){var s,r;return i!==null&&!isNaN(+i)&&(JB(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=e,e=i,i=r),s=mo(e,i),SV(this,s,n),this}}function SV(n,t,e,i){var s=t._milliseconds,r=gC(t._days),o=gC(t._months);n.isValid()&&(i=i??!0,o&&aV(n,Cb(n,"Month")+o*e),r&&sV(n,"Date",Cb(n,"Date")+r*e),s&&n._d.setTime(n._d.valueOf()+s*e),i&&ke.updateOffset(n,r||o))}var eJ=EV(1,"add"),tJ=EV(-1,"subtract");function TV(n){return typeof n=="string"||n instanceof String}function nJ(n){return ao(n)||py(n)||TV(n)||fl(n)||sJ(n)||iJ(n)||n===null||n===void 0}function iJ(n){var t=eh(n)&&!dP(n),e=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,r,o=i.length;for(s=0;s<o;s+=1)r=i[s],e=e||Lt(n,r);return t&&e}function sJ(n){var t=oo(n),e=!1;return t&&(e=n.filter(function(i){return!fl(i)&&TV(n)}).length===0),t&&e}function rJ(n){var t=eh(n)&&!dP(n),e=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,r;for(s=0;s<i.length;s+=1)r=i[s],e=e||Lt(n,r);return t&&e}function oJ(n,t){var e=n.diff(t,"days",!0);return e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"}function aJ(n,t){arguments.length===1&&(arguments[0]?nJ(arguments[0])?(n=arguments[0],t=void 0):rJ(arguments[0])&&(t=arguments[0],n=void 0):(n=void 0,t=void 0));var e=n||ln(),i=IP(e,this).startOf("day"),s=ke.calendarFormat(this,i)||"sameElse",r=t&&(na(t[s])?t[s].call(this,e):t[s]);return this.format(r||this.localeData().calendar(s,this,ln(e)))}function lJ(){return new by(this)}function cJ(n,t){var e=ao(n)?n:ln(n);return this.isValid()&&e.isValid()?(t=xr(t)||"millisecond",t==="millisecond"?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf()):!1}function uJ(n,t){var e=ao(n)?n:ln(n);return this.isValid()&&e.isValid()?(t=xr(t)||"millisecond",t==="millisecond"?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf()):!1}function dJ(n,t,e,i){var s=ao(n)?n:ln(n),r=ao(t)?t:ln(t);return this.isValid()&&s.isValid()&&r.isValid()?(i=i||"()",(i[0]==="("?this.isAfter(s,e):!this.isBefore(s,e))&&(i[1]===")"?this.isBefore(r,e):!this.isAfter(r,e))):!1}function hJ(n,t){var e=ao(n)?n:ln(n),i;return this.isValid()&&e.isValid()?(t=xr(t)||"millisecond",t==="millisecond"?this.valueOf()===e.valueOf():(i=e.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())):!1}function fJ(n,t){return this.isSame(n,t)||this.isAfter(n,t)}function gJ(n,t){return this.isSame(n,t)||this.isBefore(n,t)}function mJ(n,t,e){var i,s,r;if(!this.isValid())return NaN;if(i=IP(n,this),!i.isValid())return NaN;switch(s=(i.utcOffset()-this.utcOffset())*6e4,t=xr(t),t){case"year":r=o0(this,i)/12;break;case"month":r=o0(this,i);break;case"quarter":r=o0(this,i)/3;break;case"second":r=(this-i)/1e3;break;case"minute":r=(this-i)/6e4;break;case"hour":r=(this-i)/36e5;break;case"day":r=(this-i-s)/864e5;break;case"week":r=(this-i-s)/6048e5;break;default:r=this-i}return e?r:vr(r)}function o0(n,t){if(n.date()<t.date())return-o0(t,n);var e=(t.year()-n.year())*12+(t.month()-n.month()),i=n.clone().add(e,"months"),s,r;return t-i<0?(s=n.clone().add(e-1,"months"),r=(t-i)/(i-s)):(s=n.clone().add(e+1,"months"),r=(t-i)/(s-i)),-(e+r)||0}ke.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";ke.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function pJ(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function bJ(n){if(!this.isValid())return null;var t=n!==!0,e=t?this.clone().utc():this;return e.year()<0||e.year()>9999?s0(e,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):na(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",s0(e,"Z")):s0(e,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function wJ(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",t="",e,i,s,r;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),e="["+n+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",r=t+'[")]',this.format(e+i+s+r)}function vJ(n){n||(n=this.isUtc()?ke.defaultFormatUtc:ke.defaultFormat);var t=s0(this,n);return this.localeData().postformat(t)}function yJ(n,t){return this.isValid()&&(ao(n)&&n.isValid()||ln(n).isValid())?mo({to:this,from:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _J(n){return this.from(ln(),n)}function EJ(n,t){return this.isValid()&&(ao(n)&&n.isValid()||ln(n).isValid())?mo({from:this,to:n}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function SJ(n){return this.to(ln(),n)}function xV(n){var t;return n===void 0?this._locale._abbr:(t=yl(n),t!=null&&(this._locale=t),this)}var AV=Tr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function CV(){return this._locale}var cE=1e3,yf=60*cE,uE=60*yf,kV=(365*400+97)*24*uE;function _f(n,t){return(n%t+t)%t}function IV(n,t,e){return n<100&&n>=0?new Date(n+400,t,e)-kV:new Date(n,t,e).valueOf()}function PV(n,t,e){return n<100&&n>=0?Date.UTC(n+400,t,e)-kV:Date.UTC(n,t,e)}function TJ(n){var t,e;if(n=xr(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?PV:IV,n){case"year":t=e(this.year(),0,1);break;case"quarter":t=e(this.year(),this.month()-this.month()%3,1);break;case"month":t=e(this.year(),this.month(),1);break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=e(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=_f(t+(this._isUTC?0:this.utcOffset()*yf),uE);break;case"minute":t=this._d.valueOf(),t-=_f(t,yf);break;case"second":t=this._d.valueOf(),t-=_f(t,cE);break}return this._d.setTime(t),ke.updateOffset(this,!0),this}function xJ(n){var t,e;if(n=xr(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(e=this._isUTC?PV:IV,n){case"year":t=e(this.year()+1,0,1)-1;break;case"quarter":t=e(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=e(this.year(),this.month()+1,1)-1;break;case"week":t=e(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=e(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=e(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=uE-_f(t+(this._isUTC?0:this.utcOffset()*yf),uE)-1;break;case"minute":t=this._d.valueOf(),t+=yf-_f(t,yf)-1;break;case"second":t=this._d.valueOf(),t+=cE-_f(t,cE)-1;break}return this._d.setTime(t),ke.updateOffset(this,!0),this}function AJ(){return this._d.valueOf()-(this._offset||0)*6e4}function CJ(){return Math.floor(this.valueOf()/1e3)}function kJ(){return new Date(this.valueOf())}function IJ(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function PJ(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function MJ(){return this.isValid()?this.toISOString():null}function OJ(){return hP(this)}function DJ(){return Sc({},dt(this))}function RJ(){return dt(this).overflow}function LJ(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ke("N",0,0,"eraAbbr");Ke("NN",0,0,"eraAbbr");Ke("NNN",0,0,"eraAbbr");Ke("NNNN",0,0,"eraName");Ke("NNNNN",0,0,"eraNarrow");Ke("y",["y",1],"yo","eraYear");Ke("y",["yy",2],0,"eraYear");Ke("y",["yyy",3],0,"eraYear");Ke("y",["yyyy",4],0,"eraYear");Fe("N",PP);Fe("NN",PP);Fe("NNN",PP);Fe("NNNN",GJ);Fe("NNNNN",YJ);Yt(["N","NN","NNN","NNNN","NNNNN"],function(n,t,e,i){var s=e._locale.erasParse(n,i,e._strict);s?dt(e).era=s:dt(e).invalidEra=n});Fe("y",Am);Fe("yy",Am);Fe("yyy",Am);Fe("yyyy",Am);Fe("yo",qJ);Yt(["y","yy","yyy","yyyy"],Vi);Yt(["yo"],function(n,t,e,i){var s;e._locale._eraYearOrdinalRegex&&(s=n.match(e._locale._eraYearOrdinalRegex)),e._locale.eraYearOrdinalParse?t[Vi]=e._locale.eraYearOrdinalParse(n,s):t[Vi]=parseInt(n,10)});function FJ(n,t){var e,i,s,r=this._eras||yl("en")._eras;for(e=0,i=r.length;e<i;++e){switch(typeof r[e].since){case"string":s=ke(r[e].since).startOf("day"),r[e].since=s.valueOf();break}switch(typeof r[e].until){case"undefined":r[e].until=1/0;break;case"string":s=ke(r[e].until).startOf("day").valueOf(),r[e].until=s.valueOf();break}}return r}function NJ(n,t,e){var i,s,r=this.eras(),o,a,l;for(n=n.toUpperCase(),i=0,s=r.length;i<s;++i)if(o=r[i].name.toUpperCase(),a=r[i].abbr.toUpperCase(),l=r[i].narrow.toUpperCase(),e)switch(t){case"N":case"NN":case"NNN":if(a===n)return r[i];break;case"NNNN":if(o===n)return r[i];break;case"NNNNN":if(l===n)return r[i];break}else if([o,a,l].indexOf(n)>=0)return r[i]}function BJ(n,t){var e=n.since<=n.until?1:-1;return t===void 0?ke(n.since).year():ke(n.since).year()+(t-n.offset)*e}function VJ(){var n,t,e,i=this.localeData().eras();for(n=0,t=i.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),i[n].since<=e&&e<=i[n].until||i[n].until<=e&&e<=i[n].since)return i[n].name;return""}function HJ(){var n,t,e,i=this.localeData().eras();for(n=0,t=i.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),i[n].since<=e&&e<=i[n].until||i[n].until<=e&&e<=i[n].since)return i[n].narrow;return""}function zJ(){var n,t,e,i=this.localeData().eras();for(n=0,t=i.length;n<t;++n)if(e=this.clone().startOf("day").valueOf(),i[n].since<=e&&e<=i[n].until||i[n].until<=e&&e<=i[n].since)return i[n].abbr;return""}function $J(){var n,t,e,i,s=this.localeData().eras();for(n=0,t=s.length;n<t;++n)if(e=s[n].since<=s[n].until?1:-1,i=this.clone().startOf("day").valueOf(),s[n].since<=i&&i<=s[n].until||s[n].until<=i&&i<=s[n].since)return(this.year()-ke(s[n].since).year())*e+s[n].offset;return this.year()}function WJ(n){return Lt(this,"_erasNameRegex")||MP.call(this),n?this._erasNameRegex:this._erasRegex}function UJ(n){return Lt(this,"_erasAbbrRegex")||MP.call(this),n?this._erasAbbrRegex:this._erasRegex}function jJ(n){return Lt(this,"_erasNarrowRegex")||MP.call(this),n?this._erasNarrowRegex:this._erasRegex}function PP(n,t){return t.erasAbbrRegex(n)}function GJ(n,t){return t.erasNameRegex(n)}function YJ(n,t){return t.erasNarrowRegex(n)}function qJ(n,t){return t._eraYearOrdinalRegex||Am}function MP(){var n=[],t=[],e=[],i=[],s,r,o,a,l,c=this.eras();for(s=0,r=c.length;s<r;++s)o=ol(c[s].name),a=ol(c[s].abbr),l=ol(c[s].narrow),t.push(o),n.push(a),e.push(l),i.push(o),i.push(a),i.push(l);this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+e.join("|")+")","i")}Ke(0,["gg",2],0,function(){return this.weekYear()%100});Ke(0,["GG",2],0,function(){return this.isoWeekYear()%100});function mT(n,t){Ke(0,[n,n.length],0,t)}mT("gggg","weekYear");mT("ggggg","weekYear");mT("GGGG","isoWeekYear");mT("GGGGG","isoWeekYear");Fe("G",uT);Fe("g",uT);Fe("GG",cn,Xs);Fe("gg",cn,Xs);Fe("GGGG",wP,bP);Fe("gggg",wP,bP);Fe("GGGGG",cT,aT);Fe("ggggg",cT,aT);vy(["gggg","ggggg","GGGG","GGGGG"],function(n,t,e,i){t[i.substr(0,2)]=Tt(n)});vy(["gg","GG"],function(n,t,e,i){t[i]=ke.parseTwoDigitYear(n)});function KJ(n){return MV.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function XJ(n){return MV.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function JJ(){return al(this.year(),1,4)}function ZJ(){return al(this.isoWeekYear(),1,4)}function QJ(){var n=this.localeData()._week;return al(this.year(),n.dow,n.doy)}function eZ(){var n=this.localeData()._week;return al(this.weekYear(),n.dow,n.doy)}function MV(n,t,e,i,s){var r;return n==null?Ib(this,i,s).year:(r=al(n,i,s),t>r&&(t=r),tZ.call(this,n,t,e,i,s))}function tZ(n,t,e,i,s){var r=uV(n,t,e,i,s),o=kb(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}Ke("Q",0,"Qo","quarter");Fe("Q",QB);Yt("Q",function(n,t){t[il]=(Tt(n)-1)*3});function nZ(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}Ke("D",["DD",2],"Do","date");Fe("D",cn,Cm);Fe("DD",cn,Xs);Fe("Do",function(n,t){return n?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});Yt(["D","DD"],Go);Yt("Do",function(n,t){t[Go]=Tt(n.match(cn)[0])});var OV=km("Date",!0);Ke("DDD",["DDDD",3],"DDDo","dayOfYear");Fe("DDD",lT);Fe("DDDD",eV);Yt(["DDD","DDDD"],function(n,t,e){e._dayOfYear=Tt(n)});function iZ(n){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?t:this.add(n-t,"d")}Ke("m",["mm",2],0,"minute");Fe("m",cn,vP);Fe("mm",cn,Xs);Yt(["m","mm"],Qr);var sZ=km("Minutes",!1);Ke("s",["ss",2],0,"second");Fe("s",cn,vP);Fe("ss",cn,Xs);Yt(["s","ss"],sl);var rZ=km("Seconds",!1);Ke("S",0,0,function(){return~~(this.millisecond()/100)});Ke(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ke(0,["SSS",3],0,"millisecond");Ke(0,["SSSS",4],0,function(){return this.millisecond()*10});Ke(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ke(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ke(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ke(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ke(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Fe("S",lT,QB);Fe("SS",lT,Xs);Fe("SSS",lT,eV);var Tc,DV;for(Tc="SSSS";Tc.length<=9;Tc+="S")Fe(Tc,Am);function oZ(n,t){t[Iu]=Tt(("0."+n)*1e3)}for(Tc="S";Tc.length<=9;Tc+="S")Yt(Tc,oZ);DV=km("Milliseconds",!1);Ke("z",0,0,"zoneAbbr");Ke("zz",0,0,"zoneName");function aZ(){return this._isUTC?"UTC":""}function lZ(){return this._isUTC?"Coordinated Universal Time":""}var Se=by.prototype;Se.add=eJ;Se.calendar=aJ;Se.clone=lJ;Se.diff=mJ;Se.endOf=xJ;Se.format=vJ;Se.from=yJ;Se.fromNow=_J;Se.to=EJ;Se.toNow=SJ;Se.get=wK;Se.invalidAt=RJ;Se.isAfter=cJ;Se.isBefore=uJ;Se.isBetween=dJ;Se.isSame=hJ;Se.isSameOrAfter=fJ;Se.isSameOrBefore=gJ;Se.isValid=OJ;Se.lang=AV;Se.locale=xV;Se.localeData=CV;Se.max=OX;Se.min=MX;Se.parsingFlags=DJ;Se.set=vK;Se.startOf=TJ;Se.subtract=tJ;Se.toArray=IJ;Se.toObject=PJ;Se.toDate=kJ;Se.toISOString=bJ;Se.inspect=wJ;typeof Symbol<"u"&&Symbol.for!=null&&(Se[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Se.toJSON=MJ;Se.toString=pJ;Se.unix=CJ;Se.valueOf=AJ;Se.creationData=LJ;Se.eraName=VJ;Se.eraNarrow=HJ;Se.eraAbbr=zJ;Se.eraYear=$J;Se.year=iV;Se.isLeapYear=bK;Se.weekYear=KJ;Se.isoWeekYear=XJ;Se.quarter=Se.quarters=nZ;Se.month=lV;Se.daysInMonth=kK;Se.week=Se.weeks=FK;Se.isoWeek=Se.isoWeeks=NK;Se.weeksInYear=QJ;Se.weeksInWeekYear=eZ;Se.isoWeeksInYear=JJ;Se.isoWeeksInISOWeekYear=ZJ;Se.date=OV;Se.day=Se.days=XK;Se.weekday=JK;Se.isoWeekday=ZK;Se.dayOfYear=iZ;Se.hour=Se.hours=rX;Se.minute=Se.minutes=sZ;Se.second=Se.seconds=rZ;Se.millisecond=Se.milliseconds=DV;Se.utcOffset=zX;Se.utc=WX;Se.local=UX;Se.parseZone=jX;Se.hasAlignedHourOffset=GX;Se.isDST=YX;Se.isLocal=KX;Se.isUtcOffset=XX;Se.isUtc=_V;Se.isUTC=_V;Se.zoneAbbr=aZ;Se.zoneName=lZ;Se.dates=Tr("dates accessor is deprecated. Use date instead.",OV);Se.months=Tr("months accessor is deprecated. Use month instead",lV);Se.years=Tr("years accessor is deprecated. Use year instead",iV);Se.zone=Tr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",$X);Se.isDSTShifted=Tr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",qX);function cZ(n){return ln(n*1e3)}function uZ(){return ln.apply(null,arguments).parseZone()}function RV(n){return n}var Nt=gP.prototype;Nt.calendar=Kq;Nt.longDateFormat=Qq;
vendor: 9,045 bytes, lines 31-40
31Nt.invalidDate=tK;Nt.ordinal=sK;Nt.preparse=RV;Nt.postformat=RV;Nt.relativeTime=oK;Nt.pastFuture=aK;Nt.set=Yq;Nt.eras=FJ;Nt.erasParse=NJ;Nt.erasConvertYear=BJ;Nt.erasAbbrRegex=UJ;Nt.erasNameRegex=WJ;Nt.erasNarrowRegex=jJ;Nt.months=TK;Nt.monthsShort=xK;Nt.monthsParse=CK;Nt.monthsRegex=PK;Nt.monthsShortRegex=IK;Nt.week=OK;Nt.firstDayOfYear=LK;Nt.firstDayOfWeek=RK;Nt.weekdays=jK;Nt.weekdaysMin=YK;Nt.weekdaysShort=GK;Nt.weekdaysParse=KK;Nt.weekdaysRegex=QK;Nt.weekdaysShortRegex=eX;Nt.weekdaysMinRegex=tX;Nt.isPM=iX;Nt.meridiem=oX;function dE(n,t,e,i){var s=yl(),r=ta().set(i,t);return s[e](r,n)}function LV(n,t,e){if(fl(n)&&(t=n,n=void 0),n=n||"",t!=null)return dE(n,t,e,"month");var i,s=[];for(i=0;i<12;i++)s[i]=dE(n,i,e,"month");return s}function OP(n,t,e,i){typeof n=="boolean"?(fl(t)&&(e=t,t=void 0),t=t||""):(t=n,e=t,n=!1,fl(t)&&(e=t,t=void 0),t=t||"");var s=yl(),r=n?s._week.dow:0,o,a=[];if(e!=null)return dE(t,(e+r)%7,i,"day");for(o=0;o<7;o++)a[o]=dE(t,(o+r)%7,i,"day");return a}function dZ(n,t){return LV(n,t,"months")}function hZ(n,t){return LV(n,t,"monthsShort")}function fZ(n,t,e){return OP(n,t,e,"weekdays")}function gZ(n,t,e){return OP(n,t,e,"weekdaysShort")}function mZ(n,t,e){return OP(n,t,e,"weekdaysMin")}Pc("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var t=n%10,e=Tt(n%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return n+e}});ke.lang=Tr("moment.lang is deprecated. Use moment.locale instead.",Pc);ke.langData=Tr("moment.langData is deprecated. Use moment.localeData instead.",yl);var la=Math.abs;function pZ(){var n=this._data;return this._milliseconds=la(this._milliseconds),this._days=la(this._days),this._months=la(this._months),n.milliseconds=la(n.milliseconds),n.seconds=la(n.seconds),n.minutes=la(n.minutes),n.hours=la(n.hours),n.months=la(n.months),n.years=la(n.years),this}function FV(n,t,e,i){var s=mo(t,e);return n._milliseconds+=i*s._milliseconds,n._days+=i*s._days,n._months+=i*s._months,n._bubble()}function bZ(n,t){return FV(this,n,t,1)}function wZ(n,t){return FV(this,n,t,-1)}function WR(n){return n<0?Math.floor(n):Math.ceil(n)}function vZ(){var n=this._milliseconds,t=this._days,e=this._months,i=this._data,s,r,o,a,l;return n>=0&&t>=0&&e>=0||n<=0&&t<=0&&e<=0||(n+=WR(pC(e)+t)*864e5,t=0,e=0),i.milliseconds=n%1e3,s=vr(n/1e3),i.seconds=s%60,r=vr(s/60),i.minutes=r%60,o=vr(r/60),i.hours=o%24,t+=vr(o/24),l=vr(NV(t)),e+=l,t-=WR(pC(l)),a=vr(e/12),e%=12,i.days=t,i.months=e,i.years=a,this}function NV(n){return n*4800/146097}function pC(n){return n*146097/4800}function yZ(n){if(!this.isValid())return NaN;var t,e,i=this._milliseconds;if(n=xr(n),n==="month"||n==="quarter"||n==="year")switch(t=this._days+i/864e5,e=this._months+NV(t),n){case"month":return e;case"quarter":return e/3;case"year":return e/12}else switch(t=this._days+Math.round(pC(this._months)),n){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return t*24+i/36e5;case"minute":return t*1440+i/6e4;case"second":return t*86400+i/1e3;case"millisecond":return Math.floor(t*864e5)+i;default:throw new Error("Unknown unit "+n)}}function _l(n){return function(){return this.as(n)}}var BV=_l("ms"),_Z=_l("s"),EZ=_l("m"),SZ=_l("h"),TZ=_l("d"),xZ=_l("w"),AZ=_l("M"),CZ=_l("Q"),kZ=_l("y"),IZ=BV;function PZ(){return mo(this)}function MZ(n){return n=xr(n),this.isValid()?this[n+"s"]():NaN}function vh(n){return function(){return this.isValid()?this._data[n]:NaN}}var OZ=vh("milliseconds"),DZ=vh("seconds"),RZ=vh("minutes"),LZ=vh("hours"),FZ=vh("days"),NZ=vh("months"),BZ=vh("years");function VZ(){return vr(this.days()/7)}var ba=Math.round,lf={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function HZ(n,t,e,i,s){return s.relativeTime(t||1,!!e,n,i)}function zZ(n,t,e,i){var s=mo(n).abs(),r=ba(s.as("s")),o=ba(s.as("m")),a=ba(s.as("h")),l=ba(s.as("d")),c=ba(s.as("M")),u=ba(s.as("w")),d=ba(s.as("y")),h=r<=e.ss&&["s",r]||r<e.s&&["ss",r]||o<=1&&["m"]||o<e.m&&["mm",o]||a<=1&&["h"]||a<e.h&&["hh",a]||l<=1&&["d"]||l<e.d&&["dd",l];return e.w!=null&&(h=h||u<=1&&["w"]||u<e.w&&["ww",u]),h=h||c<=1&&["M"]||c<e.M&&["MM",c]||d<=1&&["y"]||["yy",d],h[2]=t,h[3]=+n>0,h[4]=i,HZ.apply(null,h)}function $Z(n){return n===void 0?ba:typeof n=="function"?(ba=n,!0):!1}function WZ(n,t){return lf[n]===void 0?!1:t===void 0?lf[n]:(lf[n]=t,n==="s"&&(lf.ss=t-1),!0)}function UZ(n,t){if(!this.isValid())return this.localeData().invalidDate();var e=!1,i=lf,s,r;return typeof n=="object"&&(t=n,n=!1),typeof n=="boolean"&&(e=n),typeof t=="object"&&(i=Object.assign({},lf,t),t.s!=null&&t.ss==null&&(i.ss=t.s-1)),s=this.localeData(),r=zZ(this,!e,i,s),e&&(r=s.pastFuture(+this,r)),s.postformat(r)}var Wx=Math.abs;function Hh(n){return(n>0)-(n<0)||+n}function pT(){if(!this.isValid())return this.localeData().invalidDate();var n=Wx(this._milliseconds)/1e3,t=Wx(this._days),e=Wx(this._months),i,s,r,o,a=this.asSeconds(),l,c,u,d;return a?(i=vr(n/60),s=vr(i/60),n%=60,i%=60,r=vr(e/12),e%=12,o=n?n.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=Hh(this._months)!==Hh(a)?"-":"",u=Hh(this._days)!==Hh(a)?"-":"",d=Hh(this._milliseconds)!==Hh(a)?"-":"",l+"P"+(r?c+r+"Y":"")+(e?c+e+"M":"")+(t?u+t+"D":"")+(s||i||n?"T":"")+(s?d+s+"H":"")+(i?d+i+"M":"")+(n?d+o+"S":"")):"P0D"}var It=gT.prototype;It.isValid=NX;It.abs=pZ;It.add=bZ;It.subtract=wZ;It.as=yZ;It.asMilliseconds=BV;It.asSeconds=_Z;It.asMinutes=EZ;It.asHours=SZ;It.asDays=TZ;It.asWeeks=xZ;It.asMonths=AZ;It.asQuarters=CZ;It.asYears=kZ;It.valueOf=IZ;It._bubble=vZ;It.clone=PZ;It.get=MZ;It.milliseconds=OZ;It.seconds=DZ;It.minutes=RZ;It.hours=LZ;It.days=FZ;It.weeks=VZ;It.months=NZ;It.years=BZ;It.humanize=UZ;It.toISOString=pT;It.toString=pT;It.toJSON=pT;It.locale=xV;It.localeData=CV;It.toIsoString=Tr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",pT);It.lang=AV;Ke("X",0,0,"unix");Ke("x",0,0,"valueOf");Fe("x",uT);Fe("X",dK);Yt("X",function(n,t,e){e._d=new Date(parseFloat(n)*1e3)});Yt("x",function(n,t,e){e._d=new Date(Tt(n))});//! moment.js 32ke.version="2.30.1";jq(ln);ke.fn=Se;ke.min=DX;ke.max=RX;ke.now=LX;ke.utc=ta;ke.unix=cZ;ke.months=dZ;ke.isDate=py;ke.locale=Pc;ke.invalid=oT;ke.duration=mo;ke.isMoment=ao;ke.weekdays=fZ;ke.parseZone=uZ;ke.localeData=yl;ke.isDuration=r0;ke.monthsShort=hZ;ke.weekdaysMin=mZ;ke.defineLocale=TP;ke.updateLocale=uX;ke.locales=dX;ke.weekdaysShort=gZ;ke.normalizeUnits=xr;ke.relativeTimeRounding=$Z;ke.relativeTimeThreshold=WZ;ke.calendarFormat=oJ;ke.prototype=Se;ke.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};/*! 33 * chartjs-adapter-moment v1.0.1 34 * https://www.chartjs.org 35 * (c) 2022 chartjs-adapter-moment Contributors 36 * Released under the MIT license 37 */const jZ={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};CB._date.override(typeof ke=="function"?{_id:"moment",formats:function(){return jZ},parse:function(n,t){return typeof n=="string"&&typeof t=="string"?n=ke(n,t):n instanceof ke||(n=ke(n)),n.isValid()?n.valueOf():null},format:function(n,t){return ke(n).format(t)},add:function(n,t,e){return ke(n).add(t,e).valueOf()},diff:function(n,t,e){return ke(n).diff(ke(t),e)},startOf:function(n,t,e){return n=ke(n),t==="isoWeek"?(e=Math.trunc(Math.min(Math.max(0,e),6)),n.isoWeekday(e).startOf("day").valueOf()):n.startOf(t).valueOf()},endOf:function(n,t){return ke(n).endOf(t).valueOf()}}:{});/*! 38* sweetalert2 v11.15.9 39* Released under the MIT License. 40*/function VV(n,t,e){if(typeof n=="function"?n===t:n.has(t))return arguments.length<3?t:e;throw new TypeError("Private element is not present on this object")}function GZ(n,t){if(t.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function UR(n,t){return n.get(VV(n,t))}function YZ(n,t,e){GZ(n,t),t.set(n,e)}function qZ(n,t,e){return n.set(VV(n,t),e),e}const KZ=100,Xe={},XZ=()=>{Xe.previousActiveElement instanceof HTMLElement?(Xe.previousActiveElement.focus(),Xe.previousActiveElement=null):document.body&&document.body.focus()},JZ=n=>new Promise(t=>{if(!n)return t();const e=window.scrollX,i=window.scrollY;Xe.restoreFocusTimeout=setTimeout(()=>{XZ(),t()},KZ),window.scrollTo(e,i)}),HV="swal2-",ZZ=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","to
40p-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"],ce=ZZ.reduce((n,t)=>(n[t]=HV+t,n),{}),QZ=["success","warning","info","question","error"],hE=QZ.reduce((n,t)=>(n[t]=HV+t,n),{}),zV="SweetAlert2:",DP=n=>n.charAt(0).toUpperCase()+n.slice(1),Es=n=>{console.warn(`${zV} ${typeof n=="object"?n.join(" "):n}`)},yh=n=>{console.error(`${zV} ${n}`)},jR=[],eQ=n=>{jR.includes(n)||(jR.push(n),Es(n))},$V=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;eQ(`"${n}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`)},bT=n=>typeof n=="function"?n():n,RP=n=>n&&typeof n.toPromise=="function",yy=n=>RP(n)?n.toPromise():Promise.resolve(n),LP=n=>n&&Promise.resolve(n)===n,Ss=()=>document.body.querySelector(`.${ce.container}`),_y=n=>{const t=Ss();return t?t.querySelector(n):null},Js=n=>_y(`.${n}`),Ft=()=>Js(ce.popup),Im=()=>Js(ce.icon),tQ=()=>Js(ce["icon-content"]),WV=()=>Js(ce.title),FP=()=>Js(ce["html-container"]),UV=()=>Js(ce.image),NP=()=>Js(ce["progress-steps"]),wT=()=>Js(ce["validation-message"]),Zo=()=>_y(`.${ce.actions} .${ce.confirm}`),Pm=()=>_y(`.${ce.actions} .${ce.cancel}`),_h=()=>_y(`.${ce.actions} .${ce.deny}`),nQ=()=>Js(ce["input-label"]),Mm=()=>_y(`.${ce.loader}`),Ey=()=>Js(ce.actions),jV=()=>Js(ce.footer),vT=()=>Js(ce["timer-progress-bar"]),BP=()=>Js(ce.close),iQ=` 41 a[href], 42 area[href], 43 input:not([disabled]), 44 select:not([disabled]), 45 textarea:not([disabled]), 46 button:not([disabled]), 47 iframe, 48 object, 49 embed, 50 [tabindex="0"], 51 [contenteditable], 52 audio[controls], 53 video[controls], 54 summary 55`,VP=()=>{const n=Ft();if(!n)return[];const t=n.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),e=Array.from(t).sort((r,o)=>{const a=parseInt(r.getAttribute("tabindex")||"0"),l=parseInt(o.getAttribute("tabindex")||"0");return a>l?1:a<l?-1:0}),i=n.querySelectorAll(iQ),s=Array.from(i).filter(r=>r.getAttribute("tabindex")!=="-1");return[...new Set(e.concat(s))].filter(r=>ws(r))},HP=()=>ll(document.body,ce.shown)&&!ll(document.body,ce["toast-shown"])&&!ll(document.body,ce["no-backdrop"]),yT=()=>{const n=Ft();return n?ll(n,ce.toast):!1},sQ=()=>{const n=Ft();return n?n.hasAttribute("data-loading"):!1},Zs=(n,t)=>{if(n.textContent="",t){const i=new DOMParser().parseFromString(t,"text/html"),s=i.querySelector("head");s&&Array.from(s.childNodes).forEach(o=>{n.appendChild(o)});const r=i.querySelector("body");r&&Array.from(r.childNodes).forEach(o=>{o instanceof HTMLVideoElement||o instanceof HTMLAudioElement?n.appendChild(o.cloneNode(!0)):n.appendChild(o)})}},ll=(n,t)=>{if(!t)return!1;const e=t.split(/\s+/);for(let i=0;i<e.length;i++)if(!n.classList.contains(e[i]))return!1;return!0},rQ=(n,t)=>{Array.from(n.classList).forEach(e=>{!Object.values(ce).includes(e)&&!Object.values(hE).includes(e)&&!Object.values(t.showClass||{}).includes(e)&&n.classList.remove(e)})},Ys=(n,t,e)=>{if(rQ(n,t),!t.customClass)return;const i=t.customClass[e];if(i){if(typeof i!="string"&&!i.forEach){Es(`Invalid type of customClass.${e}! Expected string or iterable object, got "${typeof i}"`);return}kt(n,i)}},_T=(n,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return n.querySelector(`.${ce.popup} > .${ce[t]}`);case"checkbox":return n.querySelector(`.${ce.popup} > .${ce.checkbox} input`);case"radio":return n.querySelector(`.${ce.popup} > .${ce.radio} input:checked`)||n.querySelector(`.${ce.popup} > .${ce.radio} input:first-child`);case"range":return n.querySelector(`.${ce.popup} > .${ce.range} input`);default:return n.querySelector(`.${ce.popup} > .${ce.input}`)}},GV=n=>{if(n.focus(),n.type!=="file"){const t=n.value;n.value="",n.value=t}},YV=(n,t,e)=>{!n||!t||(typeof t=="string"&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(i=>
55{Array.isArray(n)?n.forEach(s=>{e?s.classList.add(i):s.classList.remove(i)}):e?n.classList.add(i):n.classList.remove(i)}))},kt=(n,t)=>{YV(n,t,!0)},_r=(n,t)=>{YV(n,t,!1)},xc=(n,t)=>{const e=Array.from(n.children);for(let i=0;i<e.length;i++){const s=e[i];if(s instanceof HTMLElement&&ll(s,t))return s}},th=(n,t,e)=>{e===`${parseInt(e)}`&&(e=parseInt(e)),e||parseInt(e)===0?n.style.setProperty(t,typeof e=="number"?`${e}px`:e):n.style.removeProperty(t)},di=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";n&&(n.style.display=t)},zi=n=>{n&&(n.style.display="none")},zP=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"block";n&&new MutationObserver(()=>{Sy(n,n.innerHTML,t)}).observe(n,{childList:!0,subtree:!0})},GR=(n,t,e,i)=>{const s=n.querySelector(t);s&&s.style.setProperty(e,i)},Sy=function(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"flex";t?di(n,e):zi(n)},ws=n=>!!(n&&(n.offsetWidth||n.offsetHeight||n.getClientRects().length)),oQ=()=>!ws(Zo())&&!ws(_h())&&!ws(Pm()),YR=n=>n.scrollHeight>n.clientHeight,qV=n=>{const t=window.getComputedStyle(n),e=parseFloat(t.getPropertyValue("animation-duration")||"0"),i=parseFloat(t.getPropertyValue("transition-duration")||"0");return e>0||i>0},$P=function(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const e=vT();e&&ws(e)&&(t&&(e.style.transition="none",e.style.width="100%"),setTimeout(()=>{e.style.transition=`width ${n/1e3}s linear`,e.style.width="0%"},10))},aQ=()=>{const n=vT();if(!n)return;const t=parseInt(window.getComputedStyle(n).width);n.style.removeProperty("transition"),n.style.width="100%";const e=parseInt(window.getComputedStyle(n).width),i=t/e*100;n.style.width=`${i}%`},lQ=()=>typeof window>"u"||typeof document>"u",cQ=` 56 <div aria-labelledby="${ce.title}" aria-describedby="${ce["html-container"]}" class="${ce.popup}" tabindex="-1"> 57 <button type="button" class="${ce.close}"></button> 58 <ul class="${ce["progress-steps"]}"></ul> 59 <div class="${ce.icon}"></div> 60 <img class="${ce.image}" /> 61 <h2 class="${ce.title}" id="${ce.title}"></h2> 62 <div class="${ce["html-container"]}" id="${ce["html-container"]}"></div> 63 <input class="${ce.input}" id="${ce.input}" /> 64 <input type="file" class="${ce.file}" /> 65 <div class="${ce.range}"> 66 <input type="range" /> 67 <output></output> 68 </div> 69 <select class="${ce.select}" id="${ce.select}"></select> 70 <div class="${ce.radio}"></div> 71 <label class="${ce.checkbox}"> 72 <input type="checkbox" id="${ce.checkbox}" /> 73 <span class="${ce.label}"></span> 74 </label> 75 <textarea class="${ce.textarea}" id="${ce.textarea}"></textarea> 76 <div class="${ce["validation-message"]}" id="${ce["validation-message"]}"></div> 77 <div class="${ce.actions}"> 78 <div class="${ce.loader}"></div> 79 <button type="button" class="${ce.confirm}"></button> 80 <button type="button" class="${ce.deny}"></button> 81 <button type="button" class="${ce.cancel}"></button> 82 </div> 83 <div class="${ce.footer}"></div> 84 <div class="${ce["timer-progress-bar-container"]}"> 85 <div class="${ce["timer-progress-bar"]}"></div> 86 </div> 87 </div> 88`.replace(/(^|\n)\s*/g,""),uQ=()=>{const n=Ss();return n?(n.remove(),_r([document.documentElement,document.body],[ce["no-backdrop"],ce["toast-shown"],ce["has-column"]]),!0):!1},hu=()=>{Xe.currentInstance.resetValidationMessage()},dQ=()=>{const n=Ft(),t=xc(n,ce.input),e=xc(n,ce.file),i=n.querySelector(`.${ce.range} input`),s=n.querySelector(`.${ce.range} output`),r=xc(n,ce.select),o=n.querySelector(`.${ce.checkbox} input`),a=xc(n,ce.textarea);t.oninput=hu,e.onchange=hu,r.onchange=hu,o.onchange=hu,a.oninput=hu,i.oninput=()=>{hu(),s.value=i.value},i.onchange=()=>{hu(),s.value=i.value}},hQ=n=>typeof n=="string"?document.querySelector(n):n,fQ=n=>{const t=Ft();t.setAttribute("role",n.toast?"alert":"dialog"),t.setAttribute("aria-live",n.toast?"polite":"assertive"),n.toast||t.setAttribute("aria-modal","true")},gQ=n=>{window.getComputedStyle(n).direction==="rtl"&&kt(Ss(),ce.rtl)},mQ=n=>{const t=uQ();if(lQ()){yh("SweetAlert2 requires document to initialize");return}const e=document.createElement("div");e.className=ce.container,t&&kt(e,ce["no-transition"]),Zs(e,cQ);const i=hQ(n.target);i.appendChild(e),fQ(n),gQ(i),dQ()},WP=(n,t)=>{n instanceof HTMLElement?t.appendChild(n):typeof n=="object"?pQ(n,t):n&&Zs(t,n)},pQ=(n,t)=>{n.jquery?bQ(t,n):Zs(t,n.toString())},bQ=(n,t)=>{if(n.textContent="",0 in t)for(let e=0;e in t;e++)n.appendChild(t[e].cloneNode(!0));else n.appendChild(t.cloneNode(!0))},wQ=(n,t)=>{const e=Ey(),i=Mm();!e||!i||(!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?zi(e):di(e),Ys(e,t,"actions"),vQ(e,i,t),Zs(i,t.loaderHtml||""),Ys(i,t,"loader"))};function vQ(n,t,e){const i=Zo(),s=_h(),r=Pm();!i||!s||!r||(Ux(i,"confirm",e),Ux(s,"deny",e),Ux(r,"cancel",e),yQ(i,s,r,e),e.reverseButtons&&(e.toast?(n.insertBefore(r,i),n.insertBefore(s,i)):(n.insertBefore(r,t),n.insertBefore(s,t),n.insertBefore(i,t))))}function yQ(n,t,e,i){if(!i.buttonsStyling){_r([n,t,e],ce.styled);return}kt([n,t,e],ce.styled),i.confirmButtonColor&&(n.style.backgroundColor=i.confirmButtonColor,kt(n,ce["default-outline"])),i.denyButtonColor&&(t.style.backgroundColor=i.denyButtonColor,kt(t,ce["default-outline"])),i.cancelButtonColor&&(e.style.backgroundColor=i.cancelButtonColor,kt(e,ce["default-outline"]))}function Ux(n,t,e){const i=DP(t);Sy(n,e[`show${i}Button`],"inline-block"),Zs(n,e[`${t}ButtonText`]||""),n.setAttribute("aria-label",e[`${t}ButtonAriaLabel`]||""),n.className=ce[t],Ys(n,e,`${t}Button`)}const _Q=(n,t)=>{const e=BP();e&&(Zs(e,t.closeButtonHtml||""),Ys(e,t,"closeButton"),Sy(e,t.showCloseButton),e.setAttribute("aria-label",t.closeButtonAriaLabel||""))},EQ=(n,t)=>{const e=Ss();e&&(SQ(e,t.backdrop),TQ(e,t.position),xQ(e,t.grow),Ys(e,t,"container"))};function SQ(n,t){typeof t=="string"?n.style.background=t:t||kt([document.documentElement,document.body],ce["no-backdrop"])}function TQ(n,t){t&&(t in ce?kt(n,ce[t]):(Es('The "position" parameter is not val
88id, defaulting to "center"'),kt(n,ce.center)))}function xQ(n,t){t&&kt(n,ce[`grow-${t}`])}var nn={innerParams:new WeakMap,domCache:new WeakMap};const AQ=["input","file","range","select","radio","checkbox","textarea"],CQ=(n,t)=>{const e=Ft();if(!e)return;const i=nn.innerParams.get(n),s=!i||t.input!==i.input;AQ.forEach(r=>{const o=xc(e,ce[r]);o&&(PQ(r,t.inputAttributes),o.className=ce[r],s&&zi(o))}),t.input&&(s&&kQ(t),MQ(t))},kQ=n=>{if(!n.input)return;if(!Pn[n.input]){yh(`Unexpected type of input! Expected ${Object.keys(Pn).join(" | ")}, got "${n.input}"`);return}const t=KV(n.input);if(!t)return;const e=Pn[n.input](t,n);di(t),n.inputAutoFocus&&setTimeout(()=>{GV(e)})},IQ=n=>{for(let t=0;t<n.attributes.length;t++){const e=n.attributes[t].name;["id","type","value","style"].includes(e)||n.removeAttribute(e)}},PQ=(n,t)=>{const e=Ft();if(!e)return;const i=_T(e,n);if(i){IQ(i);for(const s in t)i.setAttribute(s,t[s])}},MQ=n=>{if(!n.input)return;const t=KV(n.input);t&&Ys(t,n,"input")},UP=(n,t)=>{!n.placeholder&&t.inputPlaceholder&&(n.placeholder=t.inputPlaceholder)},Ty=(n,t,e)=>{if(e.inputLabel){const i=document.createElement("label"),s=ce["input-label"];i.setAttribute("for",n.id),i.className=s,typeof e.customClass=="object"&&kt(i,e.customClass.inputLabel),i.innerText=e.inputLabel,t.insertAdjacentElement("beforebegin",i)}},KV=n=>{const t=Ft();if(t)return xc(t,ce[n]||ce.input)},fE=(n,t)=>{["string","number"].includes(typeof t)?n.value=`${t}`:LP(t)||Es(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Pn={};Pn.text=Pn.email=Pn.password=Pn.number=Pn.tel=Pn.url=Pn.search=Pn.date=Pn["datetime-local"]=Pn.time=Pn.week=Pn.month=(n,t)=>(fE(n,t.inputValue),Ty(n,n,t),UP(n,t),n.type=t.input,n);Pn.file=(n,t)=>(Ty(n,n,t),UP(n,t),n);Pn.range=(n,t)=>{const e=n.querySelector("input"),i=n.querySelector("output");return fE(e,t.inputValue),e.type=t.input,fE(i,t.inputValue),Ty(e,n,t),n};Pn.select=(n,t)=>{if(n.textContent="",t.inputPlaceholder){const e=document.createElement("option");Zs(e,t.inputPlaceholder),e.value="",e.disabled=!0,e.selected=!0,n.appendChild(e)}return Ty(n,n,t),n};Pn.radio=n=>(n.textContent="",n);Pn.checkbox=(n,t)=>{const e=_T(Ft(),"checkbox");e.value="1",e.checked=!!t.inputValue;const i=n.querySelector("span");return Zs(i,t.inputPlaceholder||t.inputLabel),e};Pn.textarea=(n,t)=>{fE(n,t.inputValue),UP(n,t),Ty(n,n,t);const e=i=>parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const i=parseInt(window.getComputedStyle(Ft()).width),s=()=>
88{if(!document.body.contains(n))return;const r=n.offsetWidth+e(n);r>i?Ft().style.width=`${r}px`:th(Ft(),"width",t.width)};new MutationObserver(s).observe(n,{attributes:!0,attributeFilter:["style"]})}}),n};const OQ=(n,t)=>{const e=FP();e&&(zP(e),Ys(e,t,"htmlContainer"),t.html?(WP(t.html,e),di(e,"block")):t.text?(e.textContent=t.text,di(e,"block")):zi(e),CQ(n,t))},DQ=(n,t)=>{const e=jV();e&&(zP(e),Sy(e,t.footer,"block"),t.footer&&WP(t.footer,e),Ys(e,t,"footer"))},RQ=(n,t)=>{const e=nn.innerParams.get(n),i=Im();if(i){if(e&&t.icon===e.icon){KR(i,t),qR(i,t);return}if(!t.icon&&!t.iconHtml){zi(i);return}if(t.icon&&Object.keys(hE).indexOf(t.icon)===-1){yh(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),zi(i);return}di(i),KR(i,t),qR(i,t),kt(i,t.showClass&&t.showClass.icon)}},qR=(n,t)=>{for(const[e,i]of Object.entries(hE))t.icon!==e&&_r(n,i);kt(n,t.icon&&hE[t.icon]),BQ(n,t),LQ(),Ys(n,t,"icon")},LQ=()=>{const n=Ft();if(!n)return;const t=window.getComputedStyle(n).getPropertyValue("background-color"),e=n.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let i=0;i<e.length;i++)e[i].style.backgroundColor=t},FQ=` 89 <div class="swal2-success-circular-line-left"></div> 90 <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span> 91 <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div> 92 <div class="swal2-success-circular-line-right"></div> 93`,NQ=` 94 <span class="swal2-x-mark"> 95 <span class="swal2-x-mark-line-left"></span> 96 <span class="swal2-x-mark-line-right"></span> 97 </span> 98`,KR=(n,t)=>{if(!t.icon&&!t.iconHtml)return;let e=n.innerHTML,i="";t.iconHtml?i=XR(t.iconHtml):t.icon==="success"?(i=FQ,e=e.replace(/ style=".*?"/g,"")):t.icon==="error"?i=NQ:t.icon&&(i=XR({question:"?",warning:"!",info:"i"}[t.icon])),e.trim()!==i.trim()&&Zs(n,i)},BQ=(n,t)=>{if(t.iconColor){n.style.color=t.iconColor,n.style.borderColor=t.iconColor;for(const e of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])GR(n,e,"background-color",t.iconColor);GR(n,".swal2-success-ring","border-color",t.iconColor)}},XR=n=>`<div class="${ce["icon-content"]}">${n}</div>`,VQ=(n,t)=>{const e=UV();if(e){if(!t.imageUrl){zi(e);return}di(e,""),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt||""),th(e,"width",t.imageWidth),th(e,"height",t.imageHeight),e.className=ce.image,Ys(e,t,"image")}};let jP=!1,XV=0,JV=0,ZV=0,QV=0;const HQ=n=>{n.addEventListener("mousedown",gE),document.body.addEventListener("mousemove",mE),n.addEventListener("mouseup",pE),n.addEventListener("touchstart",gE),document.body.addEventListener("touchmove",mE),n.addEventListener("touchend",pE)},zQ=n=>{n.removeEventListener("mousedown",gE),document.body.removeEventListener("mousemove",mE),n.removeEventListener("mouseup",pE),n.removeEventListener("touchstart",gE),document.body.removeEventListener("touchmove",mE),n.removeEventListener("touchend",pE)},gE=n=>{const t=Ft();if(n.target===t||Im().contains(n.target)){jP=!0;const e=eH(n);XV=e.clientX,JV=e.clientY,ZV=parseInt(t.style.insetInlineStart)||0,QV=parseInt(t.style.insetBlockStart)||0,kt(t,"swal2-dragging")}},mE=n=>{const t=Ft();if(jP){let{clientX:e,clientY:i}=eH(n);t.style.insetInlineStart=`${ZV+(e-XV)}px`,t.style.insetBlockStart=`${QV+(i-JV)}px`}},pE=()=>{const n=Ft();jP=!1,_r(n,"swal2-dragging")},eH=n=>{let t=0,e=0;return n.type.startsWith("mouse")?(t=n.clientX,e=n.clientY):n.type.startsWith("touch")&&(t=n.touches[0].clientX,e=n.touches[0].clientY),{clientX:t,clientY:e}},$Q=(n,t)=>{const e=Ss(),i=Ft();if(!(!e||!i)){if(t.toast){th(e,"width",t.width),i.style.width="100%";const s=Mm();s&&i.insertBefore(s,Im())}else th(i,"width",t.width);th(i,"padding",t.padding),t.color&&(i.style.color=t.color),t.background&&(i.style.background=t.background),zi(wT()),WQ(i,t),t.draggable&&!t.toast?(kt(i,ce.draggable),HQ(i)):(_r(i,ce.draggable),zQ(i))}},WQ=(n,t)=>{const e=t.showClass||{};n.className=`${ce.popup} ${ws(n)?e.popup:""}`,t.toast?(kt([document.documentElement,document.body],ce["toast-shown"]),kt(n,ce.toast)):kt(n,ce.modal),Ys(n,t,"popup"),typeof t.customClass=="string"&&kt(n,t.customClass),t.icon&&kt(n,ce[`icon-${t.icon}`])},UQ=(n,t)=>{const e=NP();if(!e)return;const{progressSteps:i,currentProgressStep:s}=t;if(!i||i.length===0||s===void 0){zi(e);return}di(e),e.textContent="",s>=i.length&&Es("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),i.forEac
98h((r,o)=>{const a=jQ(r);if(e.appendChild(a),o===s&&kt(a,ce["active-progress-step"]),o!==i.length-1){const l=GQ(t);e.appendChild(l)}})},jQ=n=>{const t=document.createElement("li");return kt(t,ce["progress-step"]),Zs(t,n),t},GQ=n=>{const t=document.createElement("li");return kt(t,ce["progress-step-line"]),n.progressStepsDistance&&th(t,"width",n.progressStepsDistance),t},YQ=(n,t)=>{const e=WV();e&&(zP(e),Sy(e,t.title||t.titleText,"block"),t.title&&WP(t.title,e),t.titleText&&(e.innerText=t.titleText),Ys(e,t,"title"))},tH=(n,t)=>{$Q(n,t),EQ(n,t),UQ(n,t),RQ(n,t),VQ(n,t),YQ(n,t),_Q(n,t),OQ(n,t),wQ(n,t),DQ(n,t);const e=Ft();typeof t.didRender=="function"&&e&&t.didRender(e),Xe.eventEmitter.emit("didRender",e)},qQ=()=>ws(Ft()),nH=()=>{var n;return(n=Zo())===null||n===void 0?void 0:n.click()},KQ=()=>{var n;return(n=_h())===null||n===void 0?void 0:n.click()},XQ=()=>{var n;return(n=Pm())===null||n===void 0?void 0:n.click()},Om=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),iH=n=>{n.keydownTarget&&n.keydownHandlerAdded&&(n.keydownTarget.removeEventListener("keydown",n.keydownHandler,{capture:n.keydownListenerCapture}),n.keydownHandlerAdded=!1)},JQ=(n,t,e)=>{iH(n),t.toast||(n.keydownHandler=i=>QQ(t,i,e),n.keydownTarget=t.keydownListenerCapture?window:Ft(),n.keydownListenerCapture=t.keydownListenerCapture,n.keydownTarget.addEventListener("keydown",n.keydownHandler,{capture:n.keydownListenerCapture}),n.keydownHandlerAdded=!0)},bC=(n,t)=>{var e;const i=VP();if(i.length){n=n+t,n===i.length?n=0:n===-1&&(n=i.length-1),i[n].focus();return}(e=Ft())===null||e===void 0||e.focus()},sH=["ArrowRight","ArrowDown"],ZQ=["ArrowLeft","ArrowUp"],QQ=(n,t,e)=>{n&&(t.isComposing||t.keyCode===229||(n.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?eee(t,n):t.key==="Tab"?tee(t):[...sH,...ZQ].includes(t.key)?nee(t.key):t.key==="Escape"&&iee(t,n,e)))},eee=(n,t)=>{if(!bT(t.allowEnterKey))return;const e=_T(Ft(),t.input);if(n.target&&e&&n.target instanceof HTMLElement&&n.target.outerHTML===e.outerHTML){if(["textarea","file"].includes(t.input))return;nH(),n.preventDefault()}},tee=n=>{const t=n.target,e=VP();let i=-1;for(let s=0;s<e.length;s++)if(t===e[s]){i=s;break}n.shiftKey?bC(i,-1):bC(i,1),n.stopPropagation(),n.preventDefault()},nee=n=>{const t=Ey(),e=Zo(),i=_h(),s=Pm();if(!t||!e||!i||!s)return;const r=[e,i,s];if(document.activeElement instanceof HTMLElement&&!r.includes(document.activeElement))return;const o=sH.includes(n)?"nextElementSibling":"previousElementSibling";let a=document.activeElement;if(a){for(let l=0;l<t.children.length;l++){if(a=a[o],!a)return;if(a instanceof HTMLButtonElement&&ws(a))break}a instanceof HTMLButtonElement&&a.focus()}},iee=(n,t,e)=>{bT(t.allowEscapeKey)&&(n.preventDefault(),e(Om.esc))};var um={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const see=()=>{const n=Ss();Array.from(document.body.children).forEach(e=>{e.contains(n)||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))})},rH=()=>{Array.from(document.body.children).forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")||""),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},oH=typeof window<"u"&&!!window.GestureEvent,ree=()=>{if(oH&&!ll(document.body,ce.iosfix)){const n=document.body.scrollTop;document.body.style.top=`${n*-1}px`,kt(document.body,ce.iosfix),oee()}},oee=()=>{const n=Ss();if(!n)return;let t;n.ontouchstart=e=>{t=aee(e)},n.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},aee=n=>{const t=n.target,e=Ss(),i=FP();return!e||!i||lee(n)||cee(n)?!1:t===e||!YR(e)&&t instanceof HTMLElement&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(YR(i)&&i.contains(t))},lee=n=>n.touches&&n.touches.length&&n.touches[0].touchType==="stylus",cee=n=>n.touches&&n.touches.length>1,uee=()=>{if(ll(document.body,ce.iosfix)){const n=parseInt(document.body.style.top,10);_r(document.body,ce.iosfix),document.body.style.top="",document.body.scrollTop=n*-1}},dee=()=>{const n=document.createElement("div");n.className=ce["scrollbar-measure"],document.body.appendChild(n);const t=n.getBoundingClientRect().width-n.clientWidth;return document.body.removeChild(n),t};let Ef=null;const hee=n=>{Ef===null&&(document.body.scrollHeight>window.innerHeight||n==="scroll")&&(Ef=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Ef+dee()}px`)},fee=()=>{Ef!==null&&(document.body.style.paddingRight=`${Ef}px`,Ef=null)};function aH(n,t,e,i){yT()?JR(n,i):(JZ(e).then(()=>JR(n,i)),iH(Xe)),oH?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),HP()&&(fee(),uee(),rH()),gee(
98)}function gee(){_r([document.documentElement,document.body],[ce.shown,ce["height-auto"],ce["no-backdrop"],ce["toast-shown"]])}function Ac(n){n=pee(n);const t=um.swalPromiseResolve.get(this),e=mee(this);this.isAwaitingPromise?n.isDismissed||(xy(this),t(n)):e&&t(n)}const mee=n=>{const t=Ft();if(!t)return!1;const e=nn.innerParams.get(n);if(!e||ll(t,e.hideClass.popup))return!1;_r(t,e.showClass.popup),kt(t,e.hideClass.popup);const i=Ss();return _r(i,e.showClass.backdrop),kt(i,e.hideClass.backdrop),bee(n,t,e),!0};function lH(n){const t=um.swalPromiseReject.get(this);xy(this),t&&t(n)}const xy=n=>{n.isAwaitingPromise&&(delete n.isAwaitingPromise,nn.innerParams.get(n)||n._destroy())},pee=n=>typeof n>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},n),bee=(n,t,e)=>{var i;const s=Ss(),r=qV(t);typeof e.willClose=="function"&&e.willClose(t),(i=Xe.eventEmitter)===null||i===void 0||i.emit("willClose",t),r?wee(n,t,s,e.returnFocus,e.didClose):aH(n,s,e.returnFocus,e.didClose)},wee=(n,t,e,i,s)=>{Xe.swalCloseEventFinishedCallback=aH.bind(null,n,e,i,s);const r=function(o){if(o.target===t){var a;(a=Xe.swalCloseEventFinishedCallback)===null||a===void 0||a.call(Xe),delete Xe.swalCloseEventFinishedCallback,t.removeEventListener("animationend",r),t.removeEventListener("transitionend",r)}};t.addEventListener("animationend",r),t.addEventListener("transitionend",r)},JR=(n,t)=>{setTimeout(()=>{var e;typeof t=="function"&&t.bind(n.params)(),(e=Xe.eventEmitter)===null||e===void 0||e.emit("didClose"),n._destroy&&n._destroy()})},dm=n=>{let t=Ft();if(t||new Cc,t=Ft(),!t)return;const e=Mm();yT()?zi(Im()):vee(t,n),di(e),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},vee=(n,t)=>{const e=Ey(),i=Mm();!e||!i||(!t&&ws(Zo())&&(t=Zo()),di(e),t&&(zi(t),i.setAttribute("data-button-to-replace",t.className),e.insertBefore(i,t)),kt([n,e],ce.loading))},yee=(n,t)=>{t.input==="select"||t.input==="radio"?xee(n,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(RP(t.inputValue)||LP(t.inputValue))&&(dm(Zo()),Aee(n,t))},_ee=(n,t)=>{const e=n.getInput();if(!e)return null;switch(t.input){case"checkbox":return Eee(e);case"radio":return See(e);case"file":return Tee(e);default:return t.inputAutoTrim?e.value.trim():e.value}},Eee=n=>n.checked?1:0,See=n=>n.checked?n.value:null,Tee=n=>n.files&&n.files.length?n.getAttribute("multiple")!==null?n.files:n.files[0]:null,xee=(n,t)=>{const e=Ft();if(!e)return;const i=s=>{t.input==="select"?Cee(e,bE(s),t):t.input==="radio"&&kee(e,bE(s),t)};RP(t.inputOptions)||LP(t.inputOptions)?(dm(Zo()),yy(t.inputOptions).then(s=>{n.hideLoading(),i(s)})):typeof t.inputOptions=="object"?i(t.inputOptions):yh(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`)},Aee=(n,t)=>{const e=n.getInput();e&&(zi(e),yy(t.inputValue).then(i=>{e.value=t.input==="number"?`${parseFloat(i)||0}`:`${i}`,di(e),e.focus(),n.hideLoading()}).catch(i=>{yh(`Error in inputValue promise: ${i}`),e.value="",di(e),e.focus(),n.hideLoading()}))};function Cee(n,t,e){const i=xc(n,ce.select);if(!i)return;const s=(r,o,a)=>{const l=document.createElement("option");l.value=a,Zs(l,o),l.selected=cH(a,e.inputValue),r.appendChild(l)};t.forEach(r=>{const o=r[0],a=r[1];if(Array.isArray(a)){const l=document.createElement("optgroup");l.label=o,l.disabled=!1,i.appendChild(l),a.forEach(c=>s(l,c[1],c[0]))}else s(i,a,o)}),i.focus()}function kee(n,t,e){const i=xc(n,ce.radio);if(!i)return;t.forEach(r=>{const o=r[0],a=r[1],l=document.createElement("input"),c=document.createElement("label");l.type="radio",l.name=ce.radio,l.value=o,cH(o,e.inputValue)&&(l.checked=!0);const u=document.createElement("span");Zs(u,a),u.className=ce.label,c.appendChild(l),c.appendChild(u),i.appendChild(c)});const s=i.querySelectorAll("input");s.length&&s[0].focus()}const bE=n=>{const t=[];return n instanceof Map?n.forEach((e,i)=>{let s=e;typeof s=="object"&&(s=bE(s)),t.push([i,s])}):Object.keys(n).forEach(e=>{let i=n[e];typeof i=="object"&&(i=bE(i)),t.push([e,i])}),t},cH=(n,t)=>!!t&&t.toString()===n.toString(),Iee=n=>{const t=nn.innerParams.get(n);n.disableButtons(),t.input?uH(n,"confirm"):YP(n,!0)},Pee=n=>{const t=nn.innerParams.get(n);n.disableButtons(),t.returnInputValueOnDeny?uH(n,"deny"):GP(n,!1)},Mee=(n,t)=>{n.disableButtons(),t(Om.cancel)},uH=(n,t)=>{const e=nn.innerParams.get(n);if(!e.input){yh(`The "input" parameter is needed to be set when using returnInputValueOn${DP(t)}
98`);return}const i=n.getInput(),s=_ee(n,e);e.inputValidator?Oee(n,s,t):i&&!i.checkValidity()?(n.enableButtons(),n.showValidationMessage(e.validationMessage||i.validationMessage)):t==="deny"?GP(n,s):YP(n,s)},Oee=(n,t,e)=>{const i=nn.innerParams.get(n);n.disableInput(),Promise.resolve().then(()=>yy(i.inputValidator(t,i.validationMessage))).then(r=>{n.enableButtons(),n.enableInput(),r?n.showValidationMessage(r):e==="deny"?GP(n,t):YP(n,t)})},GP=(n,t)=>{const e=nn.innerParams.get(n||void 0);e.showLoaderOnDeny&&dm(_h()),e.preDeny?(n.isAwaitingPromise=!0,Promise.resolve().then(()=>yy(e.preDeny(t,e.validationMessage))).then(s=>{s===!1?(n.hideLoading(),xy(n)):n.close({isDenied:!0,value:typeof s>"u"?t:s})}).catch(s=>dH(n||void 0,s))):n.close({isDenied:!0,value:t})},ZR=(n,t)=>{n.close({isConfirmed:!0,value:t})},dH=(n,t)=>{n.rejectPromise(t)},YP=(n,t)=>{const e=nn.innerParams.get(n||void 0);e.showLoaderOnConfirm&&dm(),e.preConfirm?(n.resetValidationMessage(),n.isAwaitingPromise=!0,Promise.resolve().then(()=>yy(e.preConfirm(t,e.validationMessage))).then(s=>{ws(wT())||s===!1?(n.hideLoading(),xy(n)):ZR(n,typeof s>"u"?t:s)}).catch(s=>dH(n||void 0,s))):ZR(n,t)};function wE(){const n=nn.innerParams.get(this);if(!n)return;const t=nn.domCache.get(this);zi(t.loader),yT()?n.icon&&di(Im()):Dee(t),_r([t.popup,t.actions],ce.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Dee=n=>{const t=n.popup.getElementsByClassName(n.loader.getAttribute("data-button-to-replace"));t.length?di(t[0],"inline-block"):oQ()&&zi(n.actions)};function hH(){const n=nn.innerParams.get(this),t=nn.domCache.get(this);return t?_T(t.popup,n.input):null}function fH(n,t,e){const i=nn.domCache.get(n);t.forEach(s=>{i[s].disabled=e})}function gH(n,t){const e=Ft();if(!(!e||!n))if(n.type==="radio"){const i=e.querySelectorAll(`[name="${ce.radio}"]`);for(let s=0;s<i.length;s++)i[s].disabled=t}else n.disabled=t}function mH(){fH(this,["confirmButton","denyButton","cancelButton"],!1)}function pH(){fH(this,["confirmButton","denyButton","cancelButton"],!0)}function bH(){gH(this.getInput(),!1)}function wH(){gH(this.getInput(),!0)}function vH(n){const t=nn.domCache.get(this),e=nn.innerParams.get(this);Zs(t.validationMessage,n),t.validationMessage.className=ce["validation-message"],e.customClass&&e.customClass.validationMessage&&kt(t.validationMessage,e.customClass.validationMessage),di(t.validationMessage);const i=this.getInput();i&&(i.setAttribute("aria-invalid","true"),i.setAttribute("aria-describedby",ce["validation-message"]),GV(i),kt(i,ce.inputerror))}function yH(){const n=nn.domCache.get(this);n.validationMessage&&zi(n.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),_r(t,ce.inputerror))}const Sf={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose
98:void 0,didDestroy:void 0,scrollbarPadding:!0},Ree=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Lee={allowEnterKey:void 0},Fee=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],_H=n=>Object.prototype.hasOwnProperty.call(Sf,n),EH=n=>Ree.indexOf(n)!==-1,SH=n=>Lee[n],Nee=n=>{_H(n)||Es(`Unknown parameter "${n}"`)},Bee=n=>{Fee.includes(n)&&Es(`The parameter "${n}" is incompatible with toasts`)},Vee=n=>{const t=SH(n);t&&$V(n,t)},Hee=n=>{n.backdrop===!1&&n.allowOutsideClick&&Es('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in n)Nee(t),n.toast&&Bee(t),Vee(t)};function TH(n){const t=Ft(),e=nn.innerParams.get(this);if(!t||ll(t,e.hideClass.popup)){Es("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");return}const i=zee(n),s=Object.assign({},e,i);tH(this,s),nn.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,n),writable:!1,enumerable:!0}})}const zee=n=>{const t={};return Object.keys(n).forEach(e=>{EH(e)?t[e]=n[e]:Es(`Invalid parameter to update: ${e}`)}),t};function xH(){const n=nn.domCache.get(this),t=nn.innerParams.get(this);if(!t){AH(this);return}n.popup&&Xe.swalCloseEventFinishedCallback&&(Xe.swalCloseEventFinishedCallback(),delete Xe.swalCloseEventFinishedCallback),typeof t.didDestroy=="function"&&t.didDestroy(),Xe.eventEmitter.emit("didDestroy"),$ee(this)}const $ee=n=>{AH(n),delete n.params,delete Xe.keydownHandler,delete Xe.keydownTarget,delete Xe.currentInstance},AH=n=>{n.isAwaitingPromise?(jx(nn,n),n.isAwaitingPromise=!0):(jx(um,n),jx(nn,n),delete n.isAwaitingPromise,delete n.disableButtons,delete n.enableButtons,delete n.getInput,delete n.disableInput,delete n.enableInput,delete n.hideLoading,delete n.disableLoading,delete n.showValidationMessage,delete n.resetValidationMessage,delete n.close,delete n.closePopup,delete n.closeModal,delete n.closeToast,delete n.rejectPromise,delete n.update,delete n._destroy)},jx=(n,t)=>{for(const e in n)n[e].delete(t)};var Wee=Object.freeze({__proto__:null,_destroy:xH,close:Ac,closeModal:Ac,closePopup:Ac,closeToast:Ac,disableButtons:pH,disableInput:wH,disableLoading:wE,enableButtons:mH,enableInput:bH,getInput:hH,handleAwaitingPromise:xy,hideLoading:wE,rejectPromise:lH,resetValidationMessage:yH,showValidationMessage:vH,update:TH});const Uee=(n,t,e)=>{n.toast?jee(n,t,e):(Yee(t),qee(t),Kee(n,t,e))},jee=(n,t,e)=>{t.popup.onclick=()=>{n&&(Gee(n)||n.timer||n.input)||e(Om.close)}},Gee=n=>!!(n.showConfirmButton||n.showDenyButton||n.showCancelButton||n.showCloseButton);let vE=!1;const Yee=n=>{n.popup.onmousedown=()=>{n.container.onmouseup=function(t){n.container.onmouseup=()=>{},t.target===n.container&&(vE=!0)}}},qee=n=>{n.container.onmousedown=t=>{t.target===n.container&&t.preventDefault(),n.popup.onmouseup=function(e){n.popup.onmouseup=()=>{},(e.target===n.popup||e.target instanceof HTMLElement&&n.popup.contains(e.target))&&(vE=!0)}}},Kee=(n,t,e)=>{t.container.onclick=i=>{if(vE){vE=!1;return}i.target===t.container&&bT(n.allowOutsideClick)&&e(Om.backdrop)}},Xee=n=>typeof n=="object"&&n.jquery,QR=n=>n instanceof Element||Xee(n),Jee=n=>{const t={};return typeof n[0]=="object"&&!QR(n[0])?Object.assign(t,n[0]):["title","html","icon"].forEach((e,i)=>{const s=n[i];typeof s=="string"||QR(s)?t[e]=s:s!==void 0&&yh(`Unexpected type of ${e}! Expected "string" or "Element", got ${typeof s}`)}),t};function Zee(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return new this(...t)}function Qee(n){class t extends this{_main(i,s){return super._main(i,Object.assign({},n,s))}}return t}const ete=()=>Xe.timeout&&Xe.timeout.getTimerLeft(),CH=()=>
98{if(Xe.timeout)return aQ(),Xe.timeout.stop()},kH=()=>{if(Xe.timeout){const n=Xe.timeout.start();return $P(n),n}},tte=()=>{const n=Xe.timeout;return n&&(n.running?CH():kH())},nte=n=>{if(Xe.timeout){const t=Xe.timeout.increase(n);return $P(t,!0),t}},ite=()=>!!(Xe.timeout&&Xe.timeout.isRunning());let e2=!1;const wC={};function ste(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";wC[n]=this,e2||(document.body.addEventListener("click",rte),e2=!0)}const rte=n=>{for(let t=n.target;t&&t!==document;t=t.parentNode)for(const e in wC){const i=t.getAttribute(e);if(i){wC[e].fire({template:i});return}}};class ote{constructor(){this.events={}}_getHandlersByEventName(t){return typeof this.events[t]>"u"&&(this.events[t]=[]),this.events[t]}on(t,e){const i=this._getHandlersByEventName(t);i.includes(e)||i.push(e)}once(t,e){var i=this;const s=function(){i.removeListener(t,s);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];e.apply(i,o)};this.on(t,s)}emit(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];this._getHandlersByEventName(t).forEach(r=>{try{r.apply(this,i)}catch(o){console.error(o)}})}removeListener(t,e){const i=this._getHandlersByEventName(t),s=i.indexOf(e);s>-1&&i.splice(s,1)}removeAllListeners(t){this.events[t]!==void 0&&(this.events[t].length=0)}reset(){this.events={}}}Xe.eventEmitter=new ote;const ate=(n,t)=>{Xe.eventEmitter.on(n,t)},lte=(n,t)=>{Xe.eventEmitter.once(n,t)},cte=(n,t)=>{if(!n){Xe.eventEmitter.reset();return}t?Xe.eventEmitter.removeListener(n,t):Xe.eventEmitter.removeAllListeners(n)};var ute=Object.freeze({__proto__:null,argsToParams:Jee,bindClickHandler:ste,clickCancel:XQ,clickConfirm:nH,clickDeny:KQ,enableLoading:dm,fire:Zee,getActions:Ey,getCancelButton:Pm,getCloseButton:BP,getConfirmButton:Zo,getContainer:Ss,getDenyButton:_h,getFocusableElements:VP,getFooter:jV,getHtmlContainer:FP,getIcon:Im,getIconContent:tQ,getImage:UV,getInputLabel:nQ,getLoader:Mm,getPopup:Ft,getProgressSteps:NP,getTimerLeft:ete,getTimerProgressBar:vT,getTitle:WV,getValidationMessage:wT,increaseTimer:nte,isDeprecatedParameter:SH,isLoading:sQ,isTimerRunning:ite,isUpdatableParameter:EH,isValidParameter:_H,isVisible:qQ,mixin:Qee,off:cte,on:ate,once:lte,resumeTimer:kH,showLoading:dm,stopTimer:CH,toggleTimer:tte});class dte{constructor(t,e){this.callback=t,this.remaining=e,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(t){const e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const IH=["swal-title","swal-html","swal-footer"],hte=n=>{const t=typeof n.template=="string"?document.querySelector(n.template):n.template;if(!t)return{};const e=t.content;return yte(e),Object.assign(fte(e),gte(e),mte(e),pte(e),bte(e),wte(e),vte(e,IH))},fte=n=>{const t={};return Array.from(n.querySelectorAll("swal-param")).forEach(i=>{dh(i,["name","value"]);const s=i.getAttribute("name"),r=i.getAttribute("value");!s||!r||(typeof Sf[s]=="boolean"?t[s]=r!=="false":typeof Sf[s]=="object"?t[s]=JSON.parse(r):t[s]=r)}),t},gte=n=>{const t={};return Array.from(n.querySelectorAll("swal-function-param")).forEach(i=>{const s=i.getAttribute("name"),r=i.getAttribute("value");!s||!r||(t[s]=new Function(`return ${r}`)())}),t},mte=n=>{const t={};return Array.from(n.querySelectorAll("swal-button")).forEach(i=>{dh(i,["type","color","aria-label"]);const s=i.getAttribute("type");!s||!["confirm","cancel","deny"].includes(s)||(t[`${s}ButtonText`]=i.innerHTML,t[`show${DP(s)}Button`]=!0,i.hasAttribute("color")&&(t[`${s}ButtonColor`]=i.getAttribute("color")),i.hasAttribute("aria-label")&&(t[`${s}ButtonAriaLabel`]=i.getAttribute("aria-label")))}),t},pte=n=>{const t={},e=n.querySelector("swal-image");return e&&(dh(e,["src","width","height","alt"]),e.hasAttribute("src")&&(t.imageUrl=e.getAttribute("src")||void 0),e.hasAttribute("width")&&(t.imageWidth=e.getAttribute("width")||void 0),e.hasAttribute("height")&&(t.imageHeight=e.getAttribute("height")||void 0),e.hasAttribute("alt")&&(t.imageAlt=e.getAttribute("alt")||void 0)),t},bte=n=>{const t={},e=n.querySelector("swal-icon");return e&&(dh(e,["type","color"]),e.hasAttribute("type")&&(t.icon=e.getAttribute("type")),e.hasAttribute("color")&&(t.iconColor=e.getAttribute("color")),t.iconHtml=e.innerHTML),t},wte=n=>{const t={},e=n.querySelector("swal-input");e&&(dh(e,["type","label","placeholder","value"]),t.input=e.getAttribute("type")||"text",e.hasAttribute("label")&&(t.inputLabel=e.getAttribute("label")),e.hasAttribute("placeholder")&&(t.inputPlaceholder=e.getAttribute("placeholder")),e.hasAttribute("value")&&(t.inputValue=e.getAttribute("value")));const i=Array.from(n.querySelectorAll("swal-input-option"));return i.length&&(t.inputOptions={}
98,i.forEach(s=>{dh(s,["value"]);const r=s.getAttribute("value");if(!r)return;const o=s.innerHTML;t.inputOptions[r]=o})),t},vte=(n,t)=>{const e={};for(const i in t){const s=t[i],r=n.querySelector(s);r&&(dh(r,[]),e[s.replace(/^swal-/,"")]=r.innerHTML.trim())}return e},yte=n=>{const t=IH.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(n.children).forEach(e=>{const i=e.tagName.toLowerCase();t.includes(i)||Es(`Unrecognized element <${i}>`)})},dh=(n,t)=>{Array.from(n.attributes).forEach(e=>{t.indexOf(e.name)===-1&&Es([`Unrecognized attribute "${e.name}" on <${n.tagName.toLowerCase()}>.`,`${t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."}`])})},PH=10,_te=n=>{const t=Ss(),e=Ft();typeof n.willOpen=="function"&&n.willOpen(e),Xe.eventEmitter.emit("willOpen",e);const s=window.getComputedStyle(document.body).overflowY;Tte(t,e,n),setTimeout(()=>{Ete(t,e)},PH),HP()&&(Ste(t,n.scrollbarPadding,s),see()),!yT()&&!Xe.previousActiveElement&&(Xe.previousActiveElement=document.activeElement),typeof n.didOpen=="function"&&setTimeout(()=>n.didOpen(e)),Xe.eventEmitter.emit("didOpen",e),_r(t,ce["no-transition"])},yE=n=>{const t=Ft();if(n.target!==t)return;const e=Ss();t.removeEventListener("animationend",yE),t.removeEventListener("transitionend",yE),e.style.overflowY="auto"},Ete=(n,t)=>{qV(t)?(n.style.overflowY="hidden",t.addEventListener("animationend",yE),t.addEventListener("transitionend",yE)):n.style.overflowY="auto"},Ste=(n,t,e)=>{ree(),t&&e!=="hidden"&&hee(e),setTimeout(()=>{n.scrollTop=0})},Tte=(n,t,e)=>{kt(n,e.showClass.backdrop),e.animation?(t.style.setProperty("opacity","0","important"),di(t,"grid"),setTimeout(()=>{kt(t,e.showClass.popup),t.style.removeProperty("opacity")},PH)):di(t,"grid"),kt([document.documentElement,document.body],ce.shown),e.heightAuto&&e.backdrop&&!e.toast&&kt([document.documentElement,document.body],ce["height-auto"])};var t2={email:(n,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(n)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(n,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(n)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function xte(n){n.inputValidator||(n.input==="email"&&(n.inputValidator=t2.email),n.input==="url"&&(n.inputValidator=t2.url))}function Ate(n){(!n.target||typeof n.target=="string"&&!document.querySelector(n.target)||typeof n.target!="string"&&!n.target.appendChild)&&(Es('Target parameter is not valid, defaulting to "body"'),n.target="body")}function Cte(n){xte(n),n.showLoaderOnConfirm&&!n.preConfirm&&Es(`showLoaderOnConfirm is set to true, but preConfirm is not defined. 99showLoaderOnConfirm should be used together with preConfirm, see usage example: 100https://sweetalert2.github.io/#ajax-request`),Ate(n),typeof n.title=="string"&&(n.title=n.title.split(` 101`).join("<br />")),mQ(n)}let xo;var g_=new WeakMap;class Bn{constructor(){if(YZ(this,g_,void 0),typeof window>"u")return;xo=this;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];const s=Object.freeze(this.constructor.argsToParams(e));this.params=s,this.isAwaitingPromise=!1,qZ(g_,this,this._main(xo.params))}_main(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Hee(Object.assign({},e,t)),Xe.currentInstance){const r=um.swalPromiseResolve.get(Xe.currentInstance),{isAwaitingPromise:o}=Xe.currentInstance;Xe.currentInstance._destroy(),o||r({isDismissed:!0}),HP()&&rH()}Xe.currentInstance=xo;const i=Ite(t,e);Cte(i),Object.freeze(i),Xe.timeout&&(Xe.timeout.stop(),delete Xe.timeout),clearTimeout(Xe.restoreFocusTimeout);const s=Pte(xo);return tH(xo,i),nn.innerParams.set(xo,i),kte(xo,s,i)}then(t){return UR(g_,this).then(t)}finally(t){return UR(g_,this).finally(t)}}const kte=(n,t,e)=>new Promise((i,s)=>{const r=o=>{n.close({isDismissed:!0,dismiss:o})};um.swalPromiseResolve.set(n,i),um.swalPromiseReject.set(n,s),t.confirmButton.onclick=()=>{Iee(n)},t.denyButton.onclick=()=>{Pee(n)},t.cancelButton.onclick=()=>{Mee(n,r)},t.closeButton.onclick=()=>{r(Om.close)},Uee(e,t,r),JQ(Xe,e,r),yee(n,e),_te(e),Mte(Xe,e,r),Ote(t,e),setTimeout(()=>{t.container.scrollTop=0})}),Ite=(n,t)=>{const e=hte(n),i=Object.assign({},Sf,t,e,n);return i.showClass=Object.assign({},Sf.showClass,i.showClass),i.hideClass=Object.assign({},Sf.hideClass,i.hideClass),i.animation===!1&&(i.showClass={backdrop:"swal2-noanimation"},i.hideClass={}),i},Pte=n=>{const t={popup:Ft(),container:Ss(),actions:Ey(),confirmButton:Zo(),denyButton:_h(),cancelButton:Pm(),loader:Mm(),closeButton:BP(),validationMessage:wT(),progressSteps:NP()};return nn.domCache.set(n,t),t},Mte=(n,t,e)=>{const i=vT();zi(i),t.timer&&(n.timeout=new dte(()=>{e("timer"),delete n.timeout},t.timer),t.timerProgressBar&&(di(i),Ys(i,t,"timerProgressBar"),setTimeout(()=>{n.timeout&&n.timeout.running&&$P(t.timer)})))},Ote=(n,t)=>{if(!t.toast){if(!bT(t.allowEnterKey)){$V("allowEnterKey"),Lte();return}Dte(n)||Rte(n,t)||bC(-1,1)}},Dte=n=>{const t=Array.from(n.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&ws(e))return e.focus(),!0;return!1},Rte=(n,t)=>t.focusDeny&&ws(n.denyButton)?(n.denyButton.focus(),!0):t.focusCancel&&ws(n.cancelButton)?(n.cancelButton.focus(),!0):t.focusConfirm&&ws(n.confirmButton)?(n.confirmButton.focus(),!0):!1,Lte=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};if(typeof window<"u"&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){const n=new Date,t=localStorage.getItem("swal-initiation");t?(n.getTime()-Date.parse(t))/(1e3*60*60*24)>3&&setTimeout(()=>{document.body.style.pointerEvents="none";const e=document.createElement("audio");e.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",e.loop=!0,document.body.appendChild(e),setTimeout(()=>{e.play().catch(()=>{})},2500)},500):localStorage.setItem("swal-initiation",`${n}`)}Bn.prototype.disableButtons=pH;Bn.prototype.enableButtons=mH;Bn.prototype.getInput=hH;Bn.prototype.disableInput=wH;Bn.prototype.enableInput=bH;Bn.prototype.hideLoading=wE;Bn.prototype.disableLoading=wE;Bn.prototype.showValidationMessage=vH;Bn.prototype.resetValidationMessage=yH;Bn.prototype.close=Ac;Bn.prototype.closePopup=Ac;Bn.prototype.closeModal=Ac;Bn.prototype.closeToast=Ac;Bn.prototype.rejectPromise=lH;Bn.prototype.update=TH;Bn.prototype._destroy=xH;Object.assign(Bn,ute);Object.keys(Wee).forEach(n=>{Bn[n]=function(){return xo&&xo[n]?xo[n](...arguments):null}});Bn.DismissReason=Om;Bn.version="11.15.9";const Cc=Bn;Cc.default=Cc;typeof document<"u"&&function(n,t){var e=n.createElement("style");if(n.getElementsByTagName("head")[0].appendChild(e),e.styleSheet)e.styleSheet.disabled||(e.styleSheet.cssText=t);else try{e.innerHTML=t}catch{e.innerText=t}}(document,'body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;
101align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:hsl(0,0%,33%);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):focus-visible{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):focus-visible{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):focus-visible{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus-visible{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:1em 1.6em .3em;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid hsl(0,0%,85%);border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:hsl(0,0%,94%);color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:rgb(249.95234375,205.965625,167.74765625);color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:rgb(156.7033492823,224.2822966507,246.2966507177);color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:rgb(200.8064516129,217.9677419355,225.1935483871);color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;
101left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff
vendor: 5,421 bytes, line 101
101;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}
101');/*! 102 * FilePond 4.32.6 103 * Licensed under MIT, https://opensource.org/licenses/MIT/ 104 * Please visit https://pqina.nl/filepond/ for details. 105 */const Fte=n=>n instanceof HTMLElement,Nte=(n,t=[],e=[])=>{const i={...n},s=[],r=[],o=()=>({...i}),a=()=>{const p=[...s];return s.length=0,p},l=()=>{const p=[...r];r.length=0,p.forEach(({type:v,data:E})=>{c(v,E)})},c=(p,v,E)=>{if(E&&!document.hidden){r.push({type:p,data:v});return}f[p]&&f[p](v),s.push({type:p,data:v})},u=(p,...v)=>h[p]?h[p](...v):null,d={getState:o,processActionQueue:a,processDispatchQueue:l,dispatch:c,query:u};let h={};t.forEach(p=>{h={...p(i),...h}});let f={};return e.forEach(p=>{f={...p(c,u,i),...f}}),d},Bte=(n,t,e)=>{if(typeof e=="function"){n[t]=e;return}Object.defineProperty(n,t,{...e})},xn=(n,t)=>{for(const e in n)n.hasOwnProperty(e)&&t(e,n[e])},Mc=n=>{const t={};return xn(n,e=>{Bte(t,e,n[e])}),t},Zn=(n,t,e=null)=>{if(e===null)return n.getAttribute(t)||n.hasAttribute(t);n.setAttribute(t,e)},Vte="http://www.w3.org/2000/svg",Hte=["svg","path"],n2=n=>Hte.includes(n),_E=(n,t,e={})=>{typeof t=="object"&&(e=t,t=null);const i=n2(n)?document.createElementNS(Vte,n):document.createElement(n);return t&&(n2(n)?Zn(i,"class",t):i.className=t),xn(e,(s,r)=>{Zn(i,s,r)}),i},zte=n=>(t,e)=>{typeof e<"u"&&n.children[e]?n.insertBefore(t,n.children[e]):n.appendChild(t)},$te=(n,t)=>(e,i)=>(typeof i<"u"?t.splice(i,0,e):t.push(e),e),Wte=(n,t)=>e=>(t.splice(t.indexOf(e),1),e.element.parentNode&&n.removeChild(e.element),e),Ute=(()=>typeof window<"u"&&typeof window.document<"u")(),MH=()=>Ute,jte=MH()?_E("svg"):{},Gte="children"in jte?n=>n.children.length:n=>n.childNodes.length,OH=(n,t,e,i)=>{const s=e[0]||n.left,r=e[1]||n.top,o=s+n.width,a=r+n.height*(i[1]||1),l={element:{...n},inner:{left:n.left,top:n.top,right:n.right,bottom:n.bottom},outer:{left:s,top:r,right:o,bottom:a}};return t.filter(c=>!c.isRectIgnored()).map(c=>c.rect).forEach(c=>{i2(l.inner,{...c.inner}),i2(l.outer,{...c.outer})}),s2(l.inner),l.outer.bottom+=l.element.marginBottom,l.outer.right+=l.element.marginRight,s2(l.outer),l},i2=(n,t)=>{t.top+=n.top,t.right+=n.left,t.bottom+=n.top,t.left+=n.left,t.bottom>n.bottom&&(n.bottom=t.bottom),t.right>n.right&&(n.right=t.right)},s2=n=>{n.width=n.right-n.left,n.height=n.bottom-n.top},Pu=n=>typeof n=="number",Yte=(n,t,e,i=.001)=>Math.abs(n-t)<i&&Math.abs(e)<i,qte=({stiffness:n=.5,damping:t=.75,mass:e=10}={})=>{let i=null,s=null,r=0,o=!1;const c=Mc({interpolate:(u,d)=>{if(o)return;if(!(Pu(i)&&Pu(s))){o=!0,r=0;return}const h=-(s-i)*n;r+=h/e,s+=r,r*=t,Yte(s,i,r)||d?(s=i,r=0,o=!0,c.onupdate(s),c.oncomplete(s)):c.onupdate(s)},target:{set:u=>{if(Pu(u)&&!Pu(s)&&(s=u),i===null&&(i=u,s=u),i=u,s===i||typeof i>"u"){o=!0,r=0,c.onupdate(s),c.oncomplete(s);return}o=!1},get:()=>i},resting:{get:()=>o},onupdate:u=>{},oncomplete:u=>{}});return c},Kte=n=>n<.5?2*n*n:-1+(4-2*n)*n,Xte=({duration:n=500,easing:t=Kte,delay:e=0}={})=>{let i=null,s,r,o=!0,a=!1,l=null;const u=Mc({interpolate:(d,h)=>{o||l===null||(i===null&&(i=d),!(d-i<e)&&(s=d-i-e,s>=n||h?(s=1,r=a?0:1,u.onupdate(r*l),u.oncomplete(r*l),o=!0):(r=s/n,u.onupdate((s>=0?t(a?1-r:r):0)*l))))},target:{get:()=>a?0:l,set:d=>{if(l===null){l=d,u.onupdate(d),u.oncomplete(d);return}d<l?(l=1,a=!0):(a=!1,l=d),o=!1,i=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return u},r2={spring:qte,tween:Xte},Jte=(n,t,e)=>{const i=n[t]&&typeof n[t][e]=="object"?n[t][e]:n[t]||n,s=typeof i=="string"?i:i.type,r=typeof i=="object"?{...i}:{};return r2[s]?r2[s](r):null},qP=(n,t,e,i=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(s=>
105{n.forEach(r=>{let o=r,a=()=>e[r],l=c=>e[r]=c;typeof r=="object"&&(o=r.key,a=r.getter||a,l=r.setter||l),!(s[o]&&!i)&&(s[o]={get:a,set:l})})})},Zte=({mixinConfig:n,viewProps:t,viewInternalAPI:e,viewExternalAPI:i})=>{const s={...t},r=[];return xn(n,(o,a)=>{const l=Jte(a);if(!l)return;l.onupdate=u=>{t[o]=u},l.target=s[o],qP([{key:o,setter:u=>{l.target!==u&&(l.target=u)},getter:()=>t[o]}],[e,i],t,!0),r.push(l)}),{write:o=>{let a=document.hidden,l=!0;return r.forEach(c=>{c.resting||(l=!1),c.interpolate(o,a)}),l},destroy:()=>{}}},Qte=n=>(t,e)=>{n.addEventListener(t,e)},ene=n=>(t,e)=>{n.removeEventListener(t,e)},tne=({mixinConfig:n,viewProps:t,viewInternalAPI:e,viewExternalAPI:i,viewState:s,view:r})=>{const o=[],a=Qte(r.element),l=ene(r.element);return i.on=(c,u)=>{o.push({type:c,fn:u}),a(c,u)},i.off=(c,u)=>{o.splice(o.findIndex(d=>d.type===c&&d.fn===u),1),l(c,u)},{write:()=>!0,destroy:()=>{o.forEach(c=>{l(c.type,c.fn)})}}},nne=({mixinConfig:n,viewProps:t,viewExternalAPI:e})=>{qP(n,e,t)},Yi=n=>n!=null,ine={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},sne=({mixinConfig:n,viewProps:t,viewInternalAPI:e,viewExternalAPI:i,view:s})=>{const r={...t},o={};qP(n,[e,i],t);const a=()=>[t.translateX||0,t.translateY||0],l=()=>[t.scaleX||0,t.scaleY||0],c=()=>s.rect?OH(s.rect,s.childViews,a(),l()):null;return e.rect={get:c},i.rect={get:c},n.forEach(u=>{t[u]=typeof r[u]>"u"?ine[u]:r[u]}),{write:()=>{if(rne(o,t))return one(s.element,t),Object.assign(o,{...t}),!0},destroy:()=>{}}},rne=(n,t)=>{if(Object.keys(n).length!==Object.keys(t).length)return!0;for(const e in t)if(t[e]!==n[e])return!0;return!1},one=(n,{opacity:t,perspective:e,translateX:i,translateY:s,scaleX:r,scaleY:o,rotateX:a,rotateY:l,rotateZ:c,originX:u,originY:d,width:h,height:f})=>{let p="",v="";(Yi(u)||Yi(d))&&(v+=`transform-origin: ${u||0}px ${d||0}px;`),Yi(e)&&(p+=`perspective(${e}px) `),(Yi(i)||Yi(s))&&(p+=`translate3d(${i||0}px, ${s||0}px, 0) `),(Yi(r)||Yi(o))&&(p+=`scale3d(${Yi(r)?r:1}, ${Yi(o)?o:1}, 1) `),Yi(c)&&(p+=`rotateZ(${c}rad) `),Yi(a)&&(p+=`rotateX(${a}rad) `),Yi(l)&&(p+=`rotateY(${l}rad) `),p.length&&(v+=`transform:${p};`),Yi(t)&&(v+=`opacity:${t};`,t===0&&(v+="visibility:hidden;"),t<1&&(v+="pointer-events:none;")),Yi(f)&&(v+=`height:${f}px;`),Yi(h)&&(v+=`width:${h}px;`);const E=n.elementCurrentStyle||"";(v.length!==E.length||v!==E)&&(n.style.cssText=v,n.elementCurrentStyle=v)},ane={styles:sne,listeners:tne,animations:Zte,apis:nne},o2=(n={},t={},e={})=>(t.layoutCalculated||(n.paddingTop=parseInt(e.paddingTop,10)||0,n.marginTop=parseInt(e.marginTop,10)||0,n.marginRight=parseInt(e.marginRight,10)||0,n.marginBottom=parseInt(e.marginBottom,10)||0,n.marginLeft=parseInt(e.marginLeft,10)||0,t.layoutCalculated=!0),n.left=t.offsetLeft||0,n.top=t.offsetTop||0,n.width=t.offsetWidth||0,n.height=t.offsetHeight||0,n.right=n.left+n.width,n.bottom=n.top+n.height,n.scrollTop=t.scrollTop,n.hidden=t.offsetParent===null,n),Un=({tag:n="div",name:t=null,attributes:e={},read:i=()=>{},write:s=()=>{},create:r=()=>{},destroy:o=()=>{},filterFrameActionsForChild:a=(f,p)=>p,didCreateView:l=()=>{},didWriteView:c=()=>{},ignoreRect:u=!1,ignoreRectUpdate:d=!1,mixins:h=[]}={})=>(f,p={})=>{const v=_E(n,`filepond--${t}`,e),E=window.getComputedStyle(v,null),x=o2();let A=null,O=!1;const I=[],T=[],P={},k={},D=[s],U=[i],Y=[o],K=()=>v,j=()=>I.concat(),L=()=>P,N=he=>(ye,et)=>ye(he,et),m=()=>A||(A=OH(x,I,[0,0],[1,1]),A),_=()=>E,C=()=>{A=null,I.forEach(et=>et._read()),!(d&&x.width&&x.height)&&o2(x,v,E);const ye={root:ae,props:p,rect:x};U.forEach(et=>et(ye))},B=(he,ye,et)=>{let _e=ye.length===0;return D.forEach(gt=>{gt({props:p,root:ae,actions:ye,timestamp:he,shouldOptimize:et})===!1&&(_e=!1)}),T.forEach(gt=>{gt.write(he)===!1&&(_e=!1)}),I.filter(gt=>!!gt.element.parentNode).forEach(gt=>{gt._write(he,a(gt,ye),et)||(_e=!1)}),I.forEach((gt,$e)=>{gt.element.parentNode||(ae.appendChild(gt.element,$e),gt._read(),gt._write(he,a(gt,ye),et),_e=!1)}),O=_e,c({props:p,root:ae,actions:ye,timestamp:he}),_e},$=()=>{T.forEach(he=>he.destroy()),Y.forEach(he=>{he({root:ae,props:p})}),I.forEach(he=>he._destroy())},X={element:{get:K},style:{get:_},childViews:{get:j}},Z={...X,rect:{get:m},ref:{get:L},is:he=>t===he,appendChild:zte(v),createChildView:N(f),linkView:he=>(I.push(he),he),unlinkView:he=>{I.splice(I.indexOf(he),1)},appendChildView:$te(v,I),removeChildView:Wte(v,I),registerWriter:he=>D.push(he),registerReader:he=>U.push(he),registerDestroyer:he=>Y.push(he),invalidateLayout:()=>v.layoutCalculated=!1,dispatch:f.dispatch,query:f.query},ie={element:{get:K},childViews:{get:j},rect:{get:m},resting:{get:()=>O},isRectIgnored:()=>u,_read:C,_write:B,_destroy:$},fe={...X,rect:{get:()=>x}};Object.keys(h).sort((he,ye)=>
105he==="styles"?1:ye==="styles"?-1:0).forEach(he=>{const ye=ane[he]({mixinConfig:h[he],viewProps:p,viewState:k,viewInternalAPI:Z,viewExternalAPI:ie,view:Mc(fe)});ye&&T.push(ye)});const ae=Mc(Z);r({root:ae,props:p});const ge=Gte(v);return I.forEach((he,ye)=>{ae.appendChild(he.element,ge+ye)}),l(ae),Mc(ie)},lne=(n,t,e=60)=>{const i="__framePainter";if(window[i]){window[i].readers.push(n),window[i].writers.push(t);return}window[i]={readers:[n],writers:[t]};const s=window[i],r=1e3/e;let o=null,a=null,l=null,c=null;const u=()=>{document.hidden?(l=()=>window.setTimeout(()=>d(performance.now()),r),c=()=>window.clearTimeout(a)):(l=()=>window.requestAnimationFrame(d),c=()=>window.cancelAnimationFrame(a))};document.addEventListener("visibilitychange",()=>{c&&c(),u(),d(performance.now())});const d=h=>{a=l(d),o||(o=h);const f=h-o;f<=r||(o=h-f%r,s.readers.forEach(p=>p()),s.writers.forEach(p=>p(h)))};return u(),d(performance.now()),{pause:()=>{c(a)}}},ss=(n,t)=>({root:e,props:i,actions:s=[],timestamp:r,shouldOptimize:o})=>{s.filter(a=>n[a.type]).forEach(a=>n[a.type]({root:e,props:i,action:a.data,timestamp:r,shouldOptimize:o})),t&&t({root:e,props:i,actions:s,timestamp:r,shouldOptimize:o})},a2=(n,t)=>t.parentNode.insertBefore(n,t),l2=(n,t)=>t.parentNode.insertBefore(n,t.nextSibling),ET=n=>Array.isArray(n),gl=n=>n==null,cne=n=>n.trim(),ST=n=>""+n,une=(n,t=",")=>gl(n)?[]:ET(n)?n:ST(n).split(t).map(cne).filter(e=>e.length),DH=n=>typeof n=="boolean",RH=n=>DH(n)?n:n==="true",ns=n=>typeof n=="string",LH=n=>Pu(n)?n:ns(n)?ST(n).replace(/[a-z]+/gi,""):0,a0=n=>parseInt(LH(n),10),c2=n=>parseFloat(LH(n)),Dm=n=>Pu(n)&&isFinite(n)&&Math.floor(n)===n,u2=(n,t=1e3)=>{if(Dm(n))return n;let e=ST(n).trim();return/MB$/i.test(e)?(e=e.replace(/MB$i/,"").trim(),a0(e)*t*t):/KB/i.test(e)?(e=e.replace(/KB$i/,"").trim(),a0(e)*t):a0(e)},Mu=n=>typeof n=="function",dne=n=>{let t=self,e=n.split("."),i=null;for(;i=e.shift();)if(t=t[i],!t)return null;return t},d2={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},hne=n=>{const t={};return t.url=ns(n)?n:n.url||"",t.timeout=n.timeout?parseInt(n.timeout,10):0,t.headers=n.headers?n.headers:{},xn(d2,e=>{t[e]=fne(e,n[e],d2[e],t.timeout,t.headers)}),t.process=n.process||ns(n)||n.url?t.process:null,t.remove=n.remove||null,delete t.headers,t},fne=(n,t,e,i,s)=>{if(t===null)return null;if(typeof t=="function")return t;const r={url:e==="GET"||e==="PATCH"?`?${n}=`:"",method:e,headers:s,withCredentials:!1,timeout:i,onload:null,ondata:null,onerror:null};if(ns(t))return r.url=t,r;if(Object.assign(r,t),ns(r.headers)){const o=r.headers.split(/:(.+)/);r.headers={header:o[0],value:o[1]}}return r.withCredentials=RH(r.withCredentials),r},gne=n=>hne(n),mne=n=>n===null,ci=n=>typeof n=="object"&&n!==null,pne=n=>ci(n)&&ns(n.url)&&ci(n.process)&&ci(n.revert)&&ci(n.restore)&&ci(n.fetch),vC=n=>ET(n)?"array":mne(n)?"null":Dm(n)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(n)?"bytes":pne(n)?"api":typeof n,bne=n=>n.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'),wne={array:une,boolean:RH,int:n=>vC(n)==="bytes"?u2(n):a0(n),number:c2,float:c2,bytes:u2,string:n=>Mu(n)?n:ST(n),function:n=>dne(n),serverapi:gne,object:n=>{try{return JSON.parse(bne(n))}catch{return null}}},vne=(n,t)=>wne[t](n),FH=(n,t,e)=>{if(n===t)return n;let i=vC(n);if(i!==e){const s=vne(n,e);if(i=vC(s),s===null)throw`Trying to assign value with incorrect type to "${option}", allowed type: "${e}"`;n=s}return n},yne=(n,t)=>{let e=n;return{enumerable:!0,get:()=>e,set:i=>{e=FH(i,n,t)}}},_ne=n=>{const t={};return xn(n,e=>{const i=n[e];t[e]=yne(i[0],i[1])}),Mc(t)},Ene=n=>({items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:_ne(n)}),TT=(n,t="-")=>n.split(/(?=[A-Z])/).map(e=>e.toLowerCase()).join(t),Sne=(n,t)=>{const e={};return xn(t,i=>{e[i]={get:()=>n.getState().options[i],set:s=>{n.dispatch(`SET_${TT(i,"_").toUpperCase()}`,{value:s})}}}),e},Tne=n=>(t,e,i)=>{const s={};return xn(n,r=>{const o=TT(r,"_").toUpperCase();s[`SET_${o}`]=a=>{try{i.options[r]=a.value}catch{}t(`DID_SET_${o}`,{value:i.options[r]})}}),s},xne=n=>t=>{const e={};return xn(n,i=>{e[`GET_${TT(i,"_").toUpperCase()}`]=s=>t.options[i]}),e},yr={API:1,DROP:2,BROWSE:3,PASTE:4,NONE:5},KP=()=>Math.random().toString(36).substring(2,11),XP=(n,t)=>n.splice(t,1),Ane=(n,t)=>{t?n():document.hidden?Promise.resolve(1).then(n):setTimeout(n,0)},xT=()=>{const n=[],t=(i,s)=>{XP(n,n.findIndex(r=>r.event===i&&(r.cb===s||!s)))},e=(i,s,r)=>
105{n.filter(o=>o.event===i).map(o=>o.cb).forEach(o=>Ane(()=>o(...s),r))};return{fireSync:(i,...s)=>{e(i,s,!0)},fire:(i,...s)=>{e(i,s,!1)},on:(i,s)=>{n.push({event:i,cb:s})},onOnce:(i,s)=>{n.push({event:i,cb:(...r)=>{t(i,s),s(...r)}})},off:t}},NH=(n,t,e)=>{Object.getOwnPropertyNames(n).filter(i=>!e.includes(i)).forEach(i=>Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i)))},Cne=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],gs=n=>{const t={};return NH(n,t,Cne),t},kne=n=>{n.forEach((t,e)=>{t.released&&XP(n,e)})},st={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},Kn={INPUT:1,LIMBO:2,LOCAL:3},BH=n=>/[^0-9]+/.exec(n),VH=()=>BH(1.1.toLocaleString())[0],Ine=()=>{const n=VH(),t=1e3.toLocaleString(),e=1e3.toString();return t!==e?BH(t)[0]:n==="."?",":"."},pe={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},JP=[],Kr=(n,t,e)=>new Promise((i,s)=>{const r=JP.filter(a=>a.key===n).map(a=>a.cb);if(r.length===0){i(t);return}const o=r.shift();r.reduce((a,l)=>a.then(c=>l(c,e)),o(t,e)).then(a=>i(a)).catch(a=>s(a))}),Eh=(n,t,e)=>JP.filter(i=>i.key===n).map(i=>i.cb(t,e)),Pne=(n,t)=>JP.push({key:n,cb:t}),Mne=n=>Object.assign(cf,n),EE=()=>({...cf}),One=n=>{xn(n,(t,e)=>{cf[t]&&(cf[t][0]=FH(e,cf[t][0],cf[t][1]))})},cf={id:[null,pe.STRING],name:["filepond",pe.STRING],disabled:[!1,pe.BOOLEAN],className:[null,pe.STRING],required:[!1,pe.BOOLEAN],captureMethod:[null,pe.STRING],allowSyncAcceptAttribute:[!0,pe.BOOLEAN],allowDrop:[!0,pe.BOOLEAN],allowBrowse:[!0,pe.BOOLEAN],allowPaste:[!0,pe.BOOLEAN],allowMultiple:[!1,pe.BOOLEAN],allowReplace:[!0,pe.BOOLEAN],allowRevert:[!0,pe.BOOLEAN],allowRemove:[!0,pe.BOOLEAN],allowProcess:[!0,pe.BOOLEAN],allowReorder:[!1,pe.BOOLEAN],allowDirectoriesOnly:[!1,pe.BOOLEAN],storeAsFile:[!1,pe.BOOLEAN],forceRevert:[!1,pe.BOOLEAN],maxFiles:[null,pe.INT],checkValidity:[!1,pe.BOOLEAN],itemInsertLocationFreedom:[!0,pe.BOOLEAN],itemInsertLocation:["before",pe.STRING],itemInsertInterval:[75,pe.INT],dropOnPage:[!1,pe.BOOLEAN],dropOnElement:[!0,pe.BOOLEAN],dropValidation:[!1,pe.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],pe.ARRAY],instantUpload:[!0,pe.BOOLEAN],maxParallelUploads:[2,pe.INT],allowMinimumUploadDuration:[!0,pe.BOOLEAN],chunkUploads:[!1,pe.BOOLEAN],chunkForce:[!1,pe.BOOLEAN],chunkSize:[5e6,pe.INT],chunkRetryDelays:[[500,1e3,3e3],pe.ARRAY],server:[null,pe.SERVER_API],fileSizeBase:[1e3,pe.INT],labelFileSizeBytes:["bytes",pe.STRING],labelFileSizeKilobytes:["KB",pe.STRING],labelFileSizeMegabytes:["MB",pe.STRING],labelFileSizeGigabytes:["GB",pe.STRING],labelDecimalSeparator:[VH(),pe.STRING],labelThousandsSeparator:[Ine(),pe.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',pe.STRING],labelInvalidField:["Field contains invalid files",pe.STRING],labelFileWaitingForSize:["Waiting for size",pe.STRING],labelFileSizeNotAvailable:["Size not available",pe.STRING],labelFileCountSingular:["file in list",pe.STRING],labelFileCountPlural:["files in list",pe.STRING],labelFileLoading:["Loading",pe.STRING],labelFileAdded:["Added",pe.STRING],labelFileLoadError:["Error during load",pe.STRING],labelFileRemoved:["Removed",pe.STRING],labelFileRemoveError:["Error during remove",pe.STRING],labelFileProcessing:["
105Uploading",pe.STRING],labelFileProcessingComplete:["Upload complete",pe.STRING],labelFileProcessingAborted:["Upload cancelled",pe.STRING],labelFileProcessingError:["Error during upload",pe.STRING],labelFileProcessingRevertError:["Error during revert",pe.STRING],labelTapToCancel:["tap to cancel",pe.STRING],labelTapToRetry:["tap to retry",pe.STRING],labelTapToUndo:["tap to undo",pe.STRING],labelButtonRemoveItem:["Remove",pe.STRING],labelButtonAbortItemLoad:["Abort",pe.STRING],labelButtonRetryItemLoad:["Retry",pe.STRING],labelButtonAbortItemProcessing:["Cancel",pe.STRING],labelButtonUndoItemProcessing:["Undo",pe.STRING],labelButtonRetryItemProcessing:["Retry",pe.STRING],labelButtonProcessItem:["Upload",pe.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',pe.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',pe.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',pe.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',pe.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',pe.STRING],oninit:[null,pe.FUNCTION],onwarning:[null,pe.FUNCTION],onerror:[null,pe.FUNCTION],onactivatefile:[null,pe.FUNCTION],oninitfile:[null,pe.FUNCTION],onaddfilestart:[null,pe.FUNCTION],onaddfileprogress:[null,pe.FUNCTION],onaddfile:[null,pe.FUNCTION],onprocessfilestart:[null,pe.FUNCTION],onprocessfileprogress:[null,pe.FUNCTION],onprocessfileabort:[null,pe.FUNCTION],onprocessfilerevert:[null,pe.FUNCTION],onprocessfile:[null,pe.FUNCTION],onprocessfiles:[null,pe.FUNCTION],onremovefile:[null,pe.FUNCTION],onpreparefile:[null,pe.FUNCTION],onupdatefiles:[null,pe.FUNCTION],onreorderfiles:[null,pe.FUNCTION],beforeDropFile:[null,pe.FUNCTION],beforeAddFile:[null,pe.FUNCTION],beforeRemoveFile:[null,pe.FUNCTION],beforePrepareFile:[null,pe.FUNCTION],stylePanelLayout:[null,pe.STRING],stylePanelAspectRatio:[null,pe.STRING],styleItemPanelAspectRatio:[null,pe.STRING],styleButtonRemoveItemPosition:["left",pe.STRING],styleButtonProcessItemPosition:["right",pe.STRING],styleLoadIndicatorPosition:["right",pe.STRING],styleProgressIndicatorPosition:["right",pe.STRING],styleButtonRemoveItemAlign:[!1,pe.BOOLEAN],files:[[],pe.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],pe.ARRAY]},Ou=(n,t)=>gl(t)?n[0]||null:Dm(t)?n[t]||null:(typeof t=="object"&&(t=t.id),n.find(e=>e.id===t)||null),HH=n=>{if(gl(n))return n;if(/:/.test(n)){const t=n.split(":");return t[1]/t[0]}return parseFloat(n)},Jr=n=>n.filter(t=>!t.archived),zH={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4};let m_=null;const Dne=()=>{if(m_===null)try{const n=new DataTransfer;n.items.add(new File(["hello world"],"This_Works.txt"));const t=document.createElement("input");t.setAttribute("type","file"),t.files=n.files,m_=t.files.length===1}catch{m_=!1}return m_}
105,Rne=[st.LOAD_ERROR,st.PROCESSING_ERROR,st.PROCESSING_REVERT_ERROR],Lne=[st.LOADING,st.PROCESSING,st.PROCESSING_QUEUED,st.INIT],Fne=[st.PROCESSING_COMPLETE],Nne=n=>Rne.includes(n.status),Bne=n=>Lne.includes(n.status),Vne=n=>Fne.includes(n.status),h2=n=>ci(n.options.server)&&(ci(n.options.server.process)||Mu(n.options.server.process)),Hne=n=>({GET_STATUS:()=>{const t=Jr(n.items),{EMPTY:e,ERROR:i,BUSY:s,IDLE:r,READY:o}=zH;return t.length===0?e:t.some(Nne)?i:t.some(Bne)?s:t.some(Vne)?o:r},GET_ITEM:t=>Ou(n.items,t),GET_ACTIVE_ITEM:t=>Ou(Jr(n.items),t),GET_ACTIVE_ITEMS:()=>Jr(n.items),GET_ITEMS:()=>n.items,GET_ITEM_NAME:t=>{const e=Ou(n.items,t);return e?e.filename:null},GET_ITEM_SIZE:t=>{const e=Ou(n.items,t);return e?e.fileSize:null},GET_STYLES:()=>Object.keys(n.options).filter(t=>/^style/.test(t)).map(t=>({name:t,value:n.options[t]})),GET_PANEL_ASPECT_RATIO:()=>/circle/.test(n.options.stylePanelLayout)?1:HH(n.options.stylePanelAspectRatio),GET_ITEM_PANEL_ASPECT_RATIO:()=>n.options.styleItemPanelAspectRatio,GET_ITEMS_BY_STATUS:t=>Jr(n.items).filter(e=>e.status===t),GET_TOTAL_ITEMS:()=>Jr(n.items).length,SHOULD_UPDATE_FILE_INPUT:()=>n.options.storeAsFile&&Dne()&&!h2(n),IS_ASYNC:()=>h2(n),GET_FILE_SIZE_LABELS:t=>({labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0})}),zne=n=>{const t=Jr(n.items).length;if(!n.options.allowMultiple)return t===0;const e=n.options.maxFiles;return e===null||t<e},$H=(n,t,e)=>Math.max(Math.min(e,n),t),$ne=(n,t,e)=>n.splice(t,0,e),Wne=(n,t,e)=>gl(t)?null:typeof e>"u"?(n.push(t),t):(e=$H(e,0,n.length),$ne(n,e,t),t),yC=n=>/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(n),Ay=n=>`${n}`.split("/").pop().split("?").shift(),AT=n=>n.split(".").pop(),Une=n=>{if(typeof n!="string")return"";const t=n.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?t==="jpeg"?"jpg":t:""},sp=(n,t="")=>(t+n).slice(-t.length),WH=(n=new Date)=>`${n.getFullYear()}-${sp(n.getMonth()+1,"00")}-${sp(n.getDate(),"00")}_${sp(n.getHours(),"00")}-${sp(n.getMinutes(),"00")}-${sp(n.getSeconds(),"00")}`,hm=(n,t,e=null,i=null)=>{const s=typeof e=="string"?n.slice(0,n.size,e):n.slice(0,n.size,n.type);return s.lastModifiedDate=new Date,n._relativePath&&(s._relativePath=n._relativePath),ns(t)||(t=WH()),t&&i===null&&AT(t)?s.name=t:(i=i||Une(s.type),s.name=t+(i?"."+i:"")),s},jne=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,UH=(n,t)=>{const e=jne();if(e){const i=new e;return i.append(n),i.getBlob(t)}return new Blob([n],{type:t})},Gne=(n,t)=>{const e=new ArrayBuffer(n.length),i=new Uint8Array(e);for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s);return UH(e,t)},jH=n=>(/^data:(.+);/.exec(n)||[])[1]||null,Yne=n=>n.split(",")[1].replace(/\s/g,""),qne=n=>atob(Yne(n)),Kne=n=>{const t=jH(n),e=qne(n);return Gne(e,t)},Xne=(n,t,e)=>hm(Kne(n),t,null,e),Jne=n=>{if(!/^content-disposition:/i.test(n))return null;const t=n.split(/filename=|filename\*=.+''/).splice(1).map(e=>e.trim().replace(/^["']|[;"']{0,2}$/g,"")).filter(e=>e.length);return t.length?decodeURI(t[t.length-1]):null},Zne=n=>{if(/content-length:/i.test(n)){const t=n.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},Qne=n=>/x-content-transfer-id:/i.test(n)&&(n.split(":")[1]||"").trim()||null,ZP=n=>{const t={source:null,name:null,size:null},e=n.split(` 106`);for(let i of e){const s=Jne(i);if(s){t.name=s;continue}const r=Zne(i);if(r){t.size=r;continue}const o=Qne(i);if(o){t.source=o;continue}}return t},eie=n=>{const t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},e=()=>t.progress,i=()=>{t.request&&t.request.abort&&t.request.abort()},s=()=>{const a=t.source;o.fire("init",a),a instanceof File?o.fire("load",a):a instanceof Blob?o.fire("load",hm(a,a.name)):yC(a)?o.fire("load",Xne(a)):r(a)},r=a=>{if(!n){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=n(a,l=>{t.duration=Date.now()-t.timestamp,t.complete=!0,l instanceof Blob&&(l=hm(l,l.name||Ay(a))),o.fire("load",l instanceof Blob?l:l?l.body:null)},l=>{o.fire("error",typeof l=="string"?{type:"error",code:0,body:l}:l)},(l,c,u)=>{if(u&&(t.size=u),t.duration=Date.now()-t.timestamp,!l){t.progress=null;return}t.progress=c/u,o.fire("progress",t.progress)},()=>{o.fire("abort")},l=>{const c=ZP(typeof l=="string"?l:l.headers);o.fire("meta",{size:t.size||c.size,filename:c.name,source:c.source})})},o={...xT(),setSource:a=>t.source=a,getProgress:e,abort:i,load:s};return o},f2=n=>/GET|HEAD/.test(n),nh=(n,t,e)=>{const i={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{s=!0,o.abort()}};let s=!1,r=!1;e={method:"POST",headers:{},withCredentials:!1,...e},t=encodeURI(t),f2(e.method)&&n&&(t=`${t}${encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))}`);const o=new XMLHttpRequest,a=f2(e.method)?o:o.upload;return a.onprogress=l=>{s||i.onprogress(l.lengthComputable,l.loaded,l.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||r||(r=!0,i.onheaders(o))},o.onload=()=>{o.status>
106=200&&o.status<300?i.onload(o):i.onerror(o)},o.onerror=()=>i.onerror(o),o.onabort=()=>{s=!0,i.onabort()},o.ontimeout=()=>i.ontimeout(o),o.open(e.method,t,!0),Dm(e.timeout)&&(o.timeout=e.timeout),Object.keys(e.headers).forEach(l=>{const c=unescape(encodeURIComponent(e.headers[l]));o.setRequestHeader(l,c)}),e.responseType&&(o.responseType=e.responseType),e.withCredentials&&(o.withCredentials=!0),o.send(n),i},Rn=(n,t,e,i)=>({type:n,code:t,body:e,headers:i}),ih=n=>t=>{n(Rn("error",0,"Timeout",t.getAllResponseHeaders()))},g2=n=>/\?/.test(n),nb=(...n)=>{let t="";return n.forEach(e=>{t+=g2(t)&&g2(e)?e.replace(/\?/,"&"):e}),t},Gx=(n="",t)=>{if(typeof t=="function")return t;if(!t||!ns(t.url))return null;const e=t.onload||(s=>s),i=t.onerror||(s=>null);return(s,r,o,a,l,c)=>{const u=nh(s,nb(n,t.url),{...t,responseType:"blob"});return u.onload=d=>{const h=d.getAllResponseHeaders(),f=ZP(h).name||Ay(s);r(Rn("load",d.status,t.method==="HEAD"?null:hm(e(d.response),f),h))},u.onerror=d=>{o(Rn("error",d.status,i(d.response)||d.statusText,d.getAllResponseHeaders()))},u.onheaders=d=>{c(Rn("headers",d.status,null,d.getAllResponseHeaders()))},u.ontimeout=ih(o),u.onprogress=a,u.onabort=l,u}},rr={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},tie=(n,t,e,i,s,r,o,a,l,c,u)=>{const d=[],{chunkTransferId:h,chunkServer:f,chunkSize:p,chunkRetryDelays:v}=u,E={serverId:h,aborted:!1},x=t.ondata||(N=>N),A=t.onload||((N,m)=>m==="HEAD"?N.getResponseHeader("Upload-Offset"):N.response),O=t.onerror||(N=>null),I=N=>{const m=new FormData;ci(s)&&m.append(e,JSON.stringify(s));const _=typeof t.headers=="function"?t.headers(i,s):{...t.headers,"Upload-Length":i.size},C={...t,headers:_},B=nh(x(m),nb(n,t.url),C);B.onload=$=>N(A($,C.method)),B.onerror=$=>o(Rn("error",$.status,O($.response)||$.statusText,$.getAllResponseHeaders())),B.ontimeout=ih(o)},T=N=>{const m=nb(n,f.url,E.serverId),C={headers:typeof t.headers=="function"?t.headers(E.serverId):{...t.headers},method:"HEAD"},B=nh(null,m,C);B.onload=$=>N(A($,C.method)),B.onerror=$=>o(Rn("error",$.status,O($.response)||$.statusText,$.getAllResponseHeaders())),B.ontimeout=ih(o)},P=Math.floor(i.size/p);for(let N=0;N<=P;N++){const m=N*p,_=i.slice(m,m+p,"application/offset+octet-stream");d[N]={index:N,size:_.size,offset:m,data:_,file:i,progress:0,retries:[...v],status:rr.QUEUED,error:null,request:null,timeout:null}}const k=()=>r(E.serverId),D=N=>N.status===rr.QUEUED||N.status===rr.ERROR,U=N=>{if(E.aborted)return;if(N=N||d.find(D),!N){d.every(Z=>Z.status===rr.COMPLETE)&&k();return}N.status=rr.PROCESSING,N.progress=null;const m=f.ondata||(Z=>Z),_=f.onerror||(Z=>null),C=f.onload||(()=>{}),B=nb(n,f.url,E.serverId),$=typeof f.headers=="function"?f.headers(N):{...f.headers,"Content-Type":"application/offset+octet-stream","Upload-Offset":N.offset,"Upload-Length":i.size,"Upload-Name":i.name},X=N.request=nh(m(N.data),B,{...f,headers:$});X.onload=Z=>{C(Z,N.index,d.length),N.status=rr.COMPLETE,N.request=null,j()},X.onprogress=(Z,ie,fe)=>{N.progress=Z?ie:null,K()},X.onerror=Z=>{N.status=rr.ERROR,N.request=null,N.error=_(Z.response)||Z.statusText,Y(N)||o(Rn("error",Z.status,_(Z.response)||Z.statusText,Z.getAllResponseHeaders()))},X.ontimeout=Z=>{N.status=rr.ERROR,N.request=null,Y(N)||ih(o)(Z)},X.onabort=()=>{N.status=rr.QUEUED,N.request=null,l()}},Y=N=>N.retries.length===0?!1:(N.status=rr.WAITING,clearTimeout(N.timeout),N.timeout=setTimeout(()=>{U(N)},N.retries.shift()),!0),K=()=>{const N=d.reduce((_,C)=>_===null||C.progress===null?null:_+C.progress,0);if(N===null)return a(!1,0,0);const m=d.reduce((_,C)=>_+C.size,0);a(!0,N,m)},j=()=>{d.filter(m=>m.status===rr.PROCESSING).length>=1||U()},L=()=>{d.forEach(N=>{clearTimeout(N.timeout),N.request&&N.request.abort()})};return E.serverId?T(N=>{E.aborted||(d.filter(m=>m.offset<N).forEach(m=>{m.status=rr.COMPLETE,m.progress=m.size}),j())}):I(N=>{E.aborted||(c(N),E.serverId=N,j())}),{abort:()=>{E.aborted=!0,L()}}},nie=(n,t,e,i)=>(s,r,o,a,l,c,u)=>{if(!s)return;const d=i.chunkUploads,h=d&&s.size>i.chunkSize,f=d&&(h||i.chunkForce);if(s instanceof Blob&&f)return tie(n,t,e,s,r,o,a,l,c,u,i);const p=t.ondata||(T=>T),v=t.onload||(T=>T),E=t.onerror||(T=>null),x=typeof t.headers=="function"?t.headers(s,r)||{}:{...t.headers},A={...t,headers:x};var O=new FormData;ci(r)&&O.append(e,JSON.stringify(r)),(s instanceof Blob?[{name:null,file:s}
106]:s).forEach(T=>{O.append(e,T.file,T.name===null?T.file.name:`${T.name}${T.file.name}`)});const I=nh(p(O),nb(n,t.url),A);return I.onload=T=>{o(Rn("load",T.status,v(T.response),T.getAllResponseHeaders()))},I.onerror=T=>{a(Rn("error",T.status,E(T.response)||T.statusText,T.getAllResponseHeaders()))},I.ontimeout=ih(a),I.onprogress=l,I.onabort=c,I},iie=(n="",t,e,i)=>typeof t=="function"?(...s)=>t(e,...s,i):!t||!ns(t.url)?null:nie(n,t,e,i),rp=(n="",t)=>{if(typeof t=="function")return t;if(!t||!ns(t.url))return(s,r)=>r();const e=t.onload||(s=>s),i=t.onerror||(s=>null);return(s,r,o)=>{const a=nh(s,n+t.url,t);return a.onload=l=>{r(Rn("load",l.status,e(l.response),l.getAllResponseHeaders()))},a.onerror=l=>{o(Rn("error",l.status,i(l.response)||l.statusText,l.getAllResponseHeaders()))},a.ontimeout=ih(o),a}},GH=(n=0,t=1)=>n+Math.random()*(t-n),sie=(n,t=1e3,e=0,i=25,s=250)=>{let r=null;const o=Date.now(),a=()=>{let l=Date.now()-o,c=GH(i,s);l+c>t&&(c=l+c-t);let u=l/t;if(u>=1||document.hidden){n(1);return}n(u),r=setTimeout(a,c)};return t>0&&a(),{clear:()=>{clearTimeout(r)}}},rie=(n,t)=>{const e={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},{allowMinimumUploadDuration:i}=t,s=(u,d)=>{const h=()=>{e.duration===0||e.progress===null||c.fire("progress",c.getProgress())},f=()=>{e.complete=!0,c.fire("load-perceived",e.response.body)};c.fire("start"),e.timestamp=Date.now(),e.perceivedPerformanceUpdater=sie(p=>{e.perceivedProgress=p,e.perceivedDuration=Date.now()-e.timestamp,h(),e.response&&e.perceivedProgress===1&&!e.complete&&f()},i?GH(750,1500):0),e.request=n(u,d,p=>{e.response=ci(p)?p:{type:"load",code:200,body:`${p}`,headers:{}},e.duration=Date.now()-e.timestamp,e.progress=1,c.fire("load",e.response.body),(!i||i&&e.perceivedProgress===1)&&f()},p=>{e.perceivedPerformanceUpdater.clear(),c.fire("error",ci(p)?p:{type:"error",code:0,body:`${p}`})},(p,v,E)=>{e.duration=Date.now()-e.timestamp,e.progress=p?v/E:null,h()},()=>{e.perceivedPerformanceUpdater.clear(),c.fire("abort",e.response?e.response.body:null)},p=>{c.fire("transfer",p)})},r=()=>{e.request&&(e.perceivedPerformanceUpdater.clear(),e.request.abort&&e.request.abort(),e.complete=!0)},o=()=>{r(),e.complete=!1,e.perceivedProgress=0,e.progress=0,e.timestamp=null,e.perceivedDuration=0,e.duration=0,e.request=null,e.response=null},a=i?()=>e.progress?Math.min(e.progress,e.perceivedProgress):null:()=>e.progress||null,l=i?()=>Math.min(e.duration,e.perceivedDuration):()=>e.duration,c={...xT(),process:s,abort:r,getProgress:a,getDuration:l,reset:o};return c},YH=n=>n.substring(0,n.lastIndexOf("."))||n,oie=n=>{let t=[n.name,n.size,n.type];return n instanceof Blob||yC(n)?t[0]=n.name||WH():yC(n)?(t[1]=n.length,t[2]=jH(n)):ns(n)&&(t[0]=Ay(n),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}},sh=n=>!!(n instanceof File||n instanceof Blob&&n.name),qH=n=>{if(!ci(n))return n;const t=ET(n)?[]:{};for(const e in n){if(!n.hasOwnProperty(e))continue;const i=n[e];t[e]=i&&ci(i)?qH(i):i}return t},aie=(n=null,t=null,e=null)=>{const i=KP(),s={archived:!1,frozen:!1,released:!1,source:null,file:e,serverFileReference:t,transferId:null,processingAborted:!1,status:t?st.PROCESSING_COMPLETE:st.INIT,activeLoader:null,activeProcessor:null};let r=null;const o={},a=D=>s.status=D,l=(D,...U)=>{s.released||s.frozen||P.fire(D,...U)},c=()=>AT(s.file.name),u=()=>s.file.type,d=()=>s.file.size,h=()=>s.file,f=(D,U,Y)=>{if(s.source=D,P.fireSync("init"),s.file){P.fireSync("load-skip");return}s.file=oie(D),U.on("init",()=>{l("load-init")}),U.on("meta",K=>{s.file.size=K.size,s.file.filename=K.filename,K.source&&(n=Kn.LIMBO,s.serverFileReference=K.source,s.status=st.PROCESSING_COMPLETE),l("load-meta")}),U.on("progress",K=>{a(st.LOADING),l("load-progress",K)}),U.on("error",K=>{a(st.LOAD_ERROR),l("load-request-error",K)}),U.on("abort",()=>{a(st.INIT),l("load-abort")}),U.on("load",K=>{s.activeLoader=null;const j=N=>{s.file=sh(N)?N:s.file,n===Kn.LIMBO&&s.serverFileReference?a(st.PROCESSING_COMPLETE):a(st.IDLE),l("load")},L=N=>
106{s.file=K,l("load-meta"),a(st.LOAD_ERROR),l("load-file-error",N)};if(s.serverFileReference){j(K);return}Y(K,j,L)}),U.setSource(D),s.activeLoader=U,U.load()},p=()=>{s.activeLoader&&s.activeLoader.load()},v=()=>{if(s.activeLoader){s.activeLoader.abort();return}a(st.INIT),l("load-abort")},E=(D,U)=>{if(s.processingAborted){s.processingAborted=!1;return}if(a(st.PROCESSING),r=null,!(s.file instanceof Blob)){P.on("load",()=>{E(D,U)});return}D.on("load",j=>{s.transferId=null,s.serverFileReference=j}),D.on("transfer",j=>{s.transferId=j}),D.on("load-perceived",j=>{s.activeProcessor=null,s.transferId=null,s.serverFileReference=j,a(st.PROCESSING_COMPLETE),l("process-complete",j)}),D.on("start",()=>{l("process-start")}),D.on("error",j=>{s.activeProcessor=null,a(st.PROCESSING_ERROR),l("process-error",j)}),D.on("abort",j=>{s.activeProcessor=null,s.serverFileReference=j,a(st.IDLE),l("process-abort"),r&&r()}),D.on("progress",j=>{l("process-progress",j)});const Y=j=>{s.archived||D.process(j,{...o})},K=console.error;U(s.file,Y,K),s.activeProcessor=D},x=()=>{s.processingAborted=!1,a(st.PROCESSING_QUEUED)},A=()=>new Promise(D=>{if(!s.activeProcessor){s.processingAborted=!0,a(st.IDLE),l("process-abort"),D();return}r=()=>{D()},s.activeProcessor.abort()}),O=(D,U)=>new Promise((Y,K)=>{const j=s.serverFileReference!==null?s.serverFileReference:s.transferId;if(j===null){Y();return}D(j,()=>{s.serverFileReference=null,s.transferId=null,Y()},L=>{if(!U){Y();return}a(st.PROCESSING_REVERT_ERROR),l("process-revert-error"),K(L)}),a(st.IDLE),l("process-revert")}),I=(D,U,Y)=>{const K=D.split("."),j=K[0],L=K.pop();let N=o;K.forEach(m=>N=N[m]),JSON.stringify(N[L])!==JSON.stringify(U)&&(N[L]=U,l("metadata-update",{key:j,value:o[j],silent:Y}))},P={id:{get:()=>i},origin:{get:()=>n,set:D=>n=D},serverId:{get:()=>s.serverFileReference},transferId:{get:()=>s.transferId},status:{get:()=>s.status},filename:{get:()=>s.file.name},filenameWithoutExtension:{get:()=>YH(s.file.name)},fileExtension:{get:c},fileType:{get:u},fileSize:{get:d},file:{get:h},relativePath:{get:()=>s.file._relativePath},source:{get:()=>s.source},getMetadata:D=>qH(D?o[D]:o),setMetadata:(D,U,Y)=>{if(ci(D)){const K=D;return Object.keys(K).forEach(j=>{I(j,K[j],U)}),D}return I(D,U,Y),U},extend:(D,U)=>k[D]=U,abortLoad:v,retryLoad:p,requestProcessing:x,abortProcessing:A,load:f,process:E,revert:O,...xT(),freeze:()=>s.frozen=!0,release:()=>s.released=!0,released:{get:()=>s.released},archive:()=>s.archived=!0,archived:{get:()=>s.archived},setFile:D=>s.file=D},k=Mc(P);return k},lie=(n,t)=>gl(t)?0:ns(t)?n.findIndex(e=>e.id===t):-1,m2=(n,t)=>{const e=lie(n,t);if(!(e<0))return n[e]||null},p2=(n,t,e,i,s,r)=>{const o=nh(null,n,{method:"GET",responseType:"blob"});return o.onload=a=>{const l=a.getAllResponseHeaders(),c=ZP(l).name||Ay(n);t(Rn("load",a.status,hm(a.response,c),l))},o.onerror=a=>{e(Rn("error",a.status,a.statusText,a.getAllResponseHeaders()))},o.onheaders=a=>{r(Rn("headers",a.status,null,a.getAllResponseHeaders()))},o.ontimeout=ih(e),o.onprogress=i,o.onabort=s,o},b2=n=>(n.indexOf("//")===0&&(n=location.protocol+n),n.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]),cie=n=>(n.indexOf(":")>-1||n.indexOf("//")>-1)&&b2(location.href)!==b2(n),p_=n=>(...t)=>Mu(n)?n(...t):n,uie=n=>!sh(n.file),Yx=(n,t)=>{clearTimeout(t.listUpdateTimeout),t.listUpdateTimeout=setTimeout(()=>{n("DID_UPDATE_ITEMS",{items:Jr(t.items)})},0)},w2=(n,...t)=>new Promise(e=>{if(!n)return e(!0);const i=n(...t);if(i==null)return e(!0);if(typeof i=="boolean")return e(i);typeof i.then=="function"&&i.then(e)}),qx=(n,t)=>{n.items.sort((e,i)=>t(gs(e),gs(i)))},or=(n,t)=>({query:e,success:i=()=>{},failure:s=()=>{},...r}={})=>{const o=Ou(n.items,e);if(!o){s({error:Rn("error",0,"Item not found"),file:null});return}t(o,i,s,r||{})},die=(n,t,e)=>({ABORT_ALL:()=>{Jr(e.items).forEach(i=>{i.freeze(),i.abortLoad(),i.abortProcessing()})},DID_SET_FILES:({value:i=[]})=>{const s=i.map(o=>({source:o.source?o.source:o,options:o.options}));let r=Jr(e.items);r.forEach(o=>{s.find(a=>a.source===o.source||a.source===o.file)||n("REMOVE_ITEM",{query:o,remove:!1})}
106),r=Jr(e.items),s.forEach((o,a)=>{r.find(l=>l.source===o.source||l.file===o.source)||n("ADD_ITEM",{...o,interactionMethod:yr.NONE,index:a})})},DID_UPDATE_ITEM_METADATA:({id:i,action:s,change:r})=>{r.silent||(clearTimeout(e.itemUpdateTimeout),e.itemUpdateTimeout=setTimeout(()=>{const o=m2(e.items,i);if(!t("IS_ASYNC")){Kr("SHOULD_PREPARE_OUTPUT",!1,{item:o,query:t,action:s,change:r}).then(u=>{const d=t("GET_BEFORE_PREPARE_FILE");d&&(u=d(o,u)),u&&n("REQUEST_PREPARE_OUTPUT",{query:i,item:o,success:h=>{n("DID_PREPARE_OUTPUT",{id:i,file:h})}},!0)});return}o.origin===Kn.LOCAL&&n("DID_LOAD_ITEM",{id:o.id,error:null,serverFileReference:o.source});const a=()=>{setTimeout(()=>{n("REQUEST_ITEM_PROCESSING",{query:i})},32)},l=u=>{o.revert(rp(e.options.server.url,e.options.server.revert),t("GET_FORCE_REVERT")).then(u?a:()=>{}).catch(()=>{})},c=u=>{o.abortProcessing().then(u?a:()=>{})};if(o.status===st.PROCESSING_COMPLETE)return l(e.options.instantUpload);if(o.status===st.PROCESSING)return c(e.options.instantUpload);e.options.instantUpload&&a()},0))},MOVE_ITEM:({query:i,index:s})=>{const r=Ou(e.items,i);if(!r)return;const o=e.items.indexOf(r);s=$H(s,0,e.items.length-1),o!==s&&e.items.splice(s,0,e.items.splice(o,1)[0])},SORT:({compare:i})=>{qx(e,i),n("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:({items:i,index:s,interactionMethod:r,success:o=()=>{},failure:a=()=>{}})=>{let l=s;if(s===-1||typeof s>"u"){const f=t("GET_ITEM_INSERT_LOCATION"),p=t("GET_TOTAL_ITEMS");l=f==="before"?0:p}const c=t("GET_IGNORED_FILES"),u=f=>sh(f)?!c.includes(f.name.toLowerCase()):!gl(f),h=i.filter(u).map(f=>new Promise((p,v)=>{n("ADD_ITEM",{interactionMethod:r,source:f.source||f,success:p,failure:v,index:l++,options:f.options||{}})}));Promise.all(h).then(o).catch(a)},ADD_ITEM:({source:i,index:s=-1,interactionMethod:r,success:o=()=>{},failure:a=()=>{},options:l={}})=>{if(gl(i)){a({error:Rn("error",0,"No source"),file:null});return}if(sh(i)&&e.options.ignoredFiles.includes(i.name.toLowerCase()))return;if(!zne(e)){if(e.options.allowMultiple||!e.options.allowMultiple&&!e.options.allowReplace){const A=Rn("warning",0,"Max files");n("DID_THROW_MAX_FILES",{source:i,error:A}),a({error:A,file:null});return}const x=Jr(e.items)[0];if(x.status===st.PROCESSING_COMPLETE||x.status===st.PROCESSING_REVERT_ERROR){const A=t("GET_FORCE_REVERT");if(x.revert(rp(e.options.server.url,e.options.server.revert),A).then(()=>{A&&n("ADD_ITEM",{source:i,index:s,interactionMethod:r,success:o,failure:a,options:l})}).catch(()=>{}),A)return}n("REMOVE_ITEM",{query:x.id})}const c=l.type==="local"?Kn.LOCAL:l.type==="limbo"?Kn.LIMBO:Kn.INPUT,u=aie(c,c===Kn.INPUT?null:i,l.file);Object.keys(l.metadata||{}).forEach(x=>{u.setMetadata(x,l.metadata[x])}),Eh("DID_CREATE_ITEM",u,{query:t,dispatch:n});const d=t("GET_ITEM_INSERT_LOCATION");e.options.itemInsertLocationFreedom||(s=d==="before"?-1:e.items.length),Wne(e.items,u,s),Mu(d)&&i&&qx(e,d);const h=u.id;u.on("init",()=>{n("DID_INIT_ITEM",{id:h})}),u.on("load-init",()=>{n("DID_START_ITEM_LOAD",{id:h})}),u.on("load-meta",()=>{n("DID_UPDATE_ITEM_META",{id:h})}),u.on("load-progress",x=>{n("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:h,progress:x})}),u.on("load-request-error",x=>{const A=p_(e.options.labelFileLoadError)(x);if(x.code>=400&&x.code<500){n("DID_THROW_ITEM_INVALID",{id:h,error:x,status:{main:A,sub:`${x.code} (${x.body})`}}),a({error:x,file:gs(u)});return}n("DID_THROW_ITEM_LOAD_ERROR",{id:h,error:x,status:{main:A,sub:e.options.labelTapToRetry}})}),u.on("load-file-error",x=>{n("DID_THROW_ITEM_INVALID",{id:h,error:x.status,status:x.status}),a({error:x.status,file:gs(u)})}),u.on("load-abort",()=>{n("REMOVE_ITEM",{query:h})}),u.on("load-skip",()=>{u.on("metadata-update",x=>{sh(u.file)&&n("DID_UPDATE_ITEM_METADATA",{id:h,change:x})}),n("COMPLETE_LOAD_ITEM",{query:h,item:u,data:{source:i,success:o}})}),u.on("load",()=>{const x=A=>{if(!A){n("REMOVE_ITEM",{query:h});return}u.on("metadata-update",O=>{n("DID_UPDATE_ITEM_METADATA",{id:h,change:O})}),Kr("SHOULD_PREPARE_OUTPUT",!1,{item:u,query:t}).then(O=>{const I=t("GET_BEFORE_PREPARE_FILE");I&&(O=I(u,O));const T=()=>{n("COMPLETE_LOAD_ITEM",{query:h,item:u,data:{source:i,success:o}}),Yx(n,e)};if(O){n("REQUEST_PREPARE_OUTPUT",{query:h,item:u,success:P=>{n("DID_PREPARE_OUTPUT",{id:h,file:P}),T()}},!0);return}T()})};Kr("DID_LOAD_ITEM",u,{query:t,dispatch:n}).then(()=>{w2(t("GET_BEFORE_ADD_FILE"),gs(u)).then(x)}).catch(A=>{if(!A||!A.error||!A.status)return x(!1);n("DID_THROW_ITEM_INVALID",{id:h,error:A.error,status:A.status})})}),u.on("process-start",()=>{n("DID_START_ITEM_PROCESSING",{id:h})}),u.on("process-progress",x=>{n("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:h,progress:x})}),u.on("process-error",x=>
106{n("DID_THROW_ITEM_PROCESSING_ERROR",{id:h,error:x,status:{main:p_(e.options.labelFileProcessingError)(x),sub:e.options.labelTapToRetry}})}),u.on("process-revert-error",x=>{n("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:h,error:x,status:{main:p_(e.options.labelFileProcessingRevertError)(x),sub:e.options.labelTapToRetry}})}),u.on("process-complete",x=>{n("DID_COMPLETE_ITEM_PROCESSING",{id:h,error:null,serverFileReference:x}),n("DID_DEFINE_VALUE",{id:h,value:x})}),u.on("process-abort",()=>{n("DID_ABORT_ITEM_PROCESSING",{id:h})}),u.on("process-revert",()=>{n("DID_REVERT_ITEM_PROCESSING",{id:h}),n("DID_DEFINE_VALUE",{id:h,value:null})}),n("DID_ADD_ITEM",{id:h,index:s,interactionMethod:r}),Yx(n,e);const{url:f,load:p,restore:v,fetch:E}=e.options.server||{};u.load(i,eie(c===Kn.INPUT?ns(i)&&cie(i)&&E?Gx(f,E):p2:c===Kn.LIMBO?Gx(f,v):Gx(f,p)),(x,A,O)=>{Kr("LOAD_FILE",x,{query:t}).then(A).catch(O)})},REQUEST_PREPARE_OUTPUT:({item:i,success:s,failure:r=()=>{}})=>{const o={error:Rn("error",0,"Item not found"),file:null};if(i.archived)return r(o);Kr("PREPARE_OUTPUT",i.file,{query:t,item:i}).then(a=>{Kr("COMPLETE_PREPARE_OUTPUT",a,{query:t,item:i}).then(l=>{if(i.archived)return r(o);s(l)})})},COMPLETE_LOAD_ITEM:({item:i,data:s})=>{const{success:r,source:o}=s,a=t("GET_ITEM_INSERT_LOCATION");if(Mu(a)&&o&&qx(e,a),n("DID_LOAD_ITEM",{id:i.id,error:null,serverFileReference:i.origin===Kn.INPUT?null:o}),r(gs(i)),i.origin===Kn.LOCAL){n("DID_LOAD_LOCAL_ITEM",{id:i.id});return}if(i.origin===Kn.LIMBO){n("DID_COMPLETE_ITEM_PROCESSING",{id:i.id,error:null,serverFileReference:o}),n("DID_DEFINE_VALUE",{id:i.id,value:i.serverId||o});return}t("IS_ASYNC")&&e.options.instantUpload&&n("REQUEST_ITEM_PROCESSING",{query:i.id})},RETRY_ITEM_LOAD:or(e,i=>{i.retryLoad()}),REQUEST_ITEM_PREPARE:or(e,(i,s,r)=>{n("REQUEST_PREPARE_OUTPUT",{query:i.id,item:i,success:o=>{n("DID_PREPARE_OUTPUT",{id:i.id,file:o}),s({file:i,output:o})},failure:r},!0)}),REQUEST_ITEM_PROCESSING:or(e,(i,s,r)=>{if(!(i.status===st.IDLE||i.status===st.PROCESSING_ERROR)){const a=()=>n("REQUEST_ITEM_PROCESSING",{query:i,success:s,failure:r}),l=()=>document.hidden?a():setTimeout(a,32);i.status===st.PROCESSING_COMPLETE||i.status===st.PROCESSING_REVERT_ERROR?i.revert(rp(e.options.server.url,e.options.server.revert),t("GET_FORCE_REVERT")).then(l).catch(()=>{}):i.status===st.PROCESSING&&i.abortProcessing().then(l);return}i.status!==st.PROCESSING_QUEUED&&(i.requestProcessing(),n("DID_REQUEST_ITEM_PROCESSING",{id:i.id}),n("PROCESS_ITEM",{query:i,success:s,failure:r},!0))}),PROCESS_ITEM:or(e,(i,s,r)=>{const o=t("GET_MAX_PARALLEL_UPLOADS");if(t("GET_ITEMS_BY_STATUS",st.PROCESSING).length===o){e.processingQueue.push({id:i.id,success:s,failure:r});return}if(i.status===st.PROCESSING)return;const l=()=>{const u=e.processingQueue.shift();if(!u)return;const{id:d,success:h,failure:f}=u,p=Ou(e.items,d);if(!p||p.archived){l();return}n("PROCESS_ITEM",{query:d,success:h,failure:f},!0)};i.onOnce("process-complete",()=>{s(gs(i)),l();const u=e.options.server;if(e.options.instantUpload&&i.origin===Kn.LOCAL&&Mu(u.remove)){const f=()=>{};i.origin=Kn.LIMBO,e.options.server.remove(i.source,f,f)}t("GET_ITEMS_BY_STATUS",st.PROCESSING_COMPLETE).length===e.items.length&&n("DID_COMPLETE_ITEM_PROCESSING_ALL")}),i.onOnce("process-error",u=>{r({error:u,file:gs(i)}),l()});const c=e.options;i.process(rie(iie(c.server.url,c.server.process,c.name,{chunkTransferId:i.transferId,chunkServer:c.server.patch,chunkUploads:c.chunkUploads,chunkForce:c.chunkForce,chunkSize:c.chunkSize,chunkRetryDelays:c.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(u,d,h)=>{Kr("PREPARE_OUTPUT",u,{query:t,item:i}).then(f=>{n("DID_PREPARE_OUTPUT",{id:i.id,file:f}),d(f)}).catch(h)})}),RETRY_ITEM_PROCESSING:or(e,i=>{n("REQUEST_ITEM_PROCESSING",{query:i})}),REQUEST_REMOVE_ITEM:or(e,i=>{w2(t("GET_BEFORE_REMOVE_FILE"),gs(i)).then(s=>{s&&n("REMOVE_ITEM",{query:i})})}),RELEASE_ITEM:or(e,i=>{i.release()}),REMOVE_ITEM:or(e,(i,s,r,o)=>{const a=()=>{const c=i.id;m2(e.items,c).archive(),n("DID_REMOVE_ITEM",{error:null,id:c,item:i}),Yx(n,e),s(gs(i))},l=e.options.server;i.origin===Kn.LOCAL&&l&&Mu(l.remove)&&o.remove!==!1?(n("DID_START_ITEM_REMOVE",{id:i.id}),l.remove(i.source,()=>a(),c=>
106{n("DID_THROW_ITEM_REMOVE_ERROR",{id:i.id,error:Rn("error",0,c,null),status:{main:p_(e.options.labelFileRemoveError)(c),sub:e.options.labelTapToRetry}})})):((o.revert&&i.origin!==Kn.LOCAL&&i.serverId!==null||e.options.chunkUploads&&i.file.size>e.options.chunkSize||e.options.chunkUploads&&e.options.chunkForce)&&i.revert(rp(e.options.server.url,e.options.server.revert),t("GET_FORCE_REVERT")),a())}),ABORT_ITEM_LOAD:or(e,i=>{i.abortLoad()}),ABORT_ITEM_PROCESSING:or(e,i=>{if(i.serverId){n("REVERT_ITEM_PROCESSING",{id:i.id});return}i.abortProcessing().then(()=>{e.options.instantUpload&&n("REMOVE_ITEM",{query:i.id})})}),REQUEST_REVERT_ITEM_PROCESSING:or(e,i=>{if(!e.options.instantUpload){n("REVERT_ITEM_PROCESSING",{query:i});return}const s=a=>{a&&n("REVERT_ITEM_PROCESSING",{query:i})},r=t("GET_BEFORE_REMOVE_FILE");if(!r)return s(!0);const o=r(gs(i));if(o==null)return s(!0);if(typeof o=="boolean")return s(o);typeof o.then=="function"&&o.then(s)}),REVERT_ITEM_PROCESSING:or(e,i=>{i.revert(rp(e.options.server.url,e.options.server.revert),t("GET_FORCE_REVERT")).then(()=>{(e.options.instantUpload||uie(i))&&n("REMOVE_ITEM",{query:i.id})}).catch(()=>{})}),SET_OPTIONS:({options:i})=>{const s=Object.keys(i),r=hie.filter(a=>s.includes(a));[...r,...Object.keys(i).filter(a=>!r.includes(a))].forEach(a=>{n(`SET_${TT(a,"_").toUpperCase()}`,{value:i[a]})})}}),hie=["server"],QP=n=>n,ml=n=>document.createElement(n),Fn=(n,t)=>{let e=n.childNodes[0];e?t!==e.nodeValue&&(e.nodeValue=t):(e=document.createTextNode(t),n.appendChild(e))},v2=(n,t,e,i)=>{const s=(i%360-90)*Math.PI/180;return{x:n+e*Math.cos(s),y:t+e*Math.sin(s)}},fie=(n,t,e,i,s,r)=>{const o=v2(n,t,e,s),a=v2(n,t,e,i);return["M",o.x,o.y,"A",e,e,0,r,0,a.x,a.y].join(" ")},gie=(n,t,e,i,s)=>{let r=1;return s>i&&s-i<=.5&&(r=0),i>s&&i-s>=.5&&(r=0),fie(n,t,e,Math.min(.9999,i)*360,Math.min(.9999,s)*360,r)},mie=({root:n,props:t})=>{t.spin=!1,t.progress=0,t.opacity=0;const e=_E("svg");n.ref.path=_E("path",{"stroke-width":2,"stroke-linecap":"round"}),e.appendChild(n.ref.path),n.ref.svg=e,n.appendChild(e)},pie=({root:n,props:t})=>{if(t.opacity===0)return;t.align&&(n.element.dataset.align=t.align);const e=parseInt(Zn(n.ref.path,"stroke-width"),10),i=n.rect.element.width*.5;let s=0,r=0;t.spin?(s=0,r=.5):(s=0,r=t.progress);const o=gie(i,i,i-e,s,r);Zn(n.ref.path,"d",o),Zn(n.ref.path,"stroke-opacity",t.spin||t.progress>0?1:0)},y2=Un({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:mie,write:pie,mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),bie=({root:n,props:t})=>{n.element.innerHTML=(t.icon||"")+`<span>${t.label}</span>`,t.isDisabled=!1},wie=({root:n,props:t})=>{const{isDisabled:e}=t,i=n.query("GET_DISABLED")||t.opacity===0;i&&!e?(t.isDisabled=!0,Zn(n.element,"disabled","disabled")):!i&&e&&(t.isDisabled=!1,n.element.removeAttribute("disabled"))},KH=Un({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:bie,write:wie}),XH=(n,t=".",e=1e3,i={})=>{const{labelBytes:s="bytes",labelKilobytes:r="KB",labelMegabytes:o="MB",labelGigabytes:a="GB"}=i;n=Math.round(Math.abs(n));const l=e,c=e*e,u=e*e*e;return n<l?`${n} ${s}`:n<c?`${Math.floor(n/l)} ${r}`:n<u?`${_2(n/c,1,t)} ${o}`:`${_2(n/u,2,t)} ${a}`},_2=(n,t,e)=>n.toFixed(t).split(".").filter(i=>i!=="0").join(e),vie=({root:n,props:t})=>{const e=ml("span");e.className="filepond--file-info-main",Zn(e,"aria-hidden","true"),n.appendChild(e),n.ref.fileName=e;const i=ml("span");i.className="filepond--file-info-sub",n.appendChild(i),n.ref.fileSize=i,Fn(i,n.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),Fn(e,QP(n.query("GET_ITEM_NAME",t.id)))},_C=({root:n,props:t})=>{Fn(n.ref.fileSize,XH(n.query("GET_ITEM_SIZE",t.id),".",n.query("GET_FILE_SIZE_BASE"),n.query("GET_FILE_SIZE_LABELS",n.query
106))),Fn(n.ref.fileName,QP(n.query("GET_ITEM_NAME",t.id)))},E2=({root:n,props:t})=>{if(Dm(n.query("GET_ITEM_SIZE",t.id))){_C({root:n,props:t});return}Fn(n.ref.fileSize,n.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},yie=Un({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:ss({DID_LOAD_ITEM:_C,DID_UPDATE_ITEM_META:_C,DID_THROW_ITEM_LOAD_ERROR:E2,DID_THROW_ITEM_INVALID:E2}),didCreateView:n=>{Eh("CREATE_VIEW",{...n,view:n})},create:vie,mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),JH=n=>Math.round(n*100),_ie=({root:n})=>{const t=ml("span");t.className="filepond--file-status-main",n.appendChild(t),n.ref.main=t;const e=ml("span");e.className="filepond--file-status-sub",n.appendChild(e),n.ref.sub=e,ZH({root:n,action:{progress:null}})},ZH=({root:n,action:t})=>{const e=t.progress===null?n.query("GET_LABEL_FILE_LOADING"):`${n.query("GET_LABEL_FILE_LOADING")} ${JH(t.progress)}%`;Fn(n.ref.main,e),Fn(n.ref.sub,n.query("GET_LABEL_TAP_TO_CANCEL"))},Eie=({root:n,action:t})=>{const e=t.progress===null?n.query("GET_LABEL_FILE_PROCESSING"):`${n.query("GET_LABEL_FILE_PROCESSING")} ${JH(t.progress)}%`;Fn(n.ref.main,e),Fn(n.ref.sub,n.query("GET_LABEL_TAP_TO_CANCEL"))},Sie=({root:n})=>{Fn(n.ref.main,n.query("GET_LABEL_FILE_PROCESSING")),Fn(n.ref.sub,n.query("GET_LABEL_TAP_TO_CANCEL"))},Tie=({root:n})=>{Fn(n.ref.main,n.query("GET_LABEL_FILE_PROCESSING_ABORTED")),Fn(n.ref.sub,n.query("GET_LABEL_TAP_TO_RETRY"))},xie=({root:n})=>{Fn(n.ref.main,n.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),Fn(n.ref.sub,n.query("GET_LABEL_TAP_TO_UNDO"))},S2=({root:n})=>{Fn(n.ref.main,""),Fn(n.ref.sub,"")},op=({root:n,action:t})=>{Fn(n.ref.main,t.status.main),Fn(n.ref.sub,t.status.sub)},Aie=Un({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:ss({DID_LOAD_ITEM:S2,DID_REVERT_ITEM_PROCESSING:S2,DID_REQUEST_ITEM_PROCESSING:Sie,DID_ABORT_ITEM_PROCESSING:Tie,DID_COMPLETE_ITEM_PROCESSING:xie,DID_UPDATE_ITEM_PROCESS_PROGRESS:Eie,DID_UPDATE_ITEM_LOAD_PROGRESS:ZH,DID_THROW_ITEM_LOAD_ERROR:op,DID_THROW_ITEM_INVALID:op,DID_THROW_ITEM_PROCESSING_ERROR:op,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:op,DID_THROW_ITEM_REMOVE_ERROR:op}),didCreateView:n=>{Eh("CREATE_VIEW",{...n,view:n})},create:_ie,mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),EC={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},SC=[];xn(EC,n=>{SC.push(n)});const Cs=n=>{if(TC(n)==="right")return 0;const t=n.ref.buttonRemoveItem.rect.element;return t.hidden?null:t.width+t.left},Cie=n=>n.ref.buttonAbortItemLoad.rect.element.width,b_=n=>Math.floor(n.ref.buttonRemoveItem.rect.element.height/4),kie=n=>Math.floor(n.ref.buttonRemoveItem.rect.element.left/2),Iie=n=>n.query("GET_STYLE_LOAD_INDICATOR_POSITION"),Pie=n=>n.query("GET_STYLE_PROGRESS_INDICATOR_POSITION"),TC=n=>n.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION"),Mie={buttonAbortItemLoad:{opacity:0}
vendor: 5,029 bytes, line 106
106,buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:Iie},processProgressIndicator:{opacity:0,align:Pie},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},T2={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Cs},status:{translateX:Cs}},Kx={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},uf={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Cs},status:{translateX:Cs,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:Cs},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:TC},info:{translateX:Cs},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:TC},buttonRemoveItem:{opacity:1},info:{translateX:Cs},status:{opacity:1,translateX:Cs}},DID_LOAD_ITEM:T2,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Cs},status:{translateX:Cs}},DID_START_ITEM_PROCESSING:Kx,DID_REQUEST_ITEM_PROCESSING:Kx,DID_UPDATE_ITEM_PROCESS_PROGRESS:Kx,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:Cs}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Cs},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:T2},Oie=Un({create:({root:n})=>{n.element.innerHTML=n.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),Die=({root:n,props:t})=>{const e=Object.keys(EC).reduce((p,v)=>(p[v]={...EC[v]},p),{}),{id:i}=t,s=n.query("GET_ALLOW_REVERT"),r=n.query("GET_ALLOW_REMOVE"),o=n.query("GET_ALLOW_PROCESS"),a=n.query("GET_INSTANT_UPLOAD"),l=n.query("IS_ASYNC"),c=n.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");let u;l?o&&!s?u=p=>!/RevertItemProcessing/.test(p):!o&&s?u=p=>!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(p):!o&&!s&&(u=p=>!/Process/.test(p)):u=p=>!/Process/.test(p);const d=u?SC.filter(u):SC.concat();if(a&&s&&(e.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",e.RevertItemProcessing.icon="GET_ICON_REMOVE"),l&&!s){const p=uf.DID_COMPLETE_ITEM_PROCESSING;p.info.translateX=kie,p.info.translateY=b_,p.status.translateY=b_,p.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(l&&!o&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach(p=>{uf[p].status.translateY=b_}),uf.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=Cie),c&&s){e.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";const p=uf.DID_COMPLETE_ITEM_PROCESSING;p.info.translateX=Cs,p.status.translateY=b_,p.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}r||(e.RemoveItem.disabled=!0),xn(e,(p,v)=>{const E=n.createChildView(KH,{label:n.query(v.label),icon:n.query(v.icon),opacity:0});d.includes(p)&&n.appendChildView(E),v.disabled&&(E.element.setAttribute("disabled","disabled"),E.element.setAttribute("hidden","hidden")),E.element.dataset.align=n.query(`GET_STYLE_${v.align}`),E.element.classList.add(v.className),E.on("click",x=>{x.stopPropagation(),!v.disabled&&n.dispatch(v.action,{query:i})}),n.ref[`button${p}`]=E}),n.ref.processingCompleteIndicator=n.appendChildView(n.createChildView(Oie)),n.ref.processingCompleteIndicator.element.dataset.align=n.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),n.ref.info=n.appendChildView(n.createChildView(yie,{id:i})),n.ref.status=n.appendChildView(n.createChildView(Aie,{id:i}));const h=n.appendChildView(n.createChildView(y2,{opacity:0,align:n.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));h.element.classList.add("filepond--load-indicator"),n.ref.loadProgressIndicator=h;const f=n.appendChildView(n.createChildView(y2,{opacity:0,align:n.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));f.element.classList.add("filepond--process-indicator"),n.ref.processProgressIndicator=f,n.ref.activeStyles=[]},Rie=({root:n,actions:t,props:e})=>{Lie({root:n,actions:t,props:e});let i=t.concat().filter(s=>/^DID_/.test(s.type)).reverse().find(s=>uf[s.type]);if(i){n.ref.activeStyles=[];const s=uf[i.type];xn(Mie,(r,o)=>{const a=n.ref[r];xn(o,(l,c)=>{const u=s[r]&&typeof s[r][l]<"u"?s[r][l]:c;n.ref.activeStyles.push({control:a,key:l,value:u})})})}
106n.ref.activeStyles.forEach(({control:s,key:r,value:o})=>{s[r]=typeof o=="function"?o(n):o})},Lie=ss({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:({root:n,action:t})=>{n.ref.buttonAbortItemProcessing.label=t.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:({root:n,action:t})=>{n.ref.buttonAbortItemLoad.label=t.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:({root:n,action:t})=>{n.ref.buttonAbortItemRemoval.label=t.value},DID_REQUEST_ITEM_PROCESSING:({root:n})=>{n.ref.processProgressIndicator.spin=!0,n.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:({root:n})=>{n.ref.loadProgressIndicator.spin=!0,n.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:({root:n})=>{n.ref.processProgressIndicator.spin=!0,n.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:({root:n,action:t})=>{n.ref.loadProgressIndicator.spin=!1,n.ref.loadProgressIndicator.progress=t.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:({root:n,action:t})=>{n.ref.processProgressIndicator.spin=!1,n.ref.processProgressIndicator.progress=t.progress}}),Fie=Un({create:Die,write:Rie,didCreateView:n=>{Eh("CREATE_VIEW",{...n,view:n})},name:"file"}),Nie=({root:n,props:t})=>{n.ref.fileName=ml("legend"),n.appendChild(n.ref.fileName),n.ref.file=n.appendChildView(n.createChildView(Fie,{id:t.id})),n.ref.data=!1},Bie=({root:n,props:t})=>{Fn(n.ref.fileName,QP(n.query("GET_ITEM_NAME",t.id)))},Vie=Un({create:Nie,ignoreRect:!0,write:ss({DID_LOAD_ITEM:Bie}),didCreateView:n=>{Eh("CREATE_VIEW",{...n,view:n})},tag:"fieldset",name:"file-wrapper"}),x2={type:"spring",damping:.6,mass:7},Hie=({root:n,props:t})=>{[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:x2},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:x2},styles:["translateY"]}}].forEach(e=>{zie(n,e,t.name)}),n.element.classList.add(`filepond--${t.name}`),n.ref.scalable=null},zie=(n,t,e)=>{const i=Un({name:`panel-${t.name} filepond--${e}`,mixins:t.mixins,ignoreRectUpdate:!0}),s=n.createChildView(i,t.props);n.ref[t.name]=n.appendChildView(s)},$ie=({root:n,props:t})=>{if((n.ref.scalable===null||t.scalable!==n.ref.scalable)&&(n.ref.scalable=DH(t.scalable)?t.scalable:!0,n.element.dataset.scalable=n.ref.scalable),!t.height)return;const e=n.ref.top.rect.element,i=n.ref.bottom.rect.element,s=Math.max(e.height+i.height,t.height);n.ref.center.translateY=e.height,n.ref.center.scaleY=(s-e.height-i.height)/100,n.ref.bottom.translateY=s-i.height},QH=Un({name:"panel",read:({root:n,props:t})=>t.heightCurrent=n.ref.bottom.translateY,write:$ie,create:Hie,ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),Wie=n=>{const t=n.map(i=>i.id);let e;return{setIndex:i=>{e=i},getIndex:()=>e,getItemIndex:i=>t.indexOf(i.id)}},A2={type:"spring",stiffness:.75,damping:.45,mass:10},C2="spring",k2={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},Uie=({root:n,props:t})=>{if(n.ref.handleClick=i=>n.dispatch("DID_ACTIVATE_ITEM",{id:t.id}),n.element.id=`filepond--item-${t.id}`,n.element.addEventListener("click",n.ref.handleClick),n.ref.container=n.appendChildView(n.createChildView(Vie,{id:t.id})),n.ref.panel=n.appendChildView(n.createChildView(QH,{name:"item-panel"})),n.ref.panel.height=null,t.markedForRemoval=!1,!n.query("GET_ALLOW_REORDER"))return;n.element.dataset.dragState="idle";const e=i=>{if(!i.isPrimary)return;let s=!1;const r={x:i.pageX,y:i.pageY};t.dragOrigin={x:n.translateX,y:n.translateY},t.dragCenter={x:i.offsetX,y:i.offsetY};const o=Wie(n.query("GET_ACTIVE_ITEMS"));n.dispatch("DID_GRAB_ITEM",{id:t.id,dragState:o});const a=d=>{if(!d.isPrimary)return;d.stopPropagation(),d.preventDefault(),t.dragOffset={x:d.pageX-r.x,y:d.pageY-r.y},t.dragOffset.x*t.dragOffset.x+t.dragOffset.y*t.dragOffset.y>16&&!s&&(s=!0,n.element.removeEventListener("click",n.ref.handleClick)),n.dispatch("DID_DRAG_ITEM",{id:t.id,dragState:o})},l=d=>{d.isPrimary&&(t.dragOffset={x:d.pageX-r.x,y:d.pageY-r.y},u())},c=()=>{u()},u=()=>{document.removeEventListener("pointercancel",c),document.removeEventListener("pointermove",a),document.removeEventListener("pointerup",l),n.dispatch("DID_DROP_ITEM",{id:t.id,dragState:o}),s&&setTimeout(()=>n.element.addEventListener("click",n.ref.handleClick),0)};document.addEventListener("pointercancel",c),document.addEventListener("pointermove",a),document.addEventListener("pointerup",l)};n.element.addEventListener("pointerdown",e)},jie=ss({DID_UPDATE_PANEL_HEIGHT:({root:n,action:t})=>{n.height=t.height}}),Gie=ss({DID_GRAB_ITEM:({root:n,props:t})=>{t.dragOrigin={x:n.translateX,y:n.translateY}},DID_DRAG_ITEM:({root:n})=>{n.element.dataset.dragState="drag"},DID_DROP_ITEM:({root:n,props:t})=>{t.dragOffset=null,t.dragOrigin=null,n.element.dataset.dragState="drop"}},({root:n,actions:t,props:e,shouldOptimize:i})=>{n.element.dataset.dragState==="drop"&&n.scaleX<=1&&(n.element.dataset.dragState="idle");let s=t.concat().filter(o=>/^DID_/.test(o.type)).reverse().find(o=>k2[o.type]);s&&s.type!==e.currentState&&(e.currentState=s.type,n.element.dataset.f
106ilepondItemState=k2[e.currentState]||"");const r=n.query("GET_ITEM_PANEL_ASPECT_RATIO")||n.query("GET_PANEL_ASPECT_RATIO");r?i||(n.height=n.rect.element.width*r):(jie({root:n,actions:t,props:e}),!n.height&&n.ref.container.rect.element.height>0&&(n.height=n.ref.container.rect.element.height)),i&&(n.ref.panel.height=null),n.ref.panel.height=n.height}),Yie=Un({create:Uie,write:Gie,destroy:({root:n,props:t})=>{n.element.removeEventListener("click",n.ref.handleClick),n.dispatch("RELEASE_ITEM",{query:t.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:C2,scaleY:C2,translateX:A2,translateY:A2,opacity:{type:"tween",duration:150}}}});var eM=(n,t)=>Math.max(1,Math.floor((n+1)/t));const tM=(n,t,e)=>{if(!e)return;const i=n.rect.element.width,s=t.length;let r=null;if(s===0||e.top<t[0].rect.element.top)return-1;const a=t[0].rect.element,l=a.marginLeft+a.marginRight,c=a.width+l,u=eM(i,c);if(u===1){for(let f=0;f<s;f++){const p=t[f],v=p.rect.outer.top+p.rect.element.height*.5;if(e.top<v)return f}return s}const d=a.marginTop+a.marginBottom,h=a.height+d;for(let f=0;f<s;f++){const p=f%u,v=Math.floor(f/u),E=p*c,x=v*h,A=x-a.marginTop,O=E+c,I=x+h+a.marginBottom;if(e.top<I&&e.top>A){if(e.left<O)return f;f!==s-1?r=f:r=null}}return r!==null?r:s},w_={height:0,width:0,get getHeight(){return this.height},set setHeight(n){(this.height===0||n===0)&&(this.height=n)},get getWidth(){return this.width},set setWidth(n){(this.width===0||n===0)&&(this.width=n)},setDimensions:function(n,t){(this.height===0||n===0)&&(this.height=n),(this.width===0||t===0)&&(this.width=t)}},qie=({root:n})=>{Zn(n.element,"role","list"),n.ref.lastItemSpanwDate=Date.now()},Kie=({root:n,action:t})=>{const{id:e,index:i,interactionMethod:s}=t;n.ref.addIndex=i;const r=Date.now();let o=r,a=1;if(s!==yr.NONE){a=0;const l=n.query("GET_ITEM_INSERT_INTERVAL"),c=r-n.ref.lastItemSpanwDate;o=c<l?r+(l-c):r}n.ref.lastItemSpanwDate=o,n.appendChildView(n.createChildView(Yie,{spawnDate:o,id:e,opacity:a,interactionMethod:s}),i)},I2=(n,t,e,i=0,s=1)=>{n.dragOffset?(n.translateX=null,n.translateY=null,n.translateX=n.dragOrigin.x+n.dragOffset.x,n.translateY=n.dragOrigin.y+n.dragOffset.y,n.scaleX=1.025,n.scaleY=1.025):(n.translateX=t,n.translateY=e,Date.now()>n.spawnDate&&(n.opacity===0&&Xie(n,t,e,i,s),n.scaleX=1,n.scaleY=1,n.opacity=1))},Xie=(n,t,e,i,s)=>{n.interactionMethod===yr.NONE?(n.translateX=null,n.translateX=t,n.translateY=null,n.translateY=e):n.interactionMethod===yr.DROP?(n.translateX=null,n.translateX=t-i*20,n.translateY=null,n.translateY=e-s*10,n.scaleX=.8,n.scaleY=.8):n.interactionMethod===yr.BROWSE?(n.translateY=null,n.translateY=e-30):n.interactionMethod===yr.API&&(n.translateX=null,n.translateX=t-30,n.translateY=null)},Jie=({root:n,action:t})=>{const{id:e}=t,i=n.childViews.find(s=>s.id===e);i&&(i.scaleX=.9,i.scaleY=.9,i.opacity=0,i.markedForRemoval=!0)},Xx=n=>n.rect.element.height+n.rect.element.marginBottom*.5+n.rect.element.marginTop*.5,Zie=n=>n.rect.element.width+n.rect.element.marginLeft*.5+n.rect.element.marginRight*.5,Qie=({root:n,action:t})=>{const{id:e,dragState:i}=t,s=n.query("GET_ITEM",{id:e}),r=n.childViews.find(E=>E.id===e),o=n.childViews.length,a=i.getItemIndex(s);if(!r)return;const l={x:r.dragOrigin.x+r.dragOffset.x+r.dragCenter.x,y:r.dragOrigin.y+r.dragOffset.y+r.dragCenter.y},c=Xx(r),u=Zie(r);let d=Math.floor(n.rect.outer.width/u);d>o&&(d=o);const h=Math.floor(o/d+1);w_.setHeight=c*h,w_.setWidth=u*d;var f={y:Math.floor(l.y/c),x:Math.floor(l.x/u),getGridIndex:function(){return l.y>w_.getHeight||l.y<0||l.x>w_.getWidth||l.x<0?a:this.y*d+this.x},getColIndex:function(){const x=n.query("GET_ACTIVE_ITEMS"),A=n.childViews.filter(K=>K.rect.element.height),O=x.map(K=>A.find(j=>j.id===K.id)),I=O.findIndex(K=>K===r),T=Xx(r),P=O.length;let k=P,D=0,U=0,Y=0;for(let K=0;K<P;K++)if(D=Xx(O[K]),Y=U,U=Y+D,l.y<U){if(I>K){if(l.y<Y+T){k=K;break}continue}k=K;break}return k}};const p=d>1?f.getGridIndex():f.getColIndex();
106n.dispatch("MOVE_ITEM",{query:r,index:p});const v=i.getIndex();if(v===void 0||v!==p){if(i.setIndex(p),v===void 0)return;n.dispatch("DID_REORDER_ITEMS",{items:n.query("GET_ACTIVE_ITEMS"),origin:a,target:p})}},ese=ss({DID_ADD_ITEM:Kie,DID_REMOVE_ITEM:Jie,DID_DRAG_ITEM:Qie}),tse=({root:n,props:t,actions:e,shouldOptimize:i})=>{ese({root:n,props:t,actions:e});const{dragCoordinates:s}=t,r=n.rect.element.width,o=n.childViews.filter(O=>O.rect.element.height),a=n.query("GET_ACTIVE_ITEMS").map(O=>o.find(I=>I.id===O.id)).filter(O=>O),l=s?tM(n,a,s):null,c=n.ref.addIndex||null;n.ref.addIndex=null;let u=0,d=0,h=0;if(a.length===0)return;const f=a[0].rect.element,p=f.marginTop+f.marginBottom,v=f.marginLeft+f.marginRight,E=f.width+v,x=f.height+p,A=eM(r,E);if(A===1){let O=0,I=0;a.forEach((T,P)=>{if(l){let U=P-l;U===-2?I=-p*.25:U===-1?I=-p*.75:U===0?I=p*.75:U===1?I=p*.25:I=0}i&&(T.translateX=null,T.translateY=null),T.markedForRemoval||I2(T,0,O+I);let D=(T.rect.element.height+p)*(T.markedForRemoval?T.opacity:1);O+=D})}else{let O=0,I=0;a.forEach((T,P)=>{P===l&&(u=1),P===c&&(h+=1),T.markedForRemoval&&T.opacity<.5&&(d-=1);const k=P+h+u+d,D=k%A,U=Math.floor(k/A),Y=D*E,K=U*x,j=Math.sign(Y-O),L=Math.sign(K-I);O=Y,I=K,!T.markedForRemoval&&(i&&(T.translateX=null,T.translateY=null),I2(T,Y,K,j,L))})}},nse=(n,t)=>t.filter(e=>e.data&&e.data.id?n.id===e.data.id:!0),ise=Un({create:qie,write:tse,tag:"ul",name:"list",didWriteView:({root:n})=>{n.childViews.filter(t=>t.markedForRemoval&&t.opacity===0&&t.resting).forEach(t=>{t._destroy(),n.removeChildView(t)})},filterFrameActionsForChild:nse,mixins:{apis:["dragCoordinates"]}}),sse=({root:n,props:t})=>{n.ref.list=n.appendChildView(n.createChildView(ise)),t.dragCoordinates=null,t.overflowing=!1},rse=({root:n,props:t,action:e})=>{n.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(t.dragCoordinates={left:e.position.scopeLeft-n.ref.list.rect.element.left,top:e.position.scopeTop-(n.rect.outer.top+n.rect.element.marginTop+n.rect.element.scrollTop)})},ose=({props:n})=>{n.dragCoordinates=null},ase=ss({DID_DRAG:rse,DID_END_DRAG:ose}),lse=({root:n,props:t,actions:e})=>{if(ase({root:n,props:t,actions:e}),n.ref.list.dragCoordinates=t.dragCoordinates,t.overflowing&&!t.overflow&&(t.overflowing=!1,n.element.dataset.state="",n.height=null),t.overflow){const i=Math.round(t.overflow);i!==n.height&&(t.overflowing=!0,n.element.dataset.state="overflow",n.height=i)}},cse=Un({create:sse,write:lse,name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),eo=(n,t,e,i="")=>{e?Zn(n,t,i):n.removeAttribute(t)},use=n=>{if(!(!n||n.value==="")){try{n.value=""}catch{}if(n.value){const t=ml("form"),e=n.parentNode,i=n.nextSibling;t.appendChild(n),t.reset(),i?e.insertBefore(n,i):e.appendChild(n)}}},dse=({root:n,props:t})=>{n.element.id=`filepond--browser-${t.id}`,Zn(n.element,"name",n.query("GET_NAME")),Zn(n.element,"aria-controls",`filepond--assistant-${t.id}`),Zn(n.element,"aria-labelledby",`filepond--drop-label-${t.id}`),e3({root:n,action:{value:n.query("GET_ACCEPTED_FILE_TYPES")}}),t3({root:n,action:{value:n.query("GET_ALLOW_MULTIPLE")}}),n3({root:n,action:{value:n.query("GET_ALLOW_DIRECTORIES_ONLY")}}),xC({root:n}),i3({root:n,action:{value:n.query("GET_REQUIRED")}
106}),s3({root:n,action:{value:n.query("GET_CAPTURE_METHOD")}}),n.ref.handleChange=e=>{if(!n.element.value)return;const i=Array.from(n.element.files).map(s=>(s._relativePath=s.webkitRelativePath,s));setTimeout(()=>{t.onload(i),use(n.element)},250)},n.element.addEventListener("change",n.ref.handleChange)},e3=({root:n,action:t})=>{n.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&eo(n.element,"accept",!!t.value,t.value?t.value.join(","):"")},t3=({root:n,action:t})=>{eo(n.element,"multiple",t.value)},n3=({root:n,action:t})=>{eo(n.element,"webkitdirectory",t.value)},xC=({root:n})=>{const t=n.query("GET_DISABLED"),e=n.query("GET_ALLOW_BROWSE"),i=t||!e;eo(n.element,"disabled",i)},i3=({root:n,action:t})=>{t.value?n.query("GET_TOTAL_ITEMS")===0&&eo(n.element,"required",!0):eo(n.element,"required",!1)},s3=({root:n,action:t})=>{eo(n.element,"capture",!!t.value,t.value===!0?"":t.value)},P2=({root:n})=>{const{element:t}=n;n.query("GET_TOTAL_ITEMS")>0?(eo(t,"required",!1),eo(t,"name",!1)):(eo(t,"name",!0,n.query("GET_NAME")),n.query("GET_CHECK_VALIDITY")&&t.setCustomValidity(""),n.query("GET_REQUIRED")&&eo(t,"required",!0))},hse=({root:n})=>{n.query("GET_CHECK_VALIDITY")&&n.element.setCustomValidity(n.query("GET_LABEL_INVALID_FIELD"))},fse=Un({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:dse,destroy:({root:n})=>{n.element.removeEventListener("change",n.ref.handleChange)},write:ss({DID_LOAD_ITEM:P2,DID_REMOVE_ITEM:P2,DID_THROW_ITEM_INVALID:hse,DID_SET_DISABLED:xC,DID_SET_ALLOW_BROWSE:xC,DID_SET_ALLOW_DIRECTORIES_ONLY:n3,DID_SET_ALLOW_MULTIPLE:t3,DID_SET_ACCEPTED_FILE_TYPES:e3,DID_SET_CAPTURE_METHOD:s3,DID_SET_REQUIRED:i3})}),M2={ENTER:13,SPACE:32},gse=({root:n,props:t})=>{const e=ml("label");Zn(e,"for",`filepond--browser-${t.id}`),Zn(e,"id",`filepond--drop-label-${t.id}`),n.ref.handleKeyDown=i=>{(i.keyCode===M2.ENTER||i.keyCode===M2.SPACE)&&(i.preventDefault(),n.ref.label.click())},n.ref.handleClick=i=>{i.target===e||e.contains(i.target)||n.ref.label.click()},e.addEventListener("keydown",n.ref.handleKeyDown),n.element.addEventListener("click",n.ref.handleClick),r3(e,t.caption),n.appendChild(e),n.ref.label=e},r3=(n,t)=>{n.innerHTML=t;const e=n.querySelector(".filepond--label-action");return e&&Zn(e,"tabindex","0"),t},mse=Un({name:"drop-label",ignoreRect:!0,create:gse,destroy:({root:n})=>{n.ref.label.addEventListener("keydown",n.ref.handleKeyDown),n.element.removeEventListener("click",n.ref.handleClick)},write:ss({DID_SET_LABEL_IDLE:({root:n,action:t})=>{r3(n.ref.label,t.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),pse=Un({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),bse=({root:n})=>{const t=n.rect.element.width*.5,e=n.rect.element.height*.5;n.ref.blob=n.appendChildView(n.createChildView(pse,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:t,translateY:e}))},wse=({root:n,action:t})=>{if(!n.ref.blob){bse({root:n});return}n.ref.blob.translateX=t.position.scopeLeft,n.ref.blob.translateY=t.position.scopeTop,n.ref.blob.scaleX=1,n.ref.blob.scaleY=1,n.ref.blob.opacity=1},vse=({root:n})=>{n.ref.blob&&(n.ref.blob.opacity=0)},yse=({root:n})=>{n.ref.blob&&(n.ref.blob.scaleX=2.5,n.ref.blob.scaleY=2.5,n.ref.blob.opacity=0)},_se=({root:n,props:t,actions:e})=>{Ese({root:n,props:t,actions:e});const{blob:i}=n.ref;e.length===0&&i&&i.opacity===0&&(n.removeChildView(i),n.ref.blob=null)},Ese=ss({DID_DRAG:wse,DID_DROP:yse,DID_END_DRAG:vse}),Sse=Un({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:_se}),o3=(n,t)=>{try{const e=new DataTransfer;t.forEach(i=>{i instanceof File?e.items.add(i):e.items.add(new File([i],i.name,{type:i.type}))}),n.files=e.files}catch{return!1}return!0},Tse=({root:n})=>{n.ref.fields={};const t=document.createElement("legend");t.textContent="Files",n.element.appendChild(t)},CT=(n,t)=>n.ref.fields[t],nM=n=>{n.query("GET_ACTIVE_ITEMS").forEach(t=>{n.ref.fields[t.id]&&n.element.appendChild(n.ref.fields[t.id])})},O2=({root:n})=>nM(n),xse=({root:n,action:t})=>{const s=!(n.query("GET_ITEM",t.id).origin===Kn.LOCAL)&&n.query("SHOULD_UPDATE_FILE_INPUT"),r=ml("input");r.type=s?"file":"hidden",r.name=n.query("GET_NAME"),n.ref.fields[t.id]=r,nM(n)},Ase=({root:n,action:t})=>{const e=CT(n,t.id);if(!e||(t.serverFileReference!==null&&(e.value=t.serverFileReference),!n.query("SHOULD_UPDATE_FILE_INPUT")))return;const i=n.query("GET_ITEM",t.id);o3(e,[i.file])},Cse=({root:n,action:t})=>{n.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout(()=>{const e=CT(n,t.id);
106e&&o3(e,[t.file])},0)},kse=({root:n})=>{n.element.disabled=n.query("GET_DISABLED")},Ise=({root:n,action:t})=>{const e=CT(n,t.id);e&&(e.parentNode&&e.parentNode.removeChild(e),delete n.ref.fields[t.id])},Pse=({root:n,action:t})=>{const e=CT(n,t.id);e&&(t.value===null?e.removeAttribute("value"):e.type!="file"&&(e.value=t.value),nM(n))},Mse=ss({DID_SET_DISABLED:kse,DID_ADD_ITEM:xse,DID_LOAD_ITEM:Ase,DID_REMOVE_ITEM:Ise,DID_DEFINE_VALUE:Pse,DID_PREPARE_OUTPUT:Cse,DID_REORDER_ITEMS:O2,DID_SORT_ITEMS:O2}),Ose=Un({tag:"fieldset",name:"data",create:Tse,write:Mse,ignoreRect:!0}),Dse=n=>"getRootNode"in n?n.getRootNode():document,Rse=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],Lse=["css","csv","html","txt"],Fse={zip:"zip|compressed",epub:"application/epub+zip"},a3=(n="")=>(n=n.toLowerCase(),Rse.includes(n)?"image/"+(n==="jpg"?"jpeg":n==="svg"?"svg+xml":n):Lse.includes(n)?"text/"+n:Fse[n]||""),iM=n=>new Promise((t,e)=>{const i=Use(n);if(i.length&&!Nse(n))return t(i);Bse(n).then(t)}),Nse=n=>n.files?n.files.length>0:!1,Bse=n=>new Promise((t,e)=>{const i=(n.items?Array.from(n.items):[]).filter(s=>Vse(s)).map(s=>Hse(s));if(!i.length){t(n.files?Array.from(n.files):[]);return}Promise.all(i).then(s=>{const r=[];s.forEach(o=>{r.push.apply(r,o)}),t(r.filter(o=>o).map(o=>(o._relativePath||(o._relativePath=o.webkitRelativePath),o)))}).catch(console.error)}),Vse=n=>{if(l3(n)){const t=sM(n);if(t)return t.isFile||t.isDirectory}return n.kind==="file"},Hse=n=>new Promise((t,e)=>{if(Wse(n)){zse(sM(n)).then(t).catch(e);return}t([n.getAsFile()])}),zse=n=>new Promise((t,e)=>{const i=[];let s=0,r=0;const o=()=>{r===0&&s===0&&t(i)},a=l=>{s++;const c=l.createReader(),u=()=>{c.readEntries(d=>{if(d.length===0){s--,o();return}d.forEach(h=>{h.isDirectory?a(h):(r++,h.file(f=>{const p=$se(f);h.fullPath&&(p._relativePath=h.fullPath),i.push(p),r--,o()}))}),u()},e)};u()};a(n)}),$se=n=>{if(n.type.length)return n;const t=n.lastModifiedDate,e=n.name,i=a3(AT(n.name));return i.length&&(n=n.slice(0,n.size,i),n.name=e,n.lastModifiedDate=t),n},Wse=n=>l3(n)&&(sM(n)||{}).isDirectory,l3=n=>"webkitGetAsEntry"in n,sM=n=>n.webkitGetAsEntry(),Use=n=>{let t=[];try{if(t=Gse(n),t.length)return t;t=jse(n)}catch{}return t},jse=n=>{let t=n.getData("url");return typeof t=="string"&&t.length?[t]:[]},Gse=n=>{let t=n.getData("text/html");if(typeof t=="string"&&t.length){const e=t.match(/src\s*=\s*"(.+?)"/);if(e)return[e[1]]}return[]},SE=[],rh=n=>({pageLeft:n.pageX,pageTop:n.pageY,scopeLeft:n.offsetX||n.layerX,scopeTop:n.offsetY||n.layerY}),Yse=(n,t,e)=>{const i=qse(t),s={element:n,filterElement:e,state:null,ondrop:()=>{},onenter:()=>{},ondrag:()=>{},onexit:()=>{},onload:()=>{},allowdrop:()=>{}};return s.destroy=i.addListener(s),s},qse=n=>{const t=SE.find(i=>i.element===n);if(t)return t;const e=Kse(n);return SE.push(e),e},Kse=n=>{const t=[],e={dragenter:Jse,dragover:Zse,dragleave:ere,drop:Qse},i={};xn(e,(r,o)=>{i[r]=o(n,t),n.addEventListener(r,i[r],!1)});const s={element:n,addListener:r=>(t.push(r),()=>{t.splice(t.indexOf(r),1),t.length===0&&(SE.splice(SE.indexOf(s),1),xn(e,o=>{n.removeEventListener(o,i[o],!1)}))})};return s},Xse=(n,t)=>("elementFromPoint"in n||(n=document),n.elementFromPoint(t.x,t.y)),rM=(n,t)=>{const e=Dse(t),i=Xse(e,{x:n.pageX-window.pageXOffset,y:n.pageY-window.pageYOffset});return i===t||t.contains(i)};let c3=null;const v_=(n,t)=>{try{n.dropEffect=t}catch{}},Jse=(n,t)=>e=>{e.preventDefault(),c3=e.target,t.forEach(i=>{const{element:s,onenter:r}=i;rM(e,s)&&(i.state="enter",r(rh(e)))})},Zse=(n,t)=>e=>{e.preventDefault();const i=e.dataTransfer;iM(i).then(s=>{let r=!1;t.some(o=>{const{filterElement:a,element:l,onenter:c,onexit:u,ondrag:d,allowdrop:h}=o;v_(i,"copy");const f=h(s);if(!f){v_(i,"none");return}if(rM(e,l)){if(r=!0,o.state===null){o.state="enter",c(rh(e));return}if(o.state="over",a&&!f){v_(i,"none");return}d(rh(e))}else a&&!r&&v_(i,"none"),o.state&&(o.state=null,u(rh(e)))})})},Qse=(n,t)=>e=>{e.preventDefault();const i=e.dataTransfer;iM(i).then(s=>{t.forEach(r=>{const{filterElement:o,element:a,ondrop:l,onexit:c,allowdrop:u}=r;if(r.state=null,!(o&&!rM(e,a))){if(!u(s))return c(rh(e));l(rh(e),s)}})})},ere=(n,t)=>e=>{c3===e.target&&t.forEach(i=>
106{const{onexit:s}=i;i.state=null,s(rh(e))})},tre=(n,t,e)=>{n.classList.add("filepond--hopper");const{catchesDropsOnPage:i,requiresDropOnElement:s,filterItems:r=u=>u}=e,o=Yse(n,i?document.documentElement:n,s);let a="",l="";o.allowdrop=u=>t(r(u)),o.ondrop=(u,d)=>{const h=r(d);if(!t(h)){c.ondragend(u);return}l="drag-drop",c.onload(h,u)},o.ondrag=u=>{c.ondrag(u)},o.onenter=u=>{l="drag-over",c.ondragstart(u)},o.onexit=u=>{l="drag-exit",c.ondragend(u)};const c={updateHopperState:()=>{a!==l&&(n.dataset.hopperState=l,a=l)},onload:()=>{},ondragstart:()=>{},ondrag:()=>{},ondragend:()=>{},destroy:()=>{o.destroy()}};return c};let AC=!1;const Tf=[],u3=n=>{const t=document.activeElement;if(t&&(/textarea|input/i.test(t.nodeName)||t.getAttribute("contenteditable")==="true")){let i=!1,s=t;for(;s!==document.body;){if(s.classList.contains("filepond--root")){i=!0;break}s=s.parentNode}if(!i)return}iM(n.clipboardData).then(i=>{i.length&&Tf.forEach(s=>s(i))})},nre=n=>{Tf.includes(n)||(Tf.push(n),!AC&&(AC=!0,document.addEventListener("paste",u3)))},ire=n=>{XP(Tf,Tf.indexOf(n)),Tf.length===0&&(document.removeEventListener("paste",u3),AC=!1)},sre=()=>{const n=e=>{t.onload(e)},t={destroy:()=>{ire(n)},onload:()=>{}};return nre(n),t},rre=({root:n,props:t})=>{n.element.id=`filepond--assistant-${t.id}`,Zn(n.element,"role","alert"),Zn(n.element,"aria-live","polite"),Zn(n.element,"aria-relevant","additions")};let D2=null,R2=null;const Jx=[],kT=(n,t)=>{n.element.textContent=t},ore=n=>{n.element.textContent=""},d3=(n,t,e)=>{const i=n.query("GET_TOTAL_ITEMS");kT(n,`${e} ${t}, ${i} ${i===1?n.query("GET_LABEL_FILE_COUNT_SINGULAR"):n.query("GET_LABEL_FILE_COUNT_PLURAL")}`),clearTimeout(R2),R2=setTimeout(()=>{ore(n)},1500)},h3=n=>n.element.parentNode.contains(document.activeElement),are=({root:n,action:t})=>{if(!h3(n))return;n.element.textContent="";const e=n.query("GET_ITEM",t.id);Jx.push(e.filename),clearTimeout(D2),D2=setTimeout(()=>{d3(n,Jx.join(", "),n.query("GET_LABEL_FILE_ADDED")),Jx.length=0},750)},lre=({root:n,action:t})=>{if(!h3(n))return;const e=t.item;d3(n,e.filename,n.query("GET_LABEL_FILE_REMOVED"))},cre=({root:n,action:t})=>{const i=n.query("GET_ITEM",t.id).filename,s=n.query("GET_LABEL_FILE_PROCESSING_COMPLETE");kT(n,`${i} ${s}`)},L2=({root:n,action:t})=>{const i=n.query("GET_ITEM",t.id).filename,s=n.query("GET_LABEL_FILE_PROCESSING_ABORTED");kT(n,`${i} ${s}`)},y_=({root:n,action:t})=>{const i=n.query("GET_ITEM",t.id).filename;kT(n,`${t.status.main} ${i} ${t.status.sub}`)},ure=Un({create:rre,ignoreRect:!0,ignoreRectUpdate:!0,write:ss({DID_LOAD_ITEM:are,DID_REMOVE_ITEM:lre,DID_COMPLETE_ITEM_PROCESSING:cre,DID_ABORT_ITEM_PROCESSING:L2,DID_REVERT_ITEM_PROCESSING:L2,DID_THROW_ITEM_REMOVE_ERROR:y_,DID_THROW_ITEM_LOAD_ERROR:y_,DID_THROW_ITEM_INVALID:y_,DID_THROW_ITEM_PROCESSING_ERROR:y_}),tag:"span",name:"assistant"}),f3=(n,t="-")=>n.replace(new RegExp(`${t}.`,"g"),e=>e.charAt(1).toUpperCase()),g3=(n,t=16,e=!0)=>{let i=Date.now(),s=null;return(...r)=>{clearTimeout(s);const o=Date.now()-i,a=()=>{i=Date.now(),n(...r)};o<t?e||(s=setTimeout(a,t-o)):a()}},dre=1e6,TE=n=>n.preventDefault(),hre=({root:n,props:t})=>{const e=n.query("GET_ID");e&&(n.element.id=e);const i=n.query("GET_CLASS_NAME");i&&i.split(" ").filter(l=>l.length).forEach(l=>{n.element.classList.add(l)}),n.ref.label=n.appendChildView(n.createChildView(mse,{...t,translateY:null,caption:n.query("GET_LABEL_IDLE")})),n.ref.list=n.appendChildView(n.createChildView(cse,{translateY:null})),n.ref.panel=n.appendChildView(n.createChildView(QH,{name:"panel-root"})),n.ref.assistant=n.appendChildView(n.createChildView(ure,{...t})),n.ref.data=n.appendChildView(n.createChildView(Ose,{...t})),n.ref.measure=ml("div"),n.ref.measure.style.height="100%",n.element.appendChild(n.ref.measure),n.ref.bounds=null,n.query("GET_STYLES").filter(l=>!gl(l.value)).map(({name:l,value:c})=>{n.element.dataset[l]=c}),n.ref.widthPrevious=null,n.ref.widthUpdated=g3(()=>{n.ref.updateHistory=[],n.dispatch("DID_RESIZE_ROOT")},250),n.ref.previousAspectRatio=null,n.ref.updateHistory=[];const s=window.matchMedia("(pointer: fine) and (hover: hover)").matches,r
vendor: 4,229 bytes, line 106
106="PointerEvent"in window;n.query("GET_ALLOW_REORDER")&&r&&!s&&(n.element.addEventListener("touchmove",TE,{passive:!1}),n.element.addEventListener("gesturestart",TE));const o=n.query("GET_CREDITS");if(o.length===2){const l=document.createElement("a");l.className="filepond--credits",l.href=o[0],l.tabIndex=-1,l.target="_blank",l.rel="noopener noreferrer nofollow",l.textContent=o[1],n.element.appendChild(l),n.ref.credits=l}},fre=({root:n,props:t,actions:e})=>{if(wre({root:n,props:t,actions:e}),e.filter(P=>/^DID_SET_STYLE_/.test(P.type)).filter(P=>!gl(P.data.value)).map(({type:P,data:k})=>{const D=f3(P.substring(8).toLowerCase(),"_");n.element.dataset[D]=k.value,n.invalidateLayout()}),n.rect.element.hidden)return;n.rect.element.width!==n.ref.widthPrevious&&(n.ref.widthPrevious=n.rect.element.width,n.ref.widthUpdated());let i=n.ref.bounds;i||(i=n.ref.bounds=pre(n),n.element.removeChild(n.ref.measure),n.ref.measure=null);const{hopper:s,label:r,list:o,panel:a}=n.ref;s&&s.updateHopperState();const l=n.query("GET_PANEL_ASPECT_RATIO"),c=n.query("GET_ALLOW_MULTIPLE"),u=n.query("GET_TOTAL_ITEMS"),d=c?n.query("GET_MAX_FILES")||dre:1,h=u===d,f=e.find(P=>P.type==="DID_ADD_ITEM");if(h&&f){const P=f.data.interactionMethod;r.opacity=0,c?r.translateY=-40:P===yr.API?r.translateX=40:P===yr.BROWSE?r.translateY=40:r.translateY=30}else h||(r.opacity=1,r.translateX=0,r.translateY=0);const p=gre(n),v=mre(n),E=r.rect.element.height,x=!c||h?0:E,A=h?o.rect.element.marginTop:0,O=u===0?0:o.rect.element.marginBottom,I=x+A+v.visual+O,T=x+A+v.bounds+O;if(o.translateY=Math.max(0,x-o.rect.element.marginTop)-p.top,l){const P=n.rect.element.width,k=P*l;l!==n.ref.previousAspectRatio&&(n.ref.previousAspectRatio=l,n.ref.updateHistory=[]);const D=n.ref.updateHistory;D.push(P);const U=2;if(D.length>U*2){const K=D.length,j=K-10;let L=0;for(let N=K;N>=j;N--)if(D[N]===D[N-2]&&L++,L>=U)return}a.scalable=!1,a.height=k;const Y=k-x-(O-p.bottom)-(h?A:0);v.visual>Y?o.overflow=Y:o.overflow=null,n.height=k}else if(i.fixedHeight){a.scalable=!1;const P=i.fixedHeight-x-(O-p.bottom)-(h?A:0);v.visual>P?o.overflow=P:o.overflow=null}else if(i.cappedHeight){const P=I>=i.cappedHeight,k=Math.min(i.cappedHeight,I);a.scalable=!0,a.height=P?k:k-p.top-p.bottom;const D=k-x-(O-p.bottom)-(h?A:0);I>i.cappedHeight&&v.visual>D?o.overflow=D:o.overflow=null,n.height=Math.min(i.cappedHeight,T-p.top-p.bottom)}else{const P=u>0?p.top+p.bottom:0;a.scalable=!0,a.height=Math.max(E,I-P),n.height=Math.max(E,T-P)}n.ref.credits&&a.heightCurrent&&(n.ref.credits.style.transform=`translateY(${a.heightCurrent}px)`)},gre=n=>{const t=n.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}},mre=n=>{let t=0,e=0;const i=n.ref.list,s=i.childViews[0],r=s.childViews.filter(A=>A.rect.element.height),o=n.query("GET_ACTIVE_ITEMS").map(A=>r.find(O=>O.id===A.id)).filter(A=>A);if(o.length===0)return{visual:t,bounds:e};const a=s.rect.element.width,l=tM(s,o,i.dragCoordinates),c=o[0].rect.element,u=c.marginTop+c.marginBottom,d=c.marginLeft+c.marginRight,h=c.width+d,f=c.height+u,p=typeof l<"u"&&l>=0?1:0,v=o.find(A=>A.markedForRemoval&&A.opacity<.45)?-1:0,E=o.length+p+v,x=eM(a,h);return x===1?o.forEach(A=>{const O=A.rect.element.height+u;e+=O,t+=O*A.opacity}):(e=Math.ceil(E/x)*f,t=e),{visual:t,bounds:e}},pre=n=>{const t=n.ref.measureHeight||null;return{cappedHeight:parseInt(n.style.maxHeight,10)||null,fixedHeight:t===0?null:t}},oM=(n,t)=>{const e=n.query("GET_ALLOW_REPLACE"),i=n.query("GET_ALLOW_MULTIPLE"),s=n.query("GET_TOTAL_ITEMS");let r=n.query("GET_MAX_FILES");const o=t.length;return!i&&o>1?(n.dispatch("DID_THROW_MAX_FILES",{source:t,error:Rn("warning",0,"Max files")}),!0):(r=i?r:1,!i&&e?!1:Dm(r)&&s+o>r?(n.dispatch("DID_THROW_MAX_FILES",{source:t,error:Rn("warning",0,"Max files")}),!0):!1)},bre=(n,t,e)=>{const i=n.childViews[0];return tM(i,t,{left:e.scopeLeft-i.rect.element.left,top:e.scopeTop-(n.rect.outer.top+n.rect.element.marginTop+n.rect.element.scrollTop)})},F2=n=>{const t=n.query("GET_ALLOW_DROP"),e=n.query("GET_DISABLED"),i=t&&!e;if(i&&!n.ref.hopper){const s=tre(n.element,r=>{const o=n.query("GET_BEFORE_DROP_FILE")||(()=>!0);return n.query("GET_DROP_VALIDATION")?r.every(l=>
106Eh("ALLOW_HOPPER_ITEM",l,{query:n.query}).every(c=>c===!0)&&o(l)):!0},{filterItems:r=>{const o=n.query("GET_IGNORED_FILES");return r.filter(a=>sh(a)?!o.includes(a.name.toLowerCase()):!0)},catchesDropsOnPage:n.query("GET_DROP_ON_PAGE"),requiresDropOnElement:n.query("GET_DROP_ON_ELEMENT")});s.onload=(r,o)=>{const l=n.ref.list.childViews[0].childViews.filter(u=>u.rect.element.height),c=n.query("GET_ACTIVE_ITEMS").map(u=>l.find(d=>d.id===u.id)).filter(u=>u);Kr("ADD_ITEMS",r,{dispatch:n.dispatch}).then(u=>{if(oM(n,u))return!1;n.dispatch("ADD_ITEMS",{items:u,index:bre(n.ref.list,c,o),interactionMethod:yr.DROP})}),n.dispatch("DID_DROP",{position:o}),n.dispatch("DID_END_DRAG",{position:o})},s.ondragstart=r=>{n.dispatch("DID_START_DRAG",{position:r})},s.ondrag=g3(r=>{n.dispatch("DID_DRAG",{position:r})}),s.ondragend=r=>{n.dispatch("DID_END_DRAG",{position:r})},n.ref.hopper=s,n.ref.drip=n.appendChildView(n.createChildView(Sse))}else!i&&n.ref.hopper&&(n.ref.hopper.destroy(),n.ref.hopper=null,n.removeChildView(n.ref.drip))},N2=(n,t)=>{const e=n.query("GET_ALLOW_BROWSE"),i=n.query("GET_DISABLED"),s=e&&!i;s&&!n.ref.browser?n.ref.browser=n.appendChildView(n.createChildView(fse,{...t,onload:r=>{Kr("ADD_ITEMS",r,{dispatch:n.dispatch}).then(o=>{if(oM(n,o))return!1;n.dispatch("ADD_ITEMS",{items:o,index:-1,interactionMethod:yr.BROW
vendor: 5,558 bytes, line 106
106SE})})}}),0):!s&&n.ref.browser&&(n.removeChildView(n.ref.browser),n.ref.browser=null)},B2=n=>{const t=n.query("GET_ALLOW_PASTE"),e=n.query("GET_DISABLED"),i=t&&!e;i&&!n.ref.paster?(n.ref.paster=sre(),n.ref.paster.onload=s=>{Kr("ADD_ITEMS",s,{dispatch:n.dispatch}).then(r=>{if(oM(n,r))return!1;n.dispatch("ADD_ITEMS",{items:r,index:-1,interactionMethod:yr.PASTE})})}):!i&&n.ref.paster&&(n.ref.paster.destroy(),n.ref.paster=null)},wre=ss({DID_SET_ALLOW_BROWSE:({root:n,props:t})=>{N2(n,t)},DID_SET_ALLOW_DROP:({root:n})=>{F2(n)},DID_SET_ALLOW_PASTE:({root:n})=>{B2(n)},DID_SET_DISABLED:({root:n,props:t})=>{F2(n),B2(n),N2(n,t),n.query("GET_DISABLED")?n.element.dataset.disabled="disabled":n.element.removeAttribute("data-disabled")}}),vre=Un({name:"root",read:({root:n})=>{n.ref.measure&&(n.ref.measureHeight=n.ref.measure.offsetHeight)},create:hre,write:fre,destroy:({root:n})=>{n.ref.paster&&n.ref.paster.destroy(),n.ref.hopper&&n.ref.hopper.destroy(),n.element.removeEventListener("touchmove",TE),n.element.removeEventListener("gesturestart",TE)},mixins:{styles:["height"]}}),yre=(n={})=>{let t=null;const e=EE(),i=Nte(Ene(e),[Hne,xne(e)],[die,Tne(e)]);i.dispatch("SET_OPTIONS",{options:n});const s=()=>{document.hidden||i.dispatch("KICK")};document.addEventListener("visibilitychange",s);let r=null,o=!1,a=!1,l=null,c=null;const u=()=>{o||(o=!0),clearTimeout(r),r=setTimeout(()=>{o=!1,l=null,c=null,a&&(a=!1,i.dispatch("DID_STOP_RESIZE"))},500)};window.addEventListener("resize",u);const d=vre(i,{id:KP()});let h=!1,f=!1;const p={_read:()=>{o&&(c=window.innerWidth,l||(l=c),!a&&c!==l&&(i.dispatch("DID_START_RESIZE"),a=!0)),f&&h&&(h=d.element.offsetParent===null),!h&&(d._read(),f=d.rect.element.hidden)},_write:_=>{const C=i.processActionQueue().filter(B=>!/^SET_/.test(B.type));h&&!C.length||(A(C),h=d._write(_,C,a),kne(i.query("GET_ITEMS")),h&&i.processDispatchQueue())}},v=_=>C=>{const B={type:_};if(!C)return B;if(C.hasOwnProperty("error")&&(B.error=C.error?{...C.error}:null),C.status&&(B.status={...C.status}),C.file&&(B.output=C.file),C.source)B.file=C.source;else if(C.item||C.id){const $=C.item?C.item:i.query("GET_ITEM",C.id);B.file=$?gs($):null}return C.items&&(B.items=C.items.map(gs)),/progress/.test(_)&&(B.progress=C.progress),C.hasOwnProperty("origin")&&C.hasOwnProperty("target")&&(B.origin=C.origin,B.target=C.target),B},E={DID_DESTROY:v("destroy"),DID_INIT:v("init"),DID_THROW_MAX_FILES:v("warning"),DID_INIT_ITEM:v("initfile"),DID_START_ITEM_LOAD:v("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:v("addfileprogress"),DID_LOAD_ITEM:v("addfile"),DID_THROW_ITEM_INVALID:[v("error"),v("addfile")],DID_THROW_ITEM_LOAD_ERROR:[v("error"),v("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[v("error"),v("removefile")],DID_PREPARE_OUTPUT:v("preparefile"),DID_START_ITEM_PROCESSING:v("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:v("processfileprogress"),DID_ABORT_ITEM_PROCESSING:v("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:v("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:v("processfiles"),DID_REVERT_ITEM_PROCESSING:v("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[v("error"),v("processfile")],DID_REMOVE_ITEM:v("removefile"),DID_UPDATE_ITEMS:v("updatefiles"),DID_ACTIVATE_ITEM:v("activatefile"),DID_REORDER_ITEMS:v("reorderfiles")},x=_=>{const C={pond:m,..._};delete C.type,d.element.dispatchEvent(new CustomEvent(`FilePond:${_.type}`,{detail:C,bubbles:!0,cancelable:!0,composed:!0}));const B=[];_.hasOwnProperty("error")&&B.push(_.error),_.hasOwnProperty("file")&&B.push(_.file);const $=["type","error","file"];Object.keys(_).filter(Z=>!$.includes(Z)).forEach(Z=>B.push(_[Z])),m.fire(_.type,...B);const X=i.query(`GET_ON${_.type.toUpperCase()}`);X&&X(...B)},A=_=>{_.length&&_.filter(C=>E[C.type]).forEach(C=>{const B=E[C.type];(Array.isArray(B)?B:[B]).forEach($=>{C.type==="DID_INIT_ITEM"?x($(C.data)):setTimeout(()=>{x($(C.data))},0)})})},O=_=>i.dispatch("SET_OPTIONS",{options:_}),I=_=>i.query("GET_ACTIVE_ITEM",_),T=_=>new Promise((C,B)=>{i.dispatch("REQUEST_ITEM_PREPARE",{query:_,success:$=>{C($)},failure:$=>{B($)}})}),P=(_,C={})=>new Promise((B,$)=>{U([{source:_,options:C}],{index:C.index}).then(X=>B(X&&X[0])).catch($)}),k=_=>_.file&&_.id,D=(_,C)=>(typeof _=="object"&&!k(_)&&!C&&(C=_,_=void 0),i.dispatch("REMOVE_ITEM",{...C,query:_}),i.query("GET_ACTIVE_ITEM",_)===null),U=(..._)=>new Promise((C,B)=>{const $=[],X={};if(ET(_[0]))$.push.apply($,_[0]),Object.assign(X,_[1]||{});else{const Z=_[_.length-1];typeof Z=="object"&&!(Z instanceof Blob)&&Object.assign(X,_.pop()),$.push(..._)}i.dispatch("ADD_ITEMS",{items:$,index:X.index,interactionMethod:yr.API,success:C,failure:B})}),Y=()=>i.query("GET_ACTIVE_ITEMS"),K=_=>new Promise((C,B)=>{i.dispatch("REQUEST_ITEM_PROCESSING",{query:_,success:$=>{C($)},failure:$=>{B($)}})}),j=(..._)=>{const C=Array.isArray(_[0])?_[0]:_,B=C.length?C:Y();return Promise.all(B.map(T))},L=(..._)=>{const C=Array.isArray(_[0])?_[0]:_;if(!C.length){const B=Y().filter($=>!($.status===st.IDLE&&$.origin===Kn.LOCAL)&&$.status!==st.PROCESSING&&$.status!==st.PROCESSING_COMPLETE&&$.status!==st.PROCESSING_REVERT_ERROR);return Promise.all(B.map(K))}return Promise.all(C.map(K))},N=(..._)=>{const C=Array.isArray(_[0])?_[0]:_;let B;typeof C[C.length-1]=="object"?B=C.pop():Array.isArray(_[0])&&(B=_[1]);const $=Y();return C.length?C.map(Z=>Pu(Z)?$[Z]?$[Z].id:null:Z).filter(Z=>Z).map(Z=>D(Z,B)):Promise.all($.map(Z=>D(Z,B)))},m={...xT(),...p,...Sne(i,e),setOptions:O,addFile:P,addFiles:U,getFile:I,processFile:K,prepareFile:T,removeFile:D,moveFile:(_,C)=>i.dispatch("MOVE_ITEM",{query:_,index:C}
106),getFiles:Y,processFiles:L,removeFiles:N,prepareFiles:j,sort:_=>i.dispatch("SORT",{compare:_}),browse:()=>{var _=d.element.querySelector("input[type=file]");_&&_.click()},destroy:()=>{m.fire("destroy",d.element),i.dispatch("ABORT_ALL"),d._destroy(),window.removeEventListener("resize",u),document.removeEventListener("visibilitychange",s),i.dispatch("DID_DESTROY")},insertBefore:_=>a2(d.element,_),insertAfter:_=>l2(d.element,_),appendTo:_=>_.appendChild(d.element),replaceElement:_=>{a2(d.element,_),_.parentNode.removeChild(_),t=_},restoreElement:()=>{t&&(l2(t,d.element),d.element.parentNode.removeChild(d.element),t=null)},isAttachedTo:_=>d.element===_||t===_,element:{get:()=>d.element},status:{get:()=>i.query("GET_STATUS")}};return i.dispatch("DID_INIT"),Mc(m)},m3=(n={})=>{const t={};return xn(EE(),(i,s)=>{t[i]=s[0]}),yre({...t,...n})},_re=n=>n.charAt(0).toLowerCase()+n.slice(1),Ere=n=>f3(n.replace(/^data-/,"")),p3=(n,t)=>{xn(t,(e,i)=>{xn(n,(s,r)=>{const o=new RegExp(e);if(!o.test(s)||(delete n[s],i===!1))return;if(ns(i)){n[i]=r;return}const l=i.group;ci(i)&&!n[l]&&(n[l]={}),n[l][_re(s.replace(o,""))]=r}),i.mapping&&p3(n[i.group],i.mapping)})},Sre=(n,t={})=>{const e=[];xn(n.attributes,s=>{e.push(n.attributes[s])});const i=e.filter(s=>s.name).reduce((s,r)=>{const o=Zn(n,r.name);return s[Ere(r.name)]=o===r.name?!0:o,s},{});return p3(i,t),i},Tre=(n,t={})=>{const e={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};Eh("SET_ATTRIBUTE_TO_OPTION_MAP",e);const i={...t},s=Sre(n.nodeName==="FIELDSET"?n.querySelector("input[type=file]"):n,e);Object.keys(s).forEach(o=>{ci(s[o])?(ci(i[o])||(i[o]={}),Object.assign(i[o],s[o])):i[o]=s[o]}),i.files=(t.files||[]).concat(Array.from(n.querySelectorAll("input:not([type=file])")).map(o=>({source:o.value,options:{type:o.dataset.type}})));const r=m3(i);return n.files&&Array.from(n.files).forEach(o=>{r.addFile(o)}),r.replaceElement(n),r},xre=(...n)=>Fte(n[0])?Tre(...n):m3(...n),Are=["fire","_read","_write"],V2=n=>{const t={};return NH(n,t,Are),t},Cre=(n,t)=>n.replace(/(?:{([a-zA-Z]+)})/g,(e,i)=>t[i]),kre=n=>{const t=new Blob(["(",n.toString(),")()"],{type:"application/javascript"}),e=URL.createObjectURL(t),i=new Worker(e);return{transfer:(s,r)=>{},post:(s,r,o)=>{const a=KP();i.onmessage=l=>{l.data.id===a&&r(l.data.message)},i.postMessage({id:a,message:s},o)},terminate:()=>{i.terminate(),URL.revokeObjectURL(e)}}},Ire=n=>new Promise((t,e)=>{const i=new Image;i.onload=()=>{t(i)},i.onerror=s=>{e(s)},i.src=n}),b3=(n,t)=>{const e=n.slice(0,n.size,n.type);return e.lastModifiedDate=n.lastModifiedDate,e.name=t,e},Pre=n=>b3(n,n.name),H2=[],Mre=n=>{if(H2.includes(n))return;H2.push(n);const t=n({addFilter:Pne,utils:{Type:pe,forin:xn,isString:ns,isFile:sh,toNaturalFileSize:XH,replaceInString:Cre,getExtensionFromFilename:AT,getFilenameWithoutExtension:YH,guesstimateMimeType:a3,getFileFromBlob:hm,getFilenameFromURL:Ay,createRoute:ss,createWorker:kre,createView:Un,createItemAPI:gs,loadImage:Ire,copyFile:Pre,renameFile:b3,createBlob:UH,applyFilterChain:Kr,text:Fn,getNumericAspectRatioFromString:HH},views:{fileActionButton:KH}});Mne(t.options)},Ore=()=>Object.prototype.toString.call(window.operamini)==="[object OperaMini]",Dre=()=>"Promise"in window,Rre=()=>"slice"in Blob.prototype,Lre=()=>"URL"in window&&"createObjectURL"in window.URL,Fre=()=>"visibilityState"in document,Nre=()=>"performance"in window,Bre=()=>"supports"in(window.CSS||{}),Vre=()=>/MSIE|Trident/.test(window.navigator.userAgent),CC=(()=>{const n=MH()&&!Ore()&&Fre()&&Dre()&&Rre()&&Lre()&&Nre()&&(Bre()||Vre());return()=>n})(),Ml={apps:[]},Hre="filepond",Sh=()=>{};let w3={},v3={},y3={},kC={},l0=Sh,c0=Sh,IC=Sh,PC=Sh,fm=Sh,MC=Sh,OC=Sh;if(CC()){lne(()=>{Ml.apps.forEach(e=>e._read())},e=>{Ml.apps.forEach(i=>i._write(e))});const n=()=>{document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:CC,create:l0,destroy:c0,parse:IC,find:PC,registerPlugin:fm,setOptions:OC}})),document.removeEventListener("DOMContentLoaded",n)};document.readyState!=="loading"?setTimeout(()=>n(),0):document.addEventListener("DOMContentLoaded",n);const t=()=>xn(EE(),(e,i)=>{kC[e]=i[1]});w3={...zH},y3={...Kn},v3={...st},kC={},t(),l0=(...e)=>{const i=xre(...e);return i.on("destroy",c0),Ml.apps.push(i),V2(i)},c0=e=>{const i=Ml.apps.findIndex(s=>s.isAttachedTo(e));return i>=0?(Ml.apps.splice(i,1)[0].restoreElement(),!0):!1},IC=e=>Array.from(e.querySelectorAll(`.${Hre}`)).filter(r=>!Ml.apps.find(o=>o.isAttachedTo(r))).map(r=>l0(r)),PC=e=>{const i=Ml.apps.find(s=>s.isAttachedTo(e));return i?V2(i):null},fm=(...e)=>{e.forEach(Mre),t()},MC=()=>{const e={};return xn(EE(),(i,s)=>{e[i]=s[0]}),e},OC=e=>(ci(e)&&(Ml.apps.forEach(i=>
106{i.setOptions(e)}),One(e)),MC())}const zre=Object.freeze(Object.defineProperty({__proto__:null,get FileOrigin(){return y3},get FileStatus(){return v3},get OptionTypes(){return kC},get Status(){return w3},get create(){return l0},get destroy(){return c0},get find(){return PC},get getOptions(){return MC},get parse(){return IC},get registerPlugin(){return fm},get setOptions(){return OC},supported:CC},Symbol.toStringTag,{value:"Module"}));/*! 107 * FilePondPluginFileValidateSize 2.2.8 108 * Licensed under MIT, https://opensource.org/licenses/MIT/ 109 * Please visit https://pqina.nl/filepond/ for details. 110 */const _3=({addFilter:n,utils:t})=>{const{Type:e,replaceInString:i,toNaturalFileSize:s}=t;return n("ALLOW_HOPPER_ITEM",(r,{query:o})=>{if(!o("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;const a=o("GET_MAX_FILE_SIZE");if(a!==null&&r.size>a)return!1;const l=o("GET_MIN_FILE_SIZE");return!(l!==null&&r.size<l)}),n("LOAD_FILE",(r,{query:o})=>new Promise((a,l)=>{if(!o("GET_ALLOW_FILE_SIZE_VALIDATION"))return a(r);const c=o("GET_FILE_VALIDATE_SIZE_FILTER");if(c&&!c(r))return a(r);const u=o("GET_MAX_FILE_SIZE");if(u!==null&&r.size>u){l({status:{main:o("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:i(o("GET_LABEL_MAX_FILE_SIZE"),{filesize:s(u,".",o("GET_FILE_SIZE_BASE"),o("GET_FILE_SIZE_LABELS",o))})}});return}const d=o("GET_MIN_FILE_SIZE");if(d!==null&&r.size<d){l({status:{main:o("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:i(o("GET_LABEL_MIN_FILE_SIZE"),{filesize:s(d,".",o("GET_FILE_SIZE_BASE"),o("GET_FILE_SIZE_LABELS",o))})}});return}const h=o("GET_MAX_TOTAL_FILE_SIZE");if(h!==null&&o("GET_ACTIVE_ITEMS").reduce((p,v)=>p+v.fileSize,0)>h){l({status:{main:o("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:i(o("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:s(h,".",o("GET_FILE_SIZE_BASE"),o("GET_FILE_SIZE_LABELS",o))})}});return}a(r)})),{options:{allowFileSizeValidation:[!0,e.BOOLEAN],maxFileSize:[null,e.INT],minFileSize:[null,e.INT],maxTotalFileSize:[null,e.INT],fileValidateSizeFilter:[null,e.FUNCTION],labelMinFileSizeExceeded:["File is too small",e.STRING],labelMinFileSize:["Minimum file size is {filesize}",e.STRING],labelMaxFileSizeExceeded:["File is too large",e.STRING],labelMaxFileSize:["Maximum file size is {filesize}",e.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",e.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",e.STRING]}}},$re=typeof window<"u"&&typeof window.document<"u";$re&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_3}));/*! 111 * FilePondPluginFileValidateType 1.2.9 112 * Licensed under MIT, https://opensource.org/licenses/MIT/ 113 * Please visit https://pqina.nl/filepond/ for details. 114 */const E3=({addFilter:n,utils:t})=>{const{Type:e,isString:i,replaceInString:s,guesstimateMimeType:r,getExtensionFromFilename:o,getFilenameFromURL:a}=t,l=(f,p)=>{const v=(/^[^/]+/.exec(f)||[]).pop(),E=p.slice(0,-2);return v===E},c=(f,p)=>f.some(v=>/\*$/.test(v)?l(p,v):v===p),u=f=>{let p="";if(i(f)){const v=a(f),E=o(v);E&&(p=r(E))}else p=f.type;return p},d=(f,p,v)=>{if(p.length===0)return!0;const E=u(f);return v?new Promise((x,A)=>{v(f,E).then(O=>{c(p,O)?x():A()}).catch(A)}):c(p,E)},h=f=>p=>f[p]===null?!1:f[p]||p;return n("SET_ATTRIBUTE_TO_OPTION_MAP",f=>Object.assign(f,{accept:"acceptedFileTypes"})),n("ALLOW_HOPPER_ITEM",(f,{query:p})=>p("GET_ALLOW_FILE_TYPE_VALIDATION")?d(f,p("GET_ACCEPTED_FILE_TYPES")):!0),n("LOAD_FILE",(f,{query:p})=>new Promise((v,E)=>{if(!p("GET_ALLOW_FILE_TYPE_VALIDATION")){v(f);return}const x=p("GET_ACCEPTED_FILE_TYPES"),A=p("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),O=d(f,x,A),I=()=>{const T=x.map(h(p("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"))).filter(k=>k!==!1),P=T.filter((k,D)=>T.indexOf(k)===D);E({status:{main:p("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:s(p("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:P.join(", "),allButLastType:P.slice(0,-1).join(", "),lastType:P[P.length-1]})}})};if(typeof O=="boolean")return O?v(f):I();O.then(()=>{v(f)}).catch(I)})),{options:{allowFileTypeValidation:[!0,e.BOOLEAN],acceptedFileTypes:[[],e.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",e.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",e.STRING],fileValidateTypeLabelExpectedTypesMap:[{},e.OBJECT],fileValidateTypeDetectType:[null,e.FUNCTION]}}},Wre=typeof window<"u"&&typeof window.document<"u";Wre&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:E3}));/*! 115 * FilePondPluginImagePreview 4.6.12 116 * Licensed under MIT, https://opensource.org/licenses/MIT/ 117 * Please visit https://pqina.nl/filepond/ for details. 118 */const Ure=n=>/^image/.test(n.type),z2=(n,t)=>Mb(n.x*t,n.y*t),$2=(n,t)=>Mb(n.x+t.x,n.y+t.y),jre=n=>{const t=Math.sqrt(n.x*n.x+n.y*n.y);return t===0?{x:0,y:0}:Mb(n.x/t,n.y/t)},__=(n,t,e)=>{const i=Math.cos(t),s=Math.sin(t),r=Mb(n.x-e.x,n.y-e.y);return Mb(e.x+i*r.x-s*r.y,e.y+s*r.x+i*r.y)},Mb=(n=0,t=0)=>({x:n,y:t}),ps=(n,t,e=1,i)=>{if(typeof n=="string")return parseFloat(n)*e;if(typeof n=="number")return n*(i?t[i]:Math.min(t.width,t.height))},Gre=(n,t,e)=>{const i=n.borderStyle||n.lineStyle||"solid",s=n.backgroundColor||n.fontColor||"transparent",r=n.borderColor||n.lineColor||"transparent",o=ps(n.borderWidth||n.lineWidth,t,e),a=n.lineCap||"round",l=n.lineJoin||"round",c=typeof i=="string"?"":i.map(d=>ps(d,t,e)).join(","),u=n.opacity||1;return{"stroke-linecap":a,"stroke-linejoin":l,"stroke-width":o||0,"stroke-dasharray":c,stroke:r,fill:s,opacity:u}},ar=n=>n!=null,Yre=(n,t,e=1)=>{let i=ps(n.x,t,e,"width")||ps(n.left,t,e,"width"),s=ps(n.y,t,e,"height")||ps(n.top,t,e,"height"),r=ps(n.width,t,e,"width"),o=ps(n.height,t,e,"height"),a=ps(n.right,t,e,"width"),l=ps(n.bottom,t,e,"height");return ar(s)||(ar(o)&&ar(l)?s=t.height-o-l:s=l),ar(i)||(ar(r)&&ar(a)?i=t.width-r-a:i=a),ar(r)||(ar(i)&&ar(a)?r=t.width-i-a:r=0),ar(o)||(ar(s)&&ar(l)?o=t.height-s-l:o=0),{x:i||
1180,y:s||0,width:r||0,height:o||0}},qre=n=>n.map((t,e)=>`${e===0?"M":"L"} ${t.x} ${t.y}`).join(" "),qo=(n,t)=>Object.keys(t).forEach(e=>n.setAttribute(e,t[e])),Kre="http://www.w3.org/2000/svg",df=(n,t)=>{const e=document.createElementNS(Kre,n);return t&&qo(e,t),e},Xre=n=>qo(n,{...n.rect,...n.styles}),Jre=n=>{const t=n.rect.x+n.rect.width*.5,e=n.rect.y+n.rect.height*.5,i=n.rect.width*.5,s=n.rect.height*.5;return qo(n,{cx:t,cy:e,rx:i,ry:s,...n.styles})},Zre={contain:"xMidYMid meet",cover:"xMidYMid slice"},Qre=(n,t)=>{qo(n,{...n.rect,...n.styles,preserveAspectRatio:Zre[t.fit]||"none"})},eoe={left:"start",center:"middle",right:"end"},toe=(n,t,e,i)=>{const s=ps(t.fontSize,e,i),r=t.fontFamily||"sans-serif",o=t.fontWeight||"normal",a=eoe[t.textAlign]||"start";qo(n,{...n.rect,...n.styles,"stroke-width":0,"font-weight":o,"font-size":s,"font-family":r,"text-anchor":a}),n.text!==t.text&&(n.text=t.text,n.textContent=t.text.length?t.text:" ")},noe=(n,t,e,i)=>{qo(n,{...n.rect,...n.styles,fill:"none"});const s=n.childNodes[0],r=n.childNodes[1],o=n.childNodes[2],a=n.rect,l={x:n.rect.x+n.rect.width,y:n.rect.y+n.rect.height};if(qo(s,{x1:a.x,y1:a.y,x2:l.x,y2:l.y}),!t.lineDecoration)return;r.style.display="none",o.style.display="none";const c=jre({x:l.x-a.x,y:l.y-a.y}),u=ps(.05,e,i);if(t.lineDecoration.indexOf("arrow-begin")!==-1){const d=z2(c,u),h=$2(a,d),f=__(a,2,h),p=__(a,-2,h);qo(r,{style:"display:block;",d:`M${f.x},${f.y} L${a.x},${a.y} L${p.x},${p.y}`})}if(t.lineDecoration.indexOf("arrow-end")!==-1){const d=z2(c,-u),h=$2(l,d),f=__(l,2,h),p=__(l,-2,h);qo(o,{style:"display:block;",d:`M${f.x},${f.y} L${l.x},${l.y} L${p.x},${p.y}`})}},ioe=(n,t,e,i)=>{qo(n,{...n.styles,fill:"none",d:qre(t.points.map(s=>({x:ps(s.x,e,i,"width"),y:ps(s.y,e,i,"height")})))})},E_=n=>t=>df(n,{id:t.id}),soe=n=>{const t=df("image",{id:n.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=()=>{t.setAttribute("opacity",n.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n.src),t},roe=n=>{const t=df("g",{id:n.id,"stroke-linecap":"round","stroke-linejoin":"round"}),e=df("line");t.appendChild(e);const i=df("path");t.appendChild(i);const s=df("path");return t.appendChild(s),t},ooe={image:soe,rect:E_("rect"),ellipse:E_("ellipse"),text:E_("text"),path:E_("path"),line:roe},aoe={rect:Xre,ellipse:Jre,image:Qre,text:toe,path:ioe,line:noe},loe=(n,t)=>ooe[n](t),coe=(n,t,e,i,s)=>{t!=="path"&&(n.rect=Yre(e,i,s)),n.styles=Gre(e,i,s),aoe[t](n,e,i,s)},uoe=["x","y","left","top","right","bottom","width","height"],doe=n=>typeof n=="string"&&/%/.test(n)?parseFloat(n)/100:n,hoe=n=>{const[t,e]=n,i=e.points?{}:uoe.reduce((s,r)=>(s[r]=doe(e[r]),s),{});return[t,{zIndex:0,...e,...i}]},foe=(n,t)=>n[1].zIndex>t[1].zIndex?1:n[1].zIndex<t[1].zIndex?-1:0,goe=n=>n.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:({root:t,props:e})=>{if(!e.dirty)return;const{crop:i,resize:s,markup:r}=e,o=e.width,a=e.height;let l=i.width,c=i.height;if(s){const{size:f}=s;let p=f&&f.width,v=f&&f.height;const E=s.mode,x=s.upscale;p&&!v&&(v=p),v&&!p&&(p=v);const A=l<p&&c<v;if(!A||A&&x){let O=p/l,I=v/c;if(E==="force")l=p,c=v;else{let T;E==="cover"?T=Math.max(O,I):E==="contain"&&(T=Math.min(O,I)),l=l*T,c=c*T}}}const u={width:o,height:a};t.element.setAttribute("width",u.width),t.element.setAttribute("height",u.height);const d=Math.min(o/l,a/c);t.element.innerHTML="";const h=t.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");r.filter(h).map(hoe).sort(foe).forEach(f=>{const[p,v]=f,E=loe(p,v);coe(E,p,v,u,d),t.element.appendChild(E)})}}),ib=(n,t)=>({x:n,y:t}),moe=(n,t)=>n.x*t.x+n.y*t.y,W2=(n,t)=>ib(n.x-t.x,n.y-t.y),poe=(n,t)=>moe(W2(n,t),W2(n,t)),U2=(n,t)=>Math.sqrt(poe(n,t)),j2=(n,t)=>{const e=n,i=1.5707963267948966,s=t,r=1.5707963267948966-t,o=Math.sin(i),a=Math.sin(s),l=Math.sin(r),c=Math.cos(r),u=e/o,d=u*a,h=u*l;return ib(c*d,c*h)},boe=(n,t)=>{const e=n.width,i=n.height,s=j2(e,t),r=j2(i,t),o=ib(n.x+Math.abs(s.x),n.y-Math.abs(s.y)),a=ib(n.x+n.width+Math.abs(r.y),n.y+Math.abs(r.x)),l=ib(n.x-Math.abs(r.y),n.y+n.height-Math.abs(r.x));return{width:U2(o,a),height:U2(o,l)}},woe=(n,t,e=1)=>{const i=n.height/n.width;let s=1,r=t,o=1,a=i;a>
118r&&(a=r,o=a/i);const l=Math.max(s/o,r/a),c=n.width/(e*l*o),u=c*t;return{width:c,height:u}},S3=(n,t,e,i)=>{const s=i.x>.5?1-i.x:i.x,r=i.y>.5?1-i.y:i.y,o=s*2*n.width,a=r*2*n.height,l=boe(t,e);return Math.max(l.width/o,l.height/a)},T3=(n,t)=>{let e=n.width,i=e*t;i>n.height&&(i=n.height,e=i/t);const s=(n.width-e)*.5,r=(n.height-i)*.5;return{x:s,y:r,width:e,height:i}},voe=(n,t={})=>{let{zoom:e,rotation:i,center:s,aspectRatio:r}=t;r||(r=n.height/n.width);const o=woe(n,r,e),a={x:o.width*.5,y:o.height*.5},l={x:0,y:0,width:o.width,height:o.height,center:a},c=typeof t.scaleToFit>"u"||t.scaleToFit,u=S3(n,T3(l,r),i,c?s:{x:.5,y:.5}),d=e*u;return{widthFloat:o.width/d,heightFloat:o.height/d,width:Math.round(o.width/d),height:Math.round(o.height/d)}},Ao={type:"spring",stiffness:.5,damping:.45,mass:10},yoe=n=>n.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:({root:t,props:e})=>{t.appendChild(e.image)}}),_oe=n=>n.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:Ao,originY:Ao,scaleX:Ao,scaleY:Ao,translateX:Ao,translateY:Ao,rotateZ:Ao}},create:({root:t,props:e})=>{e.width=e.image.width,e.height=e.image.height,t.ref.bitmap=t.appendChildView(t.createChildView(yoe(n),{image:e.image}))},write:({root:t,props:e})=>{const{flip:i}=e.crop,{bitmap:s}=t.ref;s.scaleX=i.horizontal?-1:1,s.scaleY=i.vertical?-1:1}}),Eoe=n=>n.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function({root:t,props:e}){e.background&&(t.element.style.backgroundColor=e.background)},create:({root:t,props:e})=>{t.ref.image=t.appendChildView(t.createChildView(_oe(n),Object.assign({},e))),t.ref.createMarkup=()=>{t.ref.markup||(t.ref.markup=t.appendChildView(t.createChildView(goe(n),Object.assign({},e))))},t.ref.destroyMarkup=()=>{t.ref.markup&&(t.removeChildView(t.ref.markup),t.ref.markup=null)};const i=t.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");i!==null&&(i==="grid"?t.element.dataset.transparencyIndicator=i:t.element.dataset.transparencyIndicator="color")},write:({root:t,props:e,shouldOptimize:i})=>{const{crop:s,markup:r,resize:o,dirty:a,width:l,height:c}=e;t.ref.image.crop=s;const u={x:0,y:0,width:l,height:c,center:{x:l*.5,y:c*.5}},d={width:t.ref.image.width,height:t.ref.image.height},h={x:s.center.x*d.width,y:s.center.y*d.height},f={x:u.center.x-d.width*s.center.x,y:u.center.y-d.height*s.center.y},p=Math.PI*2+s.rotation%(Math.PI*2),v=s.aspectRatio||d.height/d.width,E=typeof s.scaleToFit>"u"||s.scaleToFit,x=S3(d,T3(u,v),p,E?s.center:{x:.5,y:.5}),A=s.zoom*x;r&&r.length?(t.ref.createMarkup(),t.ref.markup.width=l,t.ref.markup.height=c,t.ref.markup.resize=o,t.ref.markup.dirty=a,t.ref.markup.markup=r,t.ref.markup.crop=voe(d,s)):t.ref.markup&&t.ref.destroyMarkup();const O=t.ref.image;if(i){O.originX=null,O.originY=null,O.translateX=null,O.translateY=null,O.rotateZ=null,O.scaleX=null,O.scaleY=null;return}O.originX=h.x,O.originY=h.y,O.translateX=f.x,O.translateY=f.y,O.rotateZ=p,O.scaleX=A,O.scaleY=A}}),Soe=n=>n.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:Ao,scaleY:Ao,translateY:Ao,opacity:{type:"tween",duration:400}}},create:({root:t,props:e})=>{t.ref.clip=t.appendChildView(t.createChildView(Eoe(n),{id:e.id,image:e.image,crop:e.crop,markup:e.markup,resize:e.resize,dirty:e.dirty,background:e.background}))},write:({root:t,props:e,shouldOptimize:i})=>{const{clip:s}=t.ref,{image:r,crop:o,markup:a,resize:l,dirty:c}=e;if(s.crop=o,s.markup=a,s.resize=l,s.dirty=c,s.opacity=i?0:1,i||t.rect.element.hidden)return;const u=r.height/r.width;let d=o.aspectRatio||u;
118const h=t.rect.inner.width,f=t.rect.inner.height;let p=t.query("GET_IMAGE_PREVIEW_HEIGHT");const v=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),E=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),x=t.query("GET_PANEL_ASPECT_RATIO"),A=t.query("GET_ALLOW_MULTIPLE");x&&!A&&(p=h*x,d=x);let O=p!==null?p:Math.max(v,Math.min(h*d,E)),I=O/d;I>h&&(I=h,O=I*d),O>f&&(O=f,I=f/d),s.width=I,s.height=O}});let Toe=`<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none"> 119 <defs> 120 <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15"> 121 <stop offset='50%' stop-color='#000000'/> 122 <stop offset='56%' stop-color='#0a0a0a'/> 123 <stop offset='63%' stop-color='#262626'/> 124 <stop offset='69%' stop-color='#4f4f4f'/> 125 <stop offset='75%' stop-color='#808080'/> 126 <stop offset='81%' stop-color='#b1b1b1'/> 127 <stop offset='88%' stop-color='#dadada'/> 128 <stop offset='94%' stop-color='#f6f6f6'/> 129 <stop offset='100%' stop-color='#ffffff'/> 130 </radialGradient> 131 <mask id="mask-__UID__"> 132 <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect> 133 </mask> 134 </defs> 135 <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect> 136</svg>`,G2=0;const xoe=n=>n.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:e})=>{let i=Toe;if(document.querySelector("base")){const s=new URL(window.location.href.replace(window.location.hash,"")).href;i=i.replace(/url\(\#/g,"url("+s+"#")}G2++,t.element.classList.add(`filepond--image-preview-overlay-${e.status}`),t.element.innerHTML=i.replace(/__UID__/g,G2)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Aoe=function(){self.onmessage=n=>{createImageBitmap(n.data.message.file).then(t=>{self.postMessage({id:n.data.id,message:t},[t])})}},Coe=function(){self.onmessage=n=>{const t=n.data.message.imageData,e=n.data.message.colorMatrix,i=t.data,s=i.length,r=e[0],o=e[1],a=e[2],l=e[3],c=e[4],u=e[5],d=e[6],h=e[7],f=e[8],p=e[9],v=e[10],E=e[11],x=e[12],A=e[13],O=e[14],I=e[15],T=e[16],P=e[17],k=e[18],D=e[19];let U=0,Y=0,K=0,j=0,L=0;for(;U<s;U+=4)Y=i[U]/255,K=i[U+1]/255,j=i[U+2]/255,L=i[U+3]/255,i[U]=Math.max(0,Math.min((Y*r+K*o+j*a+L*l+c)*255,255)),i[U+1]=Math.max(0,Math.min((Y*u+K*d+j*h+L*f+p)*255,255)),i[U+2]=Math.max(0,Math.min((Y*v+K*E+j*x+L*A+O)*255,255)),i[U+3]=Math.max(0,Math.min((Y*I+K*T+j*P+L*k+D)*255,255));self.postMessage({id:n.data.id,message:t},[t.data.buffer])}},koe=(n,t)=>{let e=new Image;e.onload=()=>{const i=e.naturalWidth,s=e.naturalHeight;e=null,t(i,s)},e.src=n},Ioe={1:()=>[1,0,0,1,0,0],2:n=>[-1,0,0,1,n,0],3:(n,t)=>[-1,0,0,-1,n,t],4:(n,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(n,t)=>[0,1,-1,0,t,0],7:(n,t)=>[0,-1,-1,0,t,n],8:n=>[0,-1,1,0,0,n]},Poe=(n,t,e,i)=>{i!==-1&&n.transform.apply(n,Ioe[i](t,e))},Moe=(n,t,e,i)=>{t=Math.round(t),e=Math.round(e);const s=document.createElement("canvas");s.width=t,s.height=e;const r=s.getContext("2d");return i>=5&&i<=8&&([t,e]=[e,t]),Poe(r,t,e,i),r.drawImage(n,0,0,t,e),s},x3=n=>/^image/.test(n.type)&&!/svg/.test(n.type),Ooe=10,Doe=10,Roe=n=>{const t=Math.min(Ooe/n.width,Doe/n.height),e=document.createElement("canvas"),i=e.getContext("2d"),s=e.width=Math.ceil(n.width*t),r=e.height=Math.ceil(n.height*t);i.drawImage(n,0,0,s,r);let o=null;try{o=i.getImageData(0,0,s,r).data}catch{return null}const a=o.length;let l=0,c=0,u=0,d=0;for(;d<a;d+=4)l+=o[d]*o[d],c+=o[d+1]*o[d+1],u+=o[d+2]*o[d+2];return l=Zx(l,a),c=Zx(c,a),u=Zx(u,a),{r:l,g:c,b:u}},Zx=(n,t)=>Math.floor(Math.sqrt(n/(t/4))),Loe=(n,t)=>(t=t||document.createElement("canvas"),t.width=n.width,t.height=n.height,t.getContext("2d").drawImage(n,0,0),t),Foe=n=>{let t;try{t=new ImageData(n.width,n.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(n.width,n.height)}return t.data.set(new Uint8ClampedArray(n.data)),t},Noe=n=>new Promise((t,e)=>{const i=new Image;i.crossOrigin="Anonymous",i.onload=()=>{t(i)},i.onerror=s=>{e(s)},i.src=n}),Boe=n=>{const t=xoe(n),e=Soe(n),{createWorker:i}=n.utils,s=(A,O,I)=>new Promise(T=>{A.ref.imageData||(A.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));const P=Foe(A.ref.imageData);if(!O||O.length!==20)return I.getContext("2d").putImageData(P,0,0
136),T();const k=i(Coe);k.post({imageData:P,colorMatrix:O},D=>{I.getContext("2d").putImageData(D,0,0),k.terminate(),T()},[P.data.buffer])}),r=(A,O)=>{A.removeChildView(O),O.image.width=1,O.image.height=1,O._destroy()},o=({root:A})=>{const O=A.ref.images.shift();return O.opacity=0,O.translateY=-15,A.ref.imageViewBin.push(O),O},a=({root:A,props:O,image:I})=>{const T=O.id,P=A.query("GET_ITEM",{id:T});if(!P)return;const k=P.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},D=A.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR");let U,Y,K=!1;A.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(U=P.getMetadata("markup")||[],Y=P.getMetadata("resize"),K=!0);const j=A.appendChildView(A.createChildView(e,{id:T,image:I,crop:k,resize:Y,markup:U,dirty:K,background:D,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),A.childViews.length);A.ref.images.push(j),j.opacity=1,j.scaleX=1,j.scaleY=1,j.translateY=0,setTimeout(()=>{A.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:T})},250)},l=({root:A,props:O})=>{const I=A.query("GET_ITEM",{id:O.id});if(!I)return;const T=A.ref.images[A.ref.images.length-1];T.crop=I.getMetadata("crop"),T.background=A.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),A.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(T.dirty=!0,T.resize=I.getMetadata("resize"),T.markup=I.getMetadata("markup"))},c=({root:A,props:O,action:I})=>{if(!/crop|filter|markup|resize/.test(I.change.key)||!A.ref.images.length)return;const T=A.query("GET_ITEM",{id:O.id});if(T){if(/filter/.test(I.change.key)){const P=A.ref.images[A.ref.images.length-1];s(A,I.change.value,P.image);return}if(/crop|markup|resize/.test(I.change.key)){const P=T.getMetadata("crop"),k=A.ref.images[A.ref.images.length-1];if(P&&P.aspectRatio&&k.crop&&k.crop.aspectRatio&&Math.abs(P.aspectRatio-k.crop.aspectRatio)>1e-5){const D=o({root:A});a({root:A,props:O,image:Loe(D.image)})}else l({root:A,props:O})}}},u=A=>{const I=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),T=I?parseInt(I[1]):null;return T!==null&&T<=58?!1:"createImageBitmap"in window&&x3(A)},d=({root:A,props:O})=>{const{id:I}=O,T=A.query("GET_ITEM",I);if(!T)return;const P=URL.createObjectURL(T.file);koe(P,(k,D)=>{A.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:I,width:k,height:D})})},h=({root:A,props:O})=>{const{id:I}=O,T=A.query("GET_ITEM",I);if(!T)return;const P=URL.createObjectURL(T.file),k=()=>{Noe(P).then(D)},D=U=>{URL.revokeObjectURL(P);const K=(T.getMetadata("exif")||{}).orientation||-1;let{width:j,height:L}=U;if(!j||!L)return;K>=5&&K<=8&&([j,L]=[L,j]);const N=Math.max(1,window.devicePixelRatio*.75),_=A.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*N,C=L/j,B=A.rect.element.width,$=A.rect.element.height;let X=B,Z=X*C;C>1?(X=Math.min(j,B*_),Z=X*C):(Z=Math.min(L,$*_),X=Z/C);const ie=Moe(U,X,Z,K),fe=()=>{const ge=A.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?Roe(data):null;T.setMetadata("color",ge,!0),"close"in U&&U.close(),A.ref.overlayShadow.opacity=1,a({root:A,props:O,image:ie})},ae=T.getMetadata("filter");ae?s(A,ae,ie).then(fe):fe()};if(u(T.file)){const U=i(Aoe);U.post({file:T.file},Y=>
136{if(U.terminate(),!Y){k();return}D(Y)})}else k()},f=({root:A})=>{const O=A.ref.images[A.ref.images.length-1];O.translateY=0,O.scaleX=1,O.scaleY=1,O.opacity=1},p=({root:A})=>{A.ref.overlayShadow.opacity=1,A.ref.overlayError.opacity=0,A.ref.overlaySuccess.opacity=0},v=({root:A})=>{A.ref.overlayShadow.opacity=.25,A.ref.overlayError.opacity=1},E=({root:A})=>{A.ref.overlayShadow.opacity=.25,A.ref.overlaySuccess.opacity=1},x=({root:A})=>{A.ref.images=[],A.ref.imageData=null,A.ref.imageViewBin=[],A.ref.overlayShadow=A.appendChildView(A.createChildView(t,{opacity:0,status:"idle"})),A.ref.overlaySuccess=A.appendChildView(A.createChildView(t,{opacity:0,status:"success"})),A.ref.overlayError=A.appendChildView(A.createChildView(t,{opacity:0,status:"failure"}))};return n.utils.createView({name:"image-preview-wrapper",create:x,styles:["height"],apis:["height"],destroy:({root:A})=>{A.ref.images.forEach(O=>{O.image.width=1,O.image.height=1})},didWriteView:({root:A})=>{A.ref.images.forEach(O=>{O.dirty=!1})},write:n.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:f,DID_IMAGE_PREVIEW_CONTAINER_CREATE:d,DID_FINISH_CALCULATE_PREVIEWSIZE:h,DID_UPDATE_ITEM_METADATA:c,DID_THROW_ITEM_LOAD_ERROR:v,DID_THROW_ITEM_PROCESSING_ERROR:v,DID_THROW_ITEM_INVALID:v,DID_COMPLETE_ITEM_PROCESSING:E,DID_START_ITEM_PROCESSING:p,DID_REVERT_ITEM_PROCESSING:p},({root:A})=>{const O=A.ref.imageViewBin.filter(I=>I.opacity===0);A.ref.imageViewBin=A.ref.imageViewBin.filter(I=>I.opacity>0),O.forEach(I=>r(A,I)),O.length=0})})},A3=n=>{const{addFilter:t,utils:e}=n,{Type:i,createRoute:s,isFile:r}=e,o=Boe(n);return t("CREATE_VIEW",a=>{const{is:l,view:c,query:u}=a;if(!l("file")||!u("GET_ALLOW_IMAGE_PREVIEW"))return;const d=({root:E,props:x})=>{const{id:A}=x,O=u("GET_ITEM",A);if(!O||!r(O.file)||O.archived)return;const I=O.file;if(!Ure(I)||!u("GET_IMAGE_PREVIEW_FILTER_ITEM")(O))return;const T="createImageBitmap"in(window||{}),P=u("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!T&&P&&I.size>P)return;E.ref.imagePreview=c.appendChildView(c.createChildView(o,{id:A}));const k=E.query("GET_IMAGE_PREVIEW_HEIGHT");k&&E.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:O.id,height:k});const D=!T&&I.size>u("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");E.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:A},D)},h=(E,x)=>{if(!E.ref.imagePreview)return;let{id:A}=x;const O=E.query("GET_ITEM",{id:A});if(!O)return;const I=E.query("GET_PANEL_ASPECT_RATIO"),T=E.query("GET_ITEM_PANEL_ASPECT_RATIO"),P=E.query("GET_IMAGE_PREVIEW_HEIGHT");if(I||T||P)return;let{imageWidth:k,imageHeight:D}=E.ref;if(!k||!D)return;const U=E.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),Y=E.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),j=(O.getMetadata("exif")||{}).orientation||-1;if(j>=5&&j<=8&&([k,D]=[D,k]),!x3(O.file)||E.query("GET_IMAGE_PREVIEW_UPSCALE")){const B=2048/k;k*=B,D*=B}const L=D/k,N=(O.getMetadata("crop")||{}).aspectRatio||L;let m=Math.max(U,Math.min(D,Y));const _=E.rect.element.width,C=Math.min(_*N,m);E.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:O.id,height:C})},f=({root:E})=>{E.ref.shouldRescale=!0},p=({root:E,action:x})=>{x.change.key==="crop"&&(E.ref.shouldRescale=!0)},v=({root:E,action:x})=>{E.ref.imageWidth=x.width,E.ref.imageHeight=x.height,E.ref.shouldRescale=!0,E.ref.shouldDrawPreview=!0,E.dispatch("KICK")};c.registerWriter(s({DID_RESIZE_ROOT:f,DID_STOP_RESIZE:f,DID_LOAD_ITEM:d,DID_IMAGE_PREVIEW_CALCULATE_SIZE:v,DID_UPDATE_ITEM_METADATA:p},({root:E,props:x})=>{E.ref.imagePreview&&(E.rect.element.hidden||(E.ref.shouldRescale&&(h(E,x),E.ref.shouldRescale=!1),E.ref.shouldDrawPreview&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{E.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:x.id})})}),E.ref.shouldDrawPreview=!1)))}))}),{options:{allowImagePreview:[!0,i.BOOLEAN],imagePreviewFilterItem:[()=>!0,i.FUNCTION],imagePreviewHeight:[null,i.INT],imagePreviewMinHeight:[44,i.INT],imagePreviewMaxHeight:[256,i.INT],imagePreviewMaxFileSize:[null,i.INT],imagePreviewZoomFactor:[2,i.INT],imagePreviewUpscale:[!1,i.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,i.INT],imagePreviewTransparencyIndicator:[null,i.STRING],imagePreviewCalculateAverageImageColor:[!1,i.BOOLEAN],imagePreviewMarkupShow:[!0,i.BOOLEAN],imagePreviewMarkupFilter:[()=>!0,i.FUNCTION]}}},Voe=typeof window<"u"&&typeof window.document<"u";Voe&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:A3}));(function(n){typeof define=="function"&&define.amd?define(n):n()})(function(){var n,t=function(i,s){return i(s={exports:{}}
136,s.exports),s.exports}(function(i,s){var r;r=function(){return function(o){var a={};function l(c){if(a[c])return a[c].exports;var u=a[c]={i:c,l:!1,exports:{}};return o[c].call(u.exports,u,u.exports,l),u.l=!0,u.exports}return l.m=o,l.c=a,l.d=function(c,u,d){l.o(c,u)||Object.defineProperty(c,u,{enumerable:!0,get:d})},l.r=function(c){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},l.t=function(c,u){if(1&u&&(c=l(c)),8&u||4&u&&typeof c=="object"&&c&&c.__esModule)return c;var d=Object.create(null);if(l.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:c}),2&u&&typeof c!="string")for(var h in c)l.d(d,h,(function(f){return c[f]}).bind(null,h));return d},l.n=function(c){var u=c&&c.__esModule?function(){return c.default}:function(){return c};return l.d(u,"a",u),u},l.o=function(c,u){return Object.prototype.hasOwnProperty.call(c,u)},l.p="",l(l.s=44)}([function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(19);Object.keys(c).forEach(function(u){u!=="default"&&u!=="__esModule"&&Object.defineProperty(a,u,{enumerable:!0,get:function(){return c[u]}})})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(22),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(26);Object.defineProperty(a,"closest",{enumerable:!0,get:function(){return d(c).default}});var u=l(24);function d(h){return h&&h.__esModule?h:{default:h}}Object.defineProperty(a,"requestNextAnimationFrame",{enumerable:!0,get:function(){return d(u).default}})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(42),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(35),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(1);Object.defineProperty(a,"Sensor",{enumerable:!0,get:function(){return v(c).default}});var u=l(21);Object.defineProperty(a,"MouseSensor",{enumerable:!0,get:function(){return v(u).default}});var d=l(18);Object.defineProperty(a,"TouchSensor",{enumerable:!0,get:function(){return v(d).default}});var h=l(16);Object.defineProperty(a,"DragSensor",{enumerable:!0,get:function(){return v(h).default}});var f=l(14);Object.defineProperty(a,"ForceTouchSensor",{enumerable:!0,get:function(){return v(f).default}});var p=l(0);function v(E){return E&&E.__esModule?E:{default:E}}Object.keys(p).forEach(function(E){E!=="default"&&E!=="__esModule"&&Object.defineProperty(a,E,{enumerable:!0,get:function(){return p[E]}})})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(37);Object.defineProperty(a,"Announcement",{enumerable:!0,get:function(){return f(c).default}}),Object.defineProperty(a,"defaultAnnouncementOptions",{enumerable:!0,get:function(){return c.defaultOptions}});var u=l(34);Object.defineProperty(a,"Focusable",{enumerable:!0,get:function(){return f(u).default}});var d=l(32);Object.defineProperty(a,"Mirror",{enumerable:!0,get:function(){return f(d).default}}),Object.defineProperty(a,"defaultMirrorOptions",{enumerable:!0,get:function(){return d.defaultOptions}});var h=l(28);function f(p){return p&&p.__esModule?p:{default:p}}Object.defineProperty(a,"Scrollable",{enumerable:!0,get:function(){return f(h).default}}),Object.defineProperty(a,"defaultScrollableOptions",{enumerable:!0,get:function(){return h.defaultOptions}})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(38);Object.keys(c).forEach(function(u){u!=="default"&&u!=="__esModule"&&Object.defineProperty(a,u,{enumerable:!0,get:function(){return c[u]}})})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(39);Object.keys(c).forEach(function(u){u!=="default"&&u!=="__esModule"&&Object.defineProperty(a,u,{enumerable:!0,get:function(){return c[u]}})})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(43);Object.keys(c).forEach(function(u){u!=="default"&&u!=="__esModule"&&Object.defineProperty(a,u,{enumerable:!0,get:function(){return c[u]}})})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.default=class{constructor(){this.callbacks={}}on(c,...u){return this.callbacks[c]||(this.callbacks[c]=[]),this.callbacks[c].push(...u),this}off(c,u){if(!this.callbacks[c])return null;const d=this.callbacks[c].slice(0);for(let h=0;h<d.length;h++)u===d[h]&&this.callbacks[c].splice(h,1);return this}trigger(c){if(!this.callbacks[c.type])return null;const u=[...this.callbacks[c.type]],d=[];for(let h=u.length-1;h>=0;h--){const f=u[h];try{f(c)}catch(p){d.push(p)}}return d.length&&console.error(`Draggable caught errors while triggering '${c.type}'`,d),this}}},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(10),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=void 0;var c,u=Object.assign||function(j){for(var L=1;L<arguments.length;L++){var N=arguments[L];for(var m in N)Object.prototype.hasOwnProperty.call(N,m)&&(j[m]=N[m])}return j}
136,d=l(2),h=l(6),f=l(11),p=(c=f)&&c.__esModule?c:{default:c},v=l(5),E=l(7),x=l(8);const A=Symbol("onDragStart"),O=Symbol("onDragMove"),I=Symbol("onDragStop"),T=Symbol("onDragPressure"),P={"drag:start":j=>`Picked up ${j.source.textContent.trim()||j.source.id||"draggable element"}`,"drag:stop":j=>`Released ${j.source.textContent.trim()||j.source.id||"draggable element"}`},k={"container:dragging":"draggable-container--is-dragging","source:dragging":"draggable-source--is-dragging","source:placed":"draggable-source--placed","container:placed":"draggable-container--placed","body:dragging":"draggable--is-dragging","draggable:over":"draggable--over","container:over":"draggable-container--over","source:original":"draggable--original",mirror:"draggable-mirror"},D=a.defaultOptions={draggable:".draggable-source",handle:null,delay:100,placedTimeout:800,plugins:[],sensors:[]};class U{constructor(L=[document.body],N={}){if(L instanceof NodeList||L instanceof Array)this.containers=[...L];else{if(!(L instanceof HTMLElement))throw new Error("Draggable containers are expected to be of type `NodeList`, `HTMLElement[]` or `HTMLElement`");this.containers=[L]}this.options=u({},D,N,{classes:u({},k,N.classes||{}),announcements:u({},P,N.announcements||{})}),this.emitter=new p.default,this.dragging=!1,this.plugins=[],this.sensors=[],this[A]=this[A].bind(this),this[O]=this[O].bind(this),this[I]=this[I].bind(this),this[T]=this[T].bind(this),document.addEventListener("drag:start",this[A],!0),document.addEventListener("drag:move",this[O],!0),document.addEventListener("drag:stop",this[I],!0),document.addEventListener("drag:pressure",this[T],!0);const m=Object.values(U.Plugins).map(B=>B),_=[v.MouseSensor,v.TouchSensor];this.addPlugin(...m,...this.options.plugins),this.addSensor(..._,...this.options.sensors);const C=new E.DraggableInitializedEvent({draggable:this});this.on("mirror:created",({mirror:B})=>this.mirror=B),this.on("mirror:destroy",()=>this.mirror=null),this.trigger(C)}destroy(){document.removeEventListener("drag:start",this[A],!0),document.removeEventListener("drag:move",this[O],!0),document.removeEventListener("drag:stop",this[I],!0),document.removeEventListener("drag:pressure",this[T],!0);const L=new E.DraggableDestroyEvent({draggable:this});this.trigger(L),this.removePlugin(...this.plugins.map(N=>N.constructor)),this.removeSensor(...this.sensors.map(N=>N.constructor))}addPlugin(...L){const N=L.map(m=>new m(this));return N.forEach(m=>m.attach()),this.plugins=[...this.plugins,...N],this}removePlugin(...L){return this.plugins.filter(N=>L.includes(N.constructor)).forEach(N=>N.detach()),this.plugins=this.plugins.filter(N=>!L.includes(N.constructor)),this}addSensor(...L){const N=L.map(m=>new m(this.containers,this.options));return N.forEach(m=>m.attach()),this.sensors=[...this.sensors,...N],this}removeSensor(...L){return this.sensors.filter(N=>L.includes(N.constructor)).forEach(N=>N.detach()),this.sensors=this.sensors.filter(N=>!L.includes(N.constructor)),this}addContainer(...L){return this.containers=[...this.containers,...L],this.sensors.forEach(N=>N.addContainer(...L)),this}removeContainer(...L){return this.containers=this.containers.filter(N=>!L.includes(N)),this.sensors.forEach(N=>N.removeContainer(...L)),this}on(L,...N){return this.emitter.on(L,...N),this}off(L,N){return this.emitter.off(L,N),this}trigger(L){return this.emitter.trigger(L),this}getClassNameFor(L){return this.options.classes[L]}isDragging(){return!!this.dragging}getDraggableElements(){return this.containers.reduce((L,N)=>[...L,...this.getDraggableElementsForContainer(N)],[])}getDraggableElementsForContainer(L){return[...L.querySelectorAll(this.options.draggable)].filter(N=>N!==this.originalSource&&N!==this.mirror)}[A](L){const N=Y(L),{target:m,container:_}=N;if(!this.containers.includes(_))return;if(this.options.handle&&m&&!(0,d.closest)(m,this.options.handle)||(this.originalSource=(0,d.closest)(m,this.options.draggable),this.sourceContainer=_,!this.originalSource))return void N.cancel();this.lastPlacedSource&&this.lastPlacedContainer&&(clearTimeout(this.placedTimeoutID),this.lastPlacedSource.classList.remove(this.getClassNameFor("source:placed")),this.lastPlacedContainer.classList.remove(this.getClassNameFor("container:placed"))),this.source=this.originalSource.cloneNode(!0),this.originalSource.parentNode.insertBefore(this.source,this.originalSource),this.originalSource.style.display="none";const C=new x.DragStartEvent({source:this.source,originalSource:this.originalSource,sourceContainer:_,sensorEvent:N}
136);if(this.trigger(C),this.dragging=!C.canceled(),C.canceled())return this.source.parentNode.removeChild(this.source),void(this.originalSource.style.display=null);this.originalSource.classList.add(this.getClassNameFor("source:original")),this.source.classList.add(this.getClassNameFor("source:dragging")),this.sourceContainer.classList.add(this.getClassNameFor("container:dragging")),document.body.classList.add(this.getClassNameFor("body:dragging")),K(document.body,"none"),requestAnimationFrame(()=>{const B=Y(L).clone({target:this.source});this[O](u({},L,{detail:B}))})}[O](L){if(!this.dragging)return;const N=Y(L),{container:m}=N;let _=N.target;const C=new x.DragMoveEvent({source:this.source,originalSource:this.originalSource,sourceContainer:m,sensorEvent:N});this.trigger(C),C.canceled()&&N.cancel(),_=(0,d.closest)(_,this.options.draggable);const B=(0,d.closest)(N.target,this.containers),$=N.overContainer||B,X=this.currentOverContainer&&$!==this.currentOverContainer,Z=this.currentOver&&_!==this.currentOver,ie=$&&this.currentOverContainer!==$,fe=B&&_&&this.currentOver!==_;if(Z){const ae=new x.DragOutEvent({source:this.source,originalSource:this.originalSource,sourceContainer:m,sensorEvent:N,over:this.currentOver});this.currentOver.classList.remove(this.getClassNameFor("draggable:over")),this.currentOver=null,this.trigger(ae)}if(X){const ae=new x.DragOutContainerEvent({source:this.source,originalSource:this.originalSource,sourceContainer:m,sensorEvent:N,overContainer:this.currentOverContainer});this.currentOverContainer.classList.remove(this.getClassNameFor("container:over")),this.currentOverContainer=null,this.trigger(ae)}if(ie){$.classList.add(this.getClassNameFor("container:over"));const ae=new x.DragOverContainerEvent({source:this.source,originalSource:this.originalSource,sourceContainer:m,sensorEvent:N,overContainer:$});this.currentOverContainer=$,this.trigger(ae)}if(fe){_.classList.add(this.getClassNameFor("draggable:over"));const ae=new x.DragOverEvent({source:this.source,originalSource:this.originalSource,sourceContainer:m,sensorEvent:N,overContainer:$,over:_});this.currentOver=_,this.trigger(ae)}}[I](L){if(!this.dragging)return;this.dragging=!1;const N=new x.DragStopEvent({source:this.source,originalSource:this.originalSource,sensorEvent:L.sensorEvent,sourceContainer:this.sourceContainer});this.trigger(N),this.source.parentNode.insertBefore(this.originalSource,this.source),this.source.parentNode.removeChild(this.source),this.originalSource.style.display="",this.source.classList.remove(this.getClassNameFor("source:dragging")),this.originalSource.classList.remove(this.getClassNameFor("source:original")),this.originalSource.classList.add(this.getClassNameFor("source:placed")),this.sourceContainer.classList.add(this.getClassNameFor("container:placed")),this.sourceContainer.classList.remove(this.getClassNameFor("container:dragging")),document.body.classList.remove(this.getClassNameFor("body:dragging")),K(document.body,""),this.currentOver&&this.currentOver.classList.remove(this.getClassNameFor("draggable:over")),this.currentOverContainer&&this.currentOverContainer.classList.remove(this.getClassNameFor("container:over")),this.lastPlacedSource=this.originalSource,this.lastPlacedContainer=this.sourceContainer,this.placedTimeoutID=setTimeout(()=>{this.lastPlacedSource&&this.lastPlacedSource.classList.remove(this.getClassNameFor("source:placed")),this.lastPlacedContainer&&this.lastPlacedContainer.classList.remove(this.getClassNameFor("container:placed")),this.lastPlacedSource=null,this.lastPlacedContainer=null},this.options.placedTimeout),this.source=null,this.originalSource=null,this.currentOverContainer=null,this.currentOver=null,this.sourceContainer=null}[T](L){if(!this.dragging)return;const N=Y(L),m=this.source||(0,d.closest)(N.originalEvent.target,this.options.draggable),_=new x.DragPressureEvent({sensorEvent:N,source:m,pressure:N.pressure});this.trigger(_)}}function Y(j){return j.detail}function K(j,L){j.style.webkitUserSelect=L,j.style.mozUserSelect=L,j.style.msUserSelect=L,j.style.oUserSelect=L,j.style.userSelect=L}a.default=U,U.Plugins={Announcement:h.Announcement,Focusable:h.Focusable,Mirror:h.Mirror,Scrollable:h.Scrollable}},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(1),d=(c=u)&&c.__esModule?c:{default:c},h=l(0);const f=Symbol("onMouseForceWillBegin"),p=Symbol("onMouseForceDown"),v=Symbol("onMouseDown"),E=Symbol("onMouseForceChange"),x=Symbol("onMouseMove"),A=Symbol("onMouseUp"),O=Symbol("onMouseForceGlobalChange");class I extends d.default{constructor(P=[],k={}){super(P,k),this.mightDrag=!1,this[f]=this[f].bind(this),this[p]=this[p].bind(this),this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this),this[A]=this[A].bind(this)}
136attach(){for(const P of this.containers)P.addEventListener("webkitmouseforcewillbegin",this[f],!1),P.addEventListener("webkitmouseforcedown",this[p],!1),P.addEventListener("mousedown",this[v],!0),P.addEventListener("webkitmouseforcechanged",this[E],!1);document.addEventListener("mousemove",this[x]),document.addEventListener("mouseup",this[A])}detach(){for(const P of this.containers)P.removeEventListener("webkitmouseforcewillbegin",this[f],!1),P.removeEventListener("webkitmouseforcedown",this[p],!1),P.removeEventListener("mousedown",this[v],!0),P.removeEventListener("webkitmouseforcechanged",this[E],!1);document.removeEventListener("mousemove",this[x]),document.removeEventListener("mouseup",this[A])}[f](P){P.preventDefault(),this.mightDrag=!0}[p](P){if(this.dragging)return;const k=document.elementFromPoint(P.clientX,P.clientY),D=P.currentTarget,U=new h.DragStartSensorEvent({clientX:P.clientX,clientY:P.clientY,target:k,container:D,originalEvent:P});this.trigger(D,U),this.currentContainer=D,this.dragging=!U.canceled(),this.mightDrag=!1}[A](P){if(!this.dragging)return;const k=new h.DragStopSensorEvent({clientX:P.clientX,clientY:P.clientY,target:null,container:this.currentContainer,originalEvent:P});this.trigger(this.currentContainer,k),this.currentContainer=null,this.dragging=!1,this.mightDrag=!1}[v](P){this.mightDrag&&(P.stopPropagation(),P.stopImmediatePropagation(),P.preventDefault())}[x](P){if(!this.dragging)return;const k=document.elementFromPoint(P.clientX,P.clientY),D=new h.DragMoveSensorEvent({clientX:P.clientX,clientY:P.clientY,target:k,container:this.currentContainer,originalEvent:P});this.trigger(this.currentContainer,D)}[E](P){if(this.dragging)return;const k=P.target,D=P.currentTarget,U=new h.DragPressureSensorEvent({pressure:P.webkitForce,clientX:P.clientX,clientY:P.clientY,target:k,container:D,originalEvent:P});this.trigger(D,U)}[O](P){if(!this.dragging)return;const k=P.target,D=new h.DragPressureSensorEvent({pressure:P.webkitForce,clientX:P.clientX,clientY:P.clientY,target:k,container:this.currentContainer,originalEvent:P});this.trigger(this.currentContainer,D)}}a.default=I},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(13),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(2),d=l(1),h=(c=d)&&c.__esModule?c:{default:c},f=l(0);const p=Symbol("onMouseDown"),v=Symbol("onMouseUp"),E=Symbol("onDragStart"),x=Symbol("onDragOver"),A=Symbol("onDragEnd"),O=Symbol("onDrop"),I=Symbol("reset");class T extends h.default{constructor(k=[],D={}){super(k,D),this.mouseDownTimeout=null,this.draggableElement=null,this.nativeDraggableElement=null,this[p]=this[p].bind(this),this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this),this[A]=this[A].bind(this),this[O]=this[O].bind(this)}attach(){document.addEventListener("mousedown",this[p],!0)}detach(){document.removeEventListener("mousedown",this[p],!0)}[E](k){k.dataTransfer.setData("text",""),k.dataTransfer.effectAllowed=this.options.type;const D=document.elementFromPoint(k.clientX,k.clientY);if(this.currentContainer=(0,u.closest)(k.target,this.containers),!this.currentContainer)return;const U=new f.DragStartSensorEvent({clientX:k.clientX,clientY:k.clientY,target:D,container:this.currentContainer,originalEvent:k});setTimeout(()=>{this.trigger(this.currentContainer,U),U.canceled()?this.dragging=!1:this.dragging=!0},0)}[x](k){if(!this.dragging)return;const D=document.elementFromPoint(k.clientX,k.clientY),U=this.currentContainer,Y=new f.DragMoveSensorEvent({clientX:k.clientX,clientY:k.clientY,target:D,container:U,originalEvent:k});this.trigger(U,Y),Y.canceled()||(k.preventDefault(),k.dataTransfer.dropEffect=this.options.type)}[A](k){if(!this.dragging)return;document.removeEventListener("mouseup",this[v],!0);const D=document.elementFromPoint(k.clientX,k.clientY),U=this.currentContainer,Y=new f.DragStopSensorEvent({clientX:k.clientX,clientY:k.clientY,target:D,container:U,originalEvent:k});this.trigger(U,Y),this.dragging=!1,this[I]()}[O](k){k.preventDefault()}[p](k){if(k.target&&(k.target.form||k.target.contenteditable))return;const D=(0,u.closest)(k.target,Y=>Y.draggable);D&&(D.draggable=!1,this.nativeDraggableElement=D),document.addEventListener("mouseup",this[v],!0),document.addEventListener("dragstart",this[E],!1),document.addEventListener("dragover",this[x],!1),document.addEventListener("dragend",this[A],!1),document.addEventListener("drop",this[O],!1);const U=(0,u.closest)(k.target,this.options.draggable);U&&(this.mouseDownTimeout=setTimeout(()=>{U.draggable=!0,this.draggableElement=U},this.options.delay))}[v](){this[I]()}[I](){clearTimeout(this.mouseDownTimeout),document.removeEventListener("mouseup",this[v],!0),document.removeEventListener("dragstart",this[E],!1),document.removeEventListener("dragover",this[x],!1),document.removeEventListener("dragend",this[A],!1),document.removeEventListener("drop",this[O],!1),this.nativeDraggableElement&&(this.nativeDraggableElement.draggable=!0,this.nativeDraggableElement=null),this.draggableElement&&(this.draggableElement.draggable=!1,this.draggableElement=null)}}a.default=T},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(15),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(2),d=l(1),h=(c=d)&&c.__esModule?c:{default:c},f=l(0);const p=Symbol("onTouchStart"),v=Symbol("onTouchHold"),E=Symbol("onTouchEnd"),x=Symbol("onTouchMove");let A=!1;window.addEventListener("touchmove",T=>{A&&T.preventDefault()},{passive:!1});class O extends h.default{constructor(P=[],k={}){super(P,k),this.currentScrollableParent=null,this.tapTimeout=null,this.touchMoved=!1,this[p]=this[p].bind(this),this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this)}attach(){document.addEventListener("touchstart",this[p])}detach(){document.removeEventListener("touchstart",this[p])}
136[p](P){const k=(0,u.closest)(P.target,this.containers);k&&(document.addEventListener("touchmove",this[x]),document.addEventListener("touchend",this[E]),document.addEventListener("touchcancel",this[E]),k.addEventListener("contextmenu",I),this.currentContainer=k,this.tapTimeout=setTimeout(this[v](P,k),this.options.delay))}[v](P,k){return()=>{if(this.touchMoved)return;const D=P.touches[0]||P.changedTouches[0],U=P.target,Y=new f.DragStartSensorEvent({clientX:D.pageX,clientY:D.pageY,target:U,container:k,originalEvent:P});this.trigger(k,Y),this.dragging=!Y.canceled(),A=this.dragging}}[x](P){if(this.touchMoved=!0,!this.dragging)return;const k=P.touches[0]||P.changedTouches[0],D=document.elementFromPoint(k.pageX-window.scrollX,k.pageY-window.scrollY),U=new f.DragMoveSensorEvent({clientX:k.pageX,clientY:k.pageY,target:D,container:this.currentContainer,originalEvent:P});this.trigger(this.currentContainer,U)}[E](P){if(this.touchMoved=!1,A=!1,document.removeEventListener("touchend",this[E]),document.removeEventListener("touchcancel",this[E]),document.removeEventListener("touchmove",this[x]),this.currentContainer&&this.currentContainer.removeEventListener("contextmenu",I),clearTimeout(this.tapTimeout),!this.dragging)return;const k=P.touches[0]||P.changedTouches[0],D=document.elementFromPoint(k.pageX-window.scrollX,k.pageY-window.scrollY);P.preventDefault();const U=new f.DragStopSensorEvent({clientX:k.pageX,clientY:k.pageY,target:D,container:this.currentContainer,originalEvent:P});this.trigger(this.currentContainer,U),this.currentContainer=null,this.dragging=!1}}function I(T){T.preventDefault(),T.stopPropagation()}a.default=O},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(17),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.DragPressureSensorEvent=a.DragStopSensorEvent=a.DragMoveSensorEvent=a.DragStartSensorEvent=a.SensorEvent=void 0;var c,u=l(3),d=(c=u)&&c.__esModule?c:{default:c};class h extends d.default{get originalEvent(){return this.data.originalEvent}get clientX(){return this.data.clientX}get clientY(){return this.data.clientY}get target(){return this.data.target}get container(){return this.data.container}get pressure(){return this.data.pressure}}a.SensorEvent=h;class f extends h{}a.DragStartSensorEvent=f,f.type="drag:start";class p extends h{}a.DragMoveSensorEvent=p,p.type="drag:move";class v extends h{}a.DragStopSensorEvent=v,v.type="drag:stop";class E extends h{}a.DragPressureSensorEvent=E,E.type="drag:pressure"},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(2),d=l(1),h=(c=d)&&c.__esModule?c:{default:c},f=l(0);const p=Symbol("onContextMenuWhileDragging"),v=Symbol("onMouseDown"),E=Symbol("onMouseMove"),x=Symbol("onMouseUp");class A extends h.default{constructor(T=[],P={}){super(T,P),this.mouseDown=!1,this.mouseDownTimeout=null,this.openedContextMenu=!1,this[p]=this[p].bind(this),this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this)}attach(){document.addEventListener("mousedown",this[v],!0)}detach(){document.removeEventListener("mousedown",this[v],!0)}[v](T){if(T.button!==0||T.ctrlKey||T.metaKey)return;document.addEventListener("mouseup",this[x]);const P=document.elementFromPoint(T.clientX,T.clientY),k=(0,u.closest)(P,this.containers);k&&(document.addEventListener("dragstart",O),this.mouseDown=!0,clearTimeout(this.mouseDownTimeout),this.mouseDownTimeout=setTimeout(()=>{if(!this.mouseDown)return;const D=new f.DragStartSensorEvent({clientX:T.clientX,clientY:T.clientY,target:P,container:k,originalEvent:T});this.trigger(k,D),this.currentContainer=k,this.dragging=!D.canceled(),this.dragging&&(document.addEventListener("contextmenu",this[p]),document.addEventListener("mousemove",this[E]))},this.options.delay))}[E](T){if(!this.dragging)return;const P=document.elementFromPoint(T.clientX,T.clientY),k=new f.DragMoveSensorEvent({clientX:T.clientX,clientY:T.clientY,target:P,container:this.currentContainer,originalEvent:T});this.trigger(this.currentContainer,k)}[x](T){if(this.mouseDown=!!this.openedContextMenu,this.openedContextMenu)return void(this.openedContextMenu=!1);if(document.removeEventListener("mouseup",this[x]),document.removeEventListener("dragstart",O),!this.dragging)return;const P=document.elementFromPoint(T.clientX,T.clientY),k=new f.DragStopSensorEvent({clientX:T.clientX,clientY:T.clientY,target:P,container:this.currentContainer,originalEvent:T});this.trigger(this.currentContainer,k),document.removeEventListener("contextmenu",this[p]),document.removeEventListener("mousemove",this[E]),this.currentContainer=null,this.dragging=!1}
136[p](T){T.preventDefault(),this.openedContextMenu=!0}}function O(I){I.preventDefault()}a.default=A},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(20),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var h=arguments[d];for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(u[f]=h[f])}return u};a.default=class{constructor(u=[],d={}){this.containers=[...u],this.options=c({},d),this.dragging=!1,this.currentContainer=null}attach(){return this}detach(){return this}addContainer(...u){this.containers=[...this.containers,...u]}removeContainer(...u){this.containers=this.containers.filter(d=>!u.includes(d))}trigger(u,d){const h=document.createEvent("Event");return h.detail=d,h.initEvent(d.type,!0,!0),u.dispatchEvent(h),this.lastEvent=d,d}}},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(c){return requestAnimationFrame(()=>{requestAnimationFrame(c)})}},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(23),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.default=function(u,d){if(!u)return null;const h=d,f=d,p=d,v=d,E=typeof d=="string",x=typeof d=="function",A=d instanceof NodeList||d instanceof Array,O=d instanceof HTMLElement;let I=u;do{if(I=I.correspondingUseElement||I.correspondingElement||I,(T=I)?E?c.call(T,h):A?[...p].includes(T):O?v===T:x&&f(T):T)return I;I=I.parentNode}while(I&&I!==document.body&&I!==document);var T;return null};const c=Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(25),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=a.scroll=a.onDragStop=a.onDragMove=a.onDragStart=void 0;var c,u=Object.assign||function(T){for(var P=1;P<arguments.length;P++){var k=arguments[P];for(var D in k)Object.prototype.hasOwnProperty.call(k,D)&&(T[D]=k[D])}return T},d=l(4),h=(c=d)&&c.__esModule?c:{default:c},f=l(2);const p=a.onDragStart=Symbol("onDragStart"),v=a.onDragMove=Symbol("onDragMove"),E=a.onDragStop=Symbol("onDragStop"),x=a.scroll=Symbol("scroll"),A=a.defaultOptions={speed:6,sensitivity:50,scrollableElements:[]};class O extends h.default{constructor(P){super(P),this.options=u({},A,this.getOptions()),this.currentMousePosition=null,this.scrollAnimationFrame=null,this.scrollableElement=null,this.findScrollableElementFrame=null,this[p]=this[p].bind(this),this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this)}attach(){this.draggable.on("drag:start",this[p]).on("drag:move",this[v]).on("drag:stop",this[E])}detach(){this.draggable.off("drag:start",this[p]).off("drag:move",this[v]).off("drag:stop",this[E])}getOptions(){return this.draggable.options.scrollable||{}}getScrollableElement(P){return this.hasDefinedScrollableElements()?(0,f.closest)(P,this.options.scrollableElements)||document.documentElement:function(k){if(!k)return I();const D=getComputedStyle(k).getPropertyValue("position"),U=D==="absolute",Y=(0,f.closest)(k,K=>(!U||!function(j){return getComputedStyle(j).getPropertyValue("position")==="static"}(K))&&function(j){const L=getComputedStyle(j,null),N=L.getPropertyValue("overflow")+L.getPropertyValue("overflow-y")+L.getPropertyValue("overflow-x");return/(auto|scroll)/.test(N)}(K));return D!=="fixed"&&Y?Y:I()}(P)}hasDefinedScrollableElements(){return this.options.scrollableElements.length!==0}[p](P){this.findScrollableElementFrame=requestAnimationFrame(()=>{this.scrollableElement=this.getScrollableElement(P.source)})}[v](P){if(this.findScrollableElementFrame=requestAnimationFrame(()=>{this.scrollableElement=this.getScrollableElement(P.sensorEvent.target)}),!this.scrollableElement)return;const k=P.sensorEvent,D={x:0,y:0};"ontouchstart"in window&&(D.y=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,D.x=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0),this.currentMousePosition={clientX:k.clientX-D.x,clientY:k.clientY-D.y},this.scrollAnimationFrame=requestAnimationFrame(this[x])}[E](){cancelAnimationFrame(this.scrollAnimationFrame),cancelAnimationFrame(this.findScrollableElementFrame),this.scrollableElement=null,this.scrollAnimationFrame=null,this.findScrollableElementFrame=null,this.currentMousePosition=null}[x](){if(!this.scrollableElement||!this.currentMousePosition)return;cancelAnimationFrame(this.scrollAnimationFrame);const{speed:P,sensitivity:k}=this.options,D=this.scrollableElement.getBoundingClientRect(),U=D.bottom>window.innerHeight,Y=D.top<0||U,K=I(),j=this.scrollableElement,L=this.currentMousePosition.clientX,N=this.currentMousePosition.clientY;if(j===document.body||j===document.documentElement||Y){const{innerHeight:m,innerWidth:_}=window;N<k?K.scrollTop-=P:m-N<k&&(K.scrollTop+=P),L<k?K.scrollLeft-=P:_-L<k&&(K.scrollLeft+=P)}else{const{offsetHeight:m,offsetWidth:_}=j;D.top+m-N<k?j.scrollTop+=P:N-D.top<k&&(j.scrollTop-=P),D.left+_-L<k?j.scrollLeft+=P:L-D.left<k&&(j.scrollLeft-=P)}this.scrollAnimationFrame=requestAnimationFrame(this[x])}}function I(){return document.scrollingElement||document.documentElement}a.default=O},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=void 0;var c,u=l(27),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default,a.defaultOptions=u.defaultOptions},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.MirrorDestroyEvent=a.MirrorMoveEvent=a.MirrorAttachedEvent=a.MirrorCreatedEvent=a.MirrorCreateEvent=a.MirrorEvent=void 0;var c,u=l(3),d=(c=u)&&c.__esModule?c:{default:c};class h extends d.default{get source(){return this.data.source}get originalSource(){return this.data.originalSource}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get dragEvent(){return this.data.dragEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}a.MirrorEvent=h;class f extends h{}a.MirrorCreateEvent=f,f.type="mirror:create";class p extends h{get mirror(){return this.data.mirror}}a.MirrorCreatedEvent=p,p.type="mirror:created";class v extends h{get mirror(){return this.data.mirror}}a.MirrorAttachedEvent=v,v.type="mirror:attached";class E extends h{get mirror(){return this.data.mirror}}a.MirrorMoveEvent=E,E.type="mirror:move",E.cancelable=!0;class x extends h{get mirror(){return this.data.mirror}}a.MirrorDestroyEvent=x,x.type="mirror:destroy",x.cancelable=!0},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(29);
136Object.keys(c).forEach(function(u){u!=="default"&&u!=="__esModule"&&Object.defineProperty(a,u,{enumerable:!0,get:function(){return c[u]}})})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=a.getAppendableContainer=a.onScroll=a.onMirrorMove=a.onMirrorCreated=a.onDragStop=a.onDragMove=a.onDragStart=void 0;var c,u=Object.assign||function(m){for(var _=1;_<arguments.length;_++){var C=arguments[_];for(var B in C)Object.prototype.hasOwnProperty.call(C,B)&&(m[B]=C[B])}return m},d=l(4),h=(c=d)&&c.__esModule?c:{default:c},f=l(30);function p(m,_){var C={};for(var B in m)_.indexOf(B)>=0||Object.prototype.hasOwnProperty.call(m,B)&&(C[B]=m[B]);return C}const v=a.onDragStart=Symbol("onDragStart"),E=a.onDragMove=Symbol("onDragMove"),x=a.onDragStop=Symbol("onDragStop"),A=a.onMirrorCreated=Symbol("onMirrorCreated"),O=a.onMirrorMove=Symbol("onMirrorMove"),I=a.onScroll=Symbol("onScroll"),T=a.getAppendableContainer=Symbol("getAppendableContainer"),P=a.defaultOptions={constrainDimensions:!1,xAxis:!0,yAxis:!0,cursorOffsetX:null,cursorOffsetY:null};class k extends h.default{constructor(_){super(_),this.options=u({},P,this.getOptions()),this.scrollOffset={x:0,y:0},this.initialScrollOffset={x:window.scrollX,y:window.scrollY},this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this),this[A]=this[A].bind(this),this[O]=this[O].bind(this),this[I]=this[I].bind(this)}attach(){this.draggable.on("drag:start",this[v]).on("drag:move",this[E]).on("drag:stop",this[x]).on("mirror:created",this[A]).on("mirror:move",this[O])}detach(){this.draggable.off("drag:start",this[v]).off("drag:move",this[E]).off("drag:stop",this[x]).off("mirror:created",this[A]).off("mirror:move",this[O])}getOptions(){return this.draggable.options.mirror||{}}[v](_){if(_.canceled())return;"ontouchstart"in window&&document.addEventListener("scroll",this[I],!0),this.initialScrollOffset={x:window.scrollX,y:window.scrollY};const{source:C,originalSource:B,sourceContainer:$,sensorEvent:X}=_,Z=new f.MirrorCreateEvent({source:C,originalSource:B,sourceContainer:$,sensorEvent:X,dragEvent:_});if(this.draggable.trigger(Z),function(ge){return/^drag/.test(ge.originalEvent.type)}(X)||Z.canceled())return;const ie=this[T](C)||$;this.mirror=C.cloneNode(!0);const fe=new f.MirrorCreatedEvent({source:C,originalSource:B,sourceContainer:$,sensorEvent:X,dragEvent:_,mirror:this.mirror}),ae=new f.MirrorAttachedEvent({source:C,originalSource:B,sourceContainer:$,sensorEvent:X,dragEvent:_,mirror:this.mirror});this.draggable.trigger(fe),ie.appendChild(this.mirror),this.draggable.trigger(ae)}[E](_){if(!this.mirror||_.canceled())return;const{source:C,originalSource:B,sourceContainer:$,sensorEvent:X}=_,Z=new f.MirrorMoveEvent({source:C,originalSource:B,sourceContainer:$,sensorEvent:X,dragEvent:_,mirror:this.mirror});this.draggable.trigger(Z)}[x](_){if("ontouchstart"in window&&document.removeEventListener("scroll",this[I],!0),this.initialScrollOffset={x:0,y:0},this.scrollOffset={x:0,y:0},!this.mirror)return;const{source:C,sourceContainer:B,sensorEvent:$}=_,X=new f.MirrorDestroyEvent({source:C,mirror:this.mirror,sourceContainer:B,sensorEvent:$,dragEvent:_});this.draggable.trigger(X),X.canceled()||this.mirror.parentNode.removeChild(this.mirror)}[I](){this.scrollOffset={x:window.scrollX-this.initialScrollOffset.x,y:window.scrollY-this.initialScrollOffset.y}}[A]({mirror:_,source:C,sensorEvent:B}){const $={mirror:_,source:C,sensorEvent:B,mirrorClass:this.draggable.getClassNameFor("mirror"),scrollOffset:this.scrollOffset,options:this.options};return Promise.resolve($).then(D).then(U).then(Y).then(K).then(L({initial:!0})).then(j).then(X=>{let{mirrorOffset:Z,initialX:ie,initialY:fe}=X,ae=p(X,["mirrorOffset","initialX","initialY"]);return this.mirrorOffset=Z,this.initialX=ie,this.initialY=fe,u({mirrorOffset:Z,initialX:ie,initialY:fe},ae)})}[O](_){if(_.canceled())return null;const C={mirror:_.mirror,sensorEvent:_.sensorEvent,mirrorOffset:this.mirrorOffset,options:this.options,initialX:this.initialX,initialY:this.initialY,scrollOffset:this.scrollOffset};return Promise.resolve(C).then(L({raf:!0}))}[T](_){const C=this.options.appendTo;return typeof C=="string"?document.querySelector(C):C instanceof HTMLElement?C:typeof C=="function"?C(_):_.parentNode}}function D(m){let{source:_}=m,C=p(m,["source"]);return N(B=>{const $=_.getBoundingClientRect();B(u({source:_,sourceRect:$},C))})}function U(m){let{sensorEvent:_,sourceRect:C,options:B}=m,$=p(m,["sensorEvent","sourceRect","options"]);return N(X=>{const Z=B.cursorOffsetY===null?_.clientY-C.top:B.cursorOffsetY,ie=B.cursorOffsetX===null?_.clientX-C.left:B.cursorOffsetX;X(u({sensorEvent:_,sourceRect:C,mirrorOffset:{top:Z,left:ie},options:B},$))})}function Y(m){let{mirror:_,source:C,options:B}=m,$=p(m,["mirror","source","options"]);return N(X=>{let Z,ie;if(B.constrainDimensions){const fe=getComputedStyle(C);Z=fe.getPropertyValue("height"),ie=fe.getPropertyValue("width")}_.style.position="fixed",_.style.pointerEvents="none",_.style.top=0,_.style.left=0,_.style.margin=0,B.constrainDimensions&&(_.style.height=Z,_.style.width=ie),X(u({mirror:_,source:C,options:B},$))})}function K(m){let{mirror:_,mirrorClass:C}=m,B=p(m,["mirror","mirrorClass"]);return N($=>{_.classList.add(C),$(u({mirror:_,mirrorClass:C},B))})}function j(m){let{mirror:_}=m,C=p(m,["mirror"]);return N(B=>{_.removeAttribute("id"),delete _.id,B(u({mirror:_},C))})}function L({withFrame:m=!1,initial:_=!1}={}){return C=>{let{mirror:B,sensorEvent:$,mirrorOffset:X,initialY:Z,initialX:ie,scrollOffset:fe,options:ae}=C,ge=p(C,["mirror","sensorEvent","mirrorOffset","initialY","initialX","scrollOffset","options"]);return N(he=>{const ye=u({mirror:B,sensorEvent:$,mirrorOffset:X,options:ae},ge);if(X){const et=$.clientX-X.left-fe.x,_e=$.clientY-X.top-fe.y;ae.xAxis&&ae.yAxis||_?B.style.transform=`translate3d(${et}px, ${_e}px, 0)`:ae.xAxis&&!ae.yAxis?B.style.transform=`translate3d(${et}px, ${Z}px, 0)`:ae.yAxis&&!ae.xAxis&&(B.style.transform=`translate3d(${ie}px, ${_e}px, 0)`),_&&(ye.initialX=et,ye.initialY=_e)}he(ye)},{frame:m})}}function N(m,{raf:_=!1}={}){return new Promise((C,B)=>{_?requestAnimationFrame(()=>{m(C,B)}):m(C,B)})}a.default=k},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=void 0;var c,u=l(31),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default,a.defaultOptions=u.defaultOptions},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=Object.assign||function(A){for(var O=1;O<arguments.length;O++){var I=arguments[O];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(A[T]=I[T])}return A},d=l(4),h=(c=d)&&c.__esModule?c:{default:c};const f=Symbol("onInitialize"),p=Symbol("onDestroy"),v={};class E extends h.default{constructor(O){super(O),this.options=u({},v,this.getOptions()),this[f]=this[f].bind(this),this[p]=this[p].bind(this)}attach(){this.draggable.on("draggable:initialize",this[f]).on("draggable:destroy",this[p])}detach(){this.draggable.off("draggable:initialize",this[f]).off("draggable:destroy",this[p])}
136getOptions(){return this.draggable.options.focusable||{}}getElements(){return[...this.draggable.containers,...this.draggable.getDraggableElements()]}[f](){requestAnimationFrame(()=>{this.getElements().forEach(O=>function(I){!I.getAttribute("tabindex")&&I.tabIndex===-1&&(x.push(I),I.tabIndex=0)}(O))})}[p](){requestAnimationFrame(()=>{this.getElements().forEach(O=>function(I){const T=x.indexOf(I);T!==-1&&(I.tabIndex=-1,x.splice(T,1))}(O))})}}a.default=E;const x=[]},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=l(33),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.default=class{constructor(c){this.draggable=c}attach(){throw new Error("Not Implemented")}detach(){throw new Error("Not Implemented")}}},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=void 0;var c,u=Object.assign||function(I){for(var T=1;T<arguments.length;T++){var P=arguments[T];for(var k in P)Object.prototype.hasOwnProperty.call(P,k)&&(I[k]=P[k])}return I},d=l(4),h=(c=d)&&c.__esModule?c:{default:c};const f=Symbol("onInitialize"),p=Symbol("onDestroy"),v=Symbol("announceEvent"),E=Symbol("announceMessage"),x=a.defaultOptions={expire:7e3};class A extends h.default{constructor(T){super(T),this.options=u({},x,this.getOptions()),this.originalTriggerMethod=this.draggable.trigger,this[f]=this[f].bind(this),this[p]=this[p].bind(this)}attach(){this.draggable.on("draggable:initialize",this[f])}detach(){this.draggable.off("draggable:destroy",this[p])}getOptions(){return this.draggable.options.announcements||{}}[v](T){const P=this.options[T.type];P&&typeof P=="string"&&this[E](P),P&&typeof P=="function"&&this[E](P(T))}[E](T){(function(P,{expire:k}){const D=document.createElement("div");D.textContent=P,O.appendChild(D),setTimeout(()=>{O.removeChild(D)},k)})(T,{expire:this.options.expire})}[f](){this.draggable.trigger=T=>{try{this[v](T)}finally{this.originalTriggerMethod.call(this.draggable,T)}}}[p](){this.draggable.trigger=this.originalTriggerMethod}}a.default=A;const O=function(){const I=document.createElement("div");return I.setAttribute("id","draggable-live-region"),I.setAttribute("aria-relevant","additions"),I.setAttribute("aria-atomic","true"),I.setAttribute("aria-live","assertive"),I.setAttribute("role","log"),I.style.position="fixed",I.style.width="1px",I.style.height="1px",I.style.top="-1px",I.style.overflow="hidden",I}();document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(O)})},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.defaultOptions=void 0;var c,u=l(36),d=(c=u)&&c.__esModule?c:{default:c};a.default=d.default,a.defaultOptions=u.defaultOptions},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.DraggableDestroyEvent=a.DraggableInitializedEvent=a.DraggableEvent=void 0;var c,u=l(3),d=(c=u)&&c.__esModule?c:{default:c};class h extends d.default{get draggable(){return this.data.draggable}}a.DraggableEvent=h,h.type="draggable";class f extends h{}a.DraggableInitializedEvent=f,f.type="draggable:initialize";class p extends h{}a.DraggableDestroyEvent=p,p.type="draggable:destroy"},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.DragStopEvent=a.DragPressureEvent=a.DragOutContainerEvent=a.DragOverContainerEvent=a.DragOutEvent=a.DragOverEvent=a.DragMoveEvent=a.DragStartEvent=a.DragEvent=void 0;var c,u=l(3),d=(c=u)&&c.__esModule?c:{default:c};class h extends d.default{get source(){return this.data.source}get originalSource(){return this.data.originalSource}get mirror(){return this.data.mirror}get sourceContainer(){return this.data.sourceContainer}get sensorEvent(){return this.data.sensorEvent}get originalEvent(){return this.sensorEvent?this.sensorEvent.originalEvent:null}}a.DragEvent=h,h.type="drag";class f extends h{}a.DragStartEvent=f,f.type="drag:start",f.cancelable=!0;class p extends h{}a.DragMoveEvent=p,p.type="drag:move";class v extends h{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}a.DragOverEvent=v,v.type="drag:over",v.cancelable=!0;class E extends h{get overContainer(){return this.data.overContainer}get over(){return this.data.over}}a.DragOutEvent=E,E.type="drag:out";class x extends h{get overContainer(){return this.data.overContainer}}
136a.DragOverContainerEvent=x,x.type="drag:over:container";class A extends h{get overContainer(){return this.data.overContainer}}a.DragOutContainerEvent=A,A.type="drag:out:container";class O extends h{get pressure(){return this.data.pressure}}a.DragPressureEvent=O,O.type="drag:pressure";class I extends h{}a.DragStopEvent=I,I.type="drag:stop"},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(8);Object.keys(c).forEach(function(E){E!=="default"&&E!=="__esModule"&&Object.defineProperty(a,E,{enumerable:!0,get:function(){return c[E]}})});var u=l(7);Object.keys(u).forEach(function(E){E!=="default"&&E!=="__esModule"&&Object.defineProperty(a,E,{enumerable:!0,get:function(){return u[E]}})});var d=l(6);Object.keys(d).forEach(function(E){E!=="default"&&E!=="__esModule"&&Object.defineProperty(a,E,{enumerable:!0,get:function(){return d[E]}})});var h=l(5);Object.keys(h).forEach(function(E){E!=="default"&&E!=="__esModule"&&Object.defineProperty(a,E,{enumerable:!0,get:function(){return h[E]}})});var f,p=l(12),v=(f=p)&&f.__esModule?f:{default:f};a.default=v.default},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c,u=Object.assign||function(P){for(var k=1;k<arguments.length;k++){var D=arguments[k];for(var U in D)Object.prototype.hasOwnProperty.call(D,U)&&(P[U]=D[U])}return P},d=l(40),h=(c=d)&&c.__esModule?c:{default:c},f=l(9);const p=Symbol("onDragStart"),v=Symbol("onDragOverContainer"),E=Symbol("onDragOver"),x=Symbol("onDragStop"),A={"sortable:sorted":function({dragEvent:P}){const k=P.source.textContent.trim()||P.source.id||"sortable element";if(P.over){const D=P.over.textContent.trim()||P.over.id||"sortable element";return P.source.compareDocumentPosition(P.over)&Node.DOCUMENT_POSITION_FOLLOWING?`Placed ${k} after ${D}`:`Placed ${k} before ${D}`}return`Placed ${k} into a different container`}};class O extends h.default{constructor(k=[],D={}){super(k,u({},D,{announcements:u({},A,D.announcements||{})})),this.startIndex=null,this.startContainer=null,this[p]=this[p].bind(this),this[v]=this[v].bind(this),this[E]=this[E].bind(this),this[x]=this[x].bind(this),this.on("drag:start",this[p]).on("drag:over:container",this[v]).on("drag:over",this[E]).on("drag:stop",this[x])}destroy(){super.destroy(),this.off("drag:start",this[p]).off("drag:over:container",this[v]).off("drag:over",this[E]).off("drag:stop",this[x])}index(k){return this.getDraggableElementsForContainer(k.parentNode).indexOf(k)}[p](k){this.startContainer=k.source.parentNode,this.startIndex=this.index(k.source);const D=new f.SortableStartEvent({dragEvent:k,startIndex:this.startIndex,startContainer:this.startContainer});this.trigger(D),D.canceled()&&k.cancel()}[v](k){if(k.canceled())return;const{source:D,over:U,overContainer:Y}=k,K=this.index(D),j=new f.SortableSortEvent({dragEvent:k,currentIndex:K,source:D,over:U});if(this.trigger(j),j.canceled())return;const L=T({source:D,over:U,overContainer:Y,children:this.getDraggableElementsForContainer(Y)});if(!L)return;const{oldContainer:N,newContainer:m}=L,_=this.index(k.source),C=new f.SortableSortedEvent({dragEvent:k,oldIndex:K,newIndex:_,oldContainer:N,newContainer:m});this.trigger(C)}[E](k){if(k.over===k.originalSource||k.over===k.source)return;const{source:D,over:U,overContainer:Y}=k,K=this.index(D),j=new f.SortableSortEvent({dragEvent:k,currentIndex:K,source:D,over:U});if(this.trigger(j),j.canceled())return;const L=T({source:D,over:U,overContainer:Y,children:this.getDraggableElementsForContainer(Y)});if(!L)return;const{oldContainer:N,newContainer:m}=L,_=this.index(D),C=new f.SortableSortedEvent({dragEvent:k,oldIndex:K,newIndex:_,oldContainer:N,newContainer:m});this.trigger(C)}[x](k){const D=new f.SortableStopEvent({dragEvent:k,oldIndex:this.startIndex,newIndex:this.index(k.source),oldContainer:this.startContainer,newContainer:k.source.parentNode});this.trigger(D),this.startIndex=null,this.startContainer=null}}function I(P){return Array.prototype.indexOf.call(P.parentNode.children,P)}function T({source:P,over:k,overContainer:D,children:U}){const Y=!U.length,K=P.parentNode!==D;return Y?function(L,N){const m=L.parentNode;return N.appendChild(L),{oldContainer:m,newContainer:N}}(P,D):k&&!K?function(L,N){const m=I(L),_=I(N);return m<_?L.parentNode.insertBefore(L,N.nextElementSibling):L.parentNode.insertBefore(L,N),{oldContainer:L.parentNode,newContainer:L.parentNode}}(P,k):K?function(L,N,m){const _=L.parentNode;return N?N.parentNode.insertBefore(L,N):m.appendChild(L),{oldContainer:_,newContainer:L.parentNode}}(P,k,D):null}a.default=O},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=Object.assign||function(h){for(var f=1;f<arguments.length;f++){var p=arguments[f];for(var v in p)Object.prototype.hasOwnProperty.call(p,v)&&(h[v]=p[v])}return h};const u=Symbol("canceled");class d{constructor(f){this[u]=!1,this.data=f}get type(){return this.constructor.type}get cancelable(){return this.constructor.cancelable}cancel(){this[u]=!0}canceled(){return!!this[u]}clone(f){return new this.constructor(c({},this.data,f))}}a.default=d,d.type="event",d.cancelable=!1},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0}),a.SortableStopEvent=a.SortableSortedEvent=a.SortableSortEvent=a.SortableStartEvent=a.SortableEvent=void 0;var c,u=l(3),d=(c=u)&&c.__esModule?c:{default:c};class h extends d.default{get dragEvent(){return this.data.dragEvent}}a.SortableEvent=h,h.type="sortable";class f extends h{get startIndex(){return this.data.startIndex}get startContainer(){return this.data.startContainer}}
136a.SortableStartEvent=f,f.type="sortable:start",f.cancelable=!0;class p extends h{get currentIndex(){return this.data.currentIndex}get over(){return this.data.oldIndex}get overContainer(){return this.data.newIndex}}a.SortableSortEvent=p,p.type="sortable:sort",p.cancelable=!0;class v extends h{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}a.SortableSortedEvent=v,v.type="sortable:sorted";class E extends h{get oldIndex(){return this.data.oldIndex}get newIndex(){return this.data.newIndex}get oldContainer(){return this.data.oldContainer}get newContainer(){return this.data.newContainer}}a.SortableStopEvent=E,E.type="sortable:stop"},function(o,a,l){Object.defineProperty(a,"__esModule",{value:!0});var c=l(9);Object.keys(c).forEach(function(f){f!=="default"&&f!=="__esModule"&&Object.defineProperty(a,f,{enumerable:!0,get:function(){return c[f]}})});var u,d=l(41),h=(u=d)&&u.__esModule?u:{default:u};a.default=h.default}])},i.exports=r()}),e=(n=t)&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;if(window.Livewire===void 0)throw"Livewire Sortable Plugin: window.Livewire is undefined. Make sure @livewireScripts is placed above this script include";window.Livewire.directive("sortable-group",({el:i,directive:s,component:r})=>{if(s.modifiers.includes("item-group")&&i.closest("[wire\\:sortable-group]").livewire_sortable.addContainer(i),s.modifiers.length>0)return;let o={draggable:"[wire\\:sortable-group\\.item]"};i.querySelector("[wire\\:sortable-group\\.handle]")&&(o.handle="[wire\\:sortable-group\\.handle]"),(i.livewire_sortable=new e([],o)).on("sortable:stop",()=>{setTimeout(()=>{let a=[];i.querySelectorAll("[wire\\:sortable-group\\.item-group]").forEach((l,c)=>{let u=[];l.querySelectorAll("[wire\\:sortable-group\\.item]").forEach((d,h)=>{u.push({order:h+1,value:d.getAttribute("wire:sortable-group.item")})}),a.push({order:c+1,value:l.getAttribute("wire:sortable-group.item-group"),items:u})}),r.$wire.call(s.method,a)},1)})}),window.Livewire.directive("sortable",({el:i,directive:s,component:r})=>{if(s.modifiers.length>0)return;let o={draggable:"[wire\\:sortable\\.item]"};i.querySelector("[wire\\:sortable\\.handle]")&&(o.handle="[wire\\:sortable\\.handle]"),new e(i,o).on("sortable:stop",()=>{setTimeout(()=>{let a=[];i.querySelectorAll("[wire\\:sortable\\.item]").forEach((l,c)=>{a.push({order:c+1,value:l.getAttribute("wire:sortable.item")})}),r.$wire.call(s.method,a)},1)})})});var xE={exports:{}};xE.exports;(function(n,t){(function(e,i){n.exports=i()})(r7,function(){function e(w,b){var S=Object.keys(w);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(w);b&&(M=M.filter(function(R){return Object.getOwnPropertyDescriptor(w,R).enumerable})),S.push.apply(S,M)}return S}function i(w){for(var b=1;b<arguments.length;b++){var S=arguments[b]!=null?arguments[b]:{};b%2?e(Object(S),!0).forEach(function(M){l(w,M,S[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):e(Object(S)).forEach(function(M){Object.defineProperty(w,M,Object.getOwnPropertyDescriptor(S,M))})}return w}function s(w){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},s(w)}function r(w,b){if(!(w instanceof b))throw new TypeError("Cannot call a class as a function")}function o(w,b){for(var S=0;S<b.length;S++){var M=b[S];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(w,v(M.key),M)}}function a(w,b,S){return b&&o(w.prototype,b),S&&o(w,S),Object.defineProperty(w,"prototype",{writable:!1}),w}function l(w,b,S){return(b=v(b))in w?Object.defineProperty(w,b,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[b]=S,w}function c(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(b&&b.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),Object.defineProperty(w,"prototype",{writable:!1}),b&&d(w,b)}function u(w){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(b){return b.__proto__||Object.getPrototypeOf(b)},u(w)}
vendor: 43,373 bytes, line 136
136function d(w,b){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,M){return S.__proto__=M,S},d(w,b)}function h(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function f(w){var b=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var S,M=u(w);if(b){var R=u(this).constructor;S=Reflect.construct(M,arguments,R)}else S=M.apply(this,arguments);return function(H,z){if(z&&(typeof z=="object"||typeof z=="function"))return z;if(z!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h(H)}(this,S)}}function p(){return p=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(w,b,S){var M=function(H,z){for(;!Object.prototype.hasOwnProperty.call(H,z)&&(H=u(H))!==null;);return H}(w,b);if(M){var R=Object.getOwnPropertyDescriptor(M,b);return R.get?R.get.call(arguments.length<3?w:S):R.value}},p.apply(this,arguments)}function v(w){var b=function(S,M){if(typeof S!="object"||S===null)return S;var R=S[Symbol.toPrimitive];if(R!==void 0){var H=R.call(S,M||"default");if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(S)}(w,"string");return typeof b=="symbol"?b:b+""}var E=function(w){return!(!w||!w.Window)&&w instanceof w.Window},x=void 0,A=void 0;function O(w){x=w;var b=w.document.createTextNode("");b.ownerDocument!==w.document&&typeof w.wrap=="function"&&w.wrap(b)===b&&(w=w.wrap(w)),A=w}function I(w){return E(w)?w:(w.ownerDocument||w).defaultView||A.window}typeof window<"u"&&window&&O(window);var T=function(w){return!!w&&s(w)==="object"},P=function(w){return typeof w=="function"},k={window:function(w){return w===A||E(w)},docFrag:function(w){return T(w)&&w.nodeType===11},object:T,func:P,number:function(w){return typeof w=="number"},bool:function(w){return typeof w=="boolean"},string:function(w){return typeof w=="string"},element:function(w){if(!w||s(w)!=="object")return!1;var b=I(w)||A;return/object|function/.test(typeof Element>"u"?"undefined":s(Element))?w instanceof Element||w instanceof b.Element:w.nodeType===1&&typeof w.nodeName=="string"},plainObject:function(w){return T(w)&&!!w.constructor&&/function Object\b/.test(w.constructor.toString())},array:function(w){return T(w)&&w.length!==void 0&&P(w.splice)}};function D(w){var b=w.interaction;if(b.prepared.name==="drag"){var S=b.prepared.axis;S==="x"?(b.coords.cur.page.y=b.coords.start.page.y,b.coords.cur.client.y=b.coords.start.client.y,b.coords.velocity.client.y=0,b.coords.velocity.page.y=0):S==="y"&&(b.coords.cur.page.x=b.coords.start.page.x,b.coords.cur.client.x=b.coords.start.client.x,b.coords.velocity.client.x=0,b.coords.velocity.page.x=0)}}function U(w){var b=w.iEvent,S=w.interaction;if(S.prepared.name==="drag"){var M=S.prepared.axis;if(M==="x"||M==="y"){var R=M==="x"?"y":"x";b.page[R]=S.coords.start.page[R],b.client[R]=S.coords.start.client[R],b.delta[R]=0}}}var Y={id:"actions/drag",install:function(w){var b=w.actions,S=w.Interactable,M=w.defaults;S.prototype.draggable=Y.draggable,b.map.drag=Y,b.methodDict.drag="draggable",M.actions.drag=Y.defaults},listeners:{"interactions:before-action-move":D,"interactions:action-resume":D,"interactions:action-move":U,"auto-start:check":function(w){var b=w.interaction,S=w.interactable,M=w.buttons,R=S.options.drag;if(R&&R.enabled&&(!b.pointerIsDown||!/mouse|pointer/.test(b.pointerType)||M&S.options.drag.mouseButtons))return w.action={name:"drag",axis:R.lockAxis==="start"?R.startAxis:R.lockAxis},!1}},draggable:function(w){return k.object(w)?(this.options.drag.enabled=w.enabled!==!1,this.setPerAction("drag",w),this.setOnEvents("drag",w),/^(xy|x|y|start)$/.test(w.lockAxis)&&(this.options.drag.lockAxis=w.lockAxis),/^(xy|x|y)$/.test(w.startAxis)&&(this.options.drag.startAxis=w.startAxis),this):k.bool(w)?(this.options.drag.enabled=w,this):this.options.drag},beforeMove:D,move:U,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(w){return w.search("drag")===0}},K=Y,j={init:function(w){var b=w;j.document=b.document,j.DocumentFragment=b.DocumentFragment||L,j.SVGElement=b.SVGElement||L,j.SVGSVGElement=b.SVGSVGElement||L,j.SVGElementInstance=b.SVGElementInstance||L,j.Element=b.Element||L,j.HTMLElement=b.HTMLElement||j.Element,j.Event=b.Event,j.Touch=b.Touch||L,j.PointerEvent=b.PointerEvent||b.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function L(){}var N=j,m={init:function(w){var b=N.Element,S=w.navigator||{};m.supportsTouch="ontouchstart"in w||k.func(w.DocumentTouch)&&N.document instanceof w.DocumentTouch,m.supportsPointerEvent=S.pointerEnabled!==!1&&!!N.PointerEvent,m.isIOS=/iP(hone|od|ad)/.test(S.platform),m.isIOS7=/iP(hone|od|ad)/.test(S.platform)&&/OS 7[^\d]/.test(S.appVersion),m.isIe9=/MSIE 9/.test(S.userAgent),m.isOperaMobile=S.appName==="Opera"&&m.supportsTouch&&/Presto/.test(S.userAgent),m.prefixedMatchesSelector="matches"in b.prototype?"matches":"webkitMatchesSelector"in b.prototype?"webkitMatchesSelector":"mozMatchesSelector"in b.prototype?"mozMatchesSelector":"oMatchesSelector"in b.prototype?"oMatchesSelector":"msMatchesSelector",m.pEventTypes=m.supportsPointerEvent?N.PointerEvent===w.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,m.wheelEvent=N.document&&"onmousewheel"in N.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},_=m;function C(w,b){if(w.contains)return w.contains(b);for(;b;){if(b===w)return!0;b=b.parentNode}return!1}function B(w,b){for(;k.element(w);){if(X(w,b))return w;w=$(w)}return null}function $(w){var b=w.parentNode;if(k.docFrag(b)){for(;(b=b.host)&&k.docFrag(b););return b}return b}function X(w,b){return A!==x&&(b=b.replace(/\/deep\//g," ")),w[_.prefixedMatchesSelector](b)}var Z=function(w){return w.parentNode||w.host};function ie(w,b){for(var S,M=[],R=w;(S=Z(R))&&R!==b&&S!==R.ownerDocument;)M.unshift(R),R=S;return M}function fe(w,b,S){for(;k.element(w);){if(X(w,b))return!0;if((w=$(w))===S)return X(w,b)}return!1}function ae(w){return w.correspondingUseElement||w}function ge(w){var b=w instanceof N.SVGElement?w.getBoundingClientRect():w.getClientRects()[0];return b&&{left:b.left,right:b.right,top:b.top,bottom:b.bottom,width:b.width||b.right-b.left,height:b.height||b.bottom-b.top}}function he(w){var b,S=ge(w);if(!_.isIOS7&&S){var M={x:(b=(b=I(w))||A).scrollX||b.document.documentElement.scrollLeft,y:b.scrollY||b.document.documentElement.scrollTop};S.left+=M.x,S.right+=M.x,S.top+=M.y,S.bottom+=M.y}return S}function ye(w){for(var b=[];w;)b.push(w),w=$(w);return b}function et(w){return!!k.string(w)&&(N.document.querySelector(w),!0)}function _e(w,b){for(var S in b)w[S]=b[S];return w}function gt(w,b,S){return w==="parent"?$(S):w==="self"?b.getRect(S):B(S,w)}function $e(w,b,S,M){var R=w;return k.string(R)?R=gt(R,b,S):k.func(R)&&(R=R.apply(void 0,M)),k.element(R)&&(R=he(R)),R}function Vt(w){return w&&{x:"x"in w?w.x:w.left,y:"y"in w?w.y:w.top}}function An(w){return!w||"x"in w&&"y"in w||((w=_e({},w)).x=w.left||0,w.y=w.top||0,w.width=w.width||(w.right||0)-w.x,w.height=w.height||(w.bottom||0)-w.y),w}function vt(w,b,S){w.left&&(b.left+=S.x),w.right&&(b.right+=S.x),w.top&&(b.top+=S.y),w.bottom&&(b.bottom+=S.y),b.width=b.right-b.left,b.height=b.bottom-b.top}function Bt(w,b,S){var M=S&&w.options[S];return Vt($e(M&&M.origin||w.options.origin,w,b,[w&&b]))||{x:0,y:0}}function At(w,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(q){return!0},M=arguments.length>3?arguments[3]:void 0;if(M=M||{},k.string(w)&&w.search(" ")!==-1&&(w=Ti(w)),k.array(w))return w.forEach(function(q){return At(q,b,S,M)}),M;if(k.object(w)&&(b=w,w=""),k.func(b)&&S(w))M[w]=M[w]||[],M[w].push(b);else if(k.array(b))for(var R=0,H=b;R<H.length;R++){var z=H[R];At(w,z,S,M)}else if(k.object(b))for(var G in b)At(Ti(G).map(function(q){return"".concat(w).concat(q)}),b[G],S,M);return M}function Ti(w){return w.trim().split(/ +/)}var gi=function(w,b){return Math.sqrt(w*w+b*b)},kr=["webkit","moz"];function Wi(w,b){w.__set||(w.__set={});var S=function(R){if(kr.some(function(H){return R.indexOf(H)===0}))return 1;typeof w[R]!="function"&&R!=="__set"&&Object.defineProperty(w,R,{get:function(){return R in w.__set?w.__set[R]:w.__set[R]=b[R]},set:function(H){w.__set[R]=H},configurable:!0})};for(var M in b)S(M);return w}function xi(w,b){w.page=w.page||{},w.page.x=b.page.x,w.page.y=b.page.y,w.client=w.client||{},w.client.x=b.client.x,w.client.y=b.client.y,w.timeStamp=b.timeStamp}function mi(w){w.page.x=0,w.page.y=0,w.client.x=0,w.client.y=0}function nr(w){return w instanceof N.Event||w instanceof N.Touch}function jn(w,b,S){return w=w||"page",(S=S||{}).x=b[w+"X"],S.y=b[w+"Y"],S}function Jc(w,b){return b=b||{x:0,y:0},_.isOperaMobile&&nr(w)?(jn("screen",w,b),b.x+=window.scrollX,b.y+=window.scrollY):jn("page",w,b),b}function Zc(w){return k.number(w.pointerId)?w.pointerId:w.identifier}function Hy(w,b,S){var M=b.length>1?zy(b):b[0];Jc(M,w.page),function(R,H){H=H||{},_.isOperaMobile&&nr(R)?jn("screen",R,H):jn("client",R,H)}(M,w.client),w.timeStamp=S}function El(w){var b=[];return k.array(w)?(b[0]=w[0],b[1]=w[1]):w.type==="touchend"?w.touches.length===1?(b[0]=w.touches[0],b[1]=w.changedTouches[0]):w.touches.length===0&&(b[0]=w.changedTouches[0],b[1]=w.changedTouches[1]):(b[0]=w.touches[0],b[1]=w.touches[1]),b}function zy(w){for(var b={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},S=0;S<w.length;S++){var M=w[S];for(var R in b)b[R]+=M[R]}for(var H in b)b[H]/=w.length;return b}function Oh(w){if(!w.length)return null;var b=El(w),S=Math.min(b[0].pageX,b[1].pageX),M=Math.min(b[0].pageY,b[1].pageY),R=Math.max(b[0].pageX,b[1].pageX),H=Math.max(b[0].pageY,b[1].pageY);return{x:S,y:M,left:S,top:M,right:R,bottom:H,width:R-S,height:H-M}}function Dh(w,b){var S=b+"X",M=b+"Y",R=El(w),H=R[0][S]-R[1][S],z=R[0][M]-R[1][M];return gi(H,z)}function Rh(w,b){var S=b+"X",M=b+"Y",R=El(w),H=R[1][S]-R[0][S],z=R[1][M]-R[0][M];return 180*Math.atan2(z,H)/Math.PI}function Qc(w){return k.string(w.pointerType)?w.pointerType:k.number(w.pointerType)?[void 0,void 0,"touch","pen","mouse"][w.pointerType]:/touch/.test(w.type||"")||w instanceof N.Touch?"touch":"mouse"}function Hm(w){var b=k.func(w.composedPath)?w.composedPath():w.path;return[ae(b?b[0]:w.target),ae(w.currentTarget)]}var Sl=function(){function w(b){r(this,w),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=b}return a(w,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),w}();Object.defineProperty(Sl.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var zm=function(w,b){for(var S=0;S<b.length;S++){var M=b[S];w.push(M)}return w},eu=function(w){return zm([],w)},Tl=function(w,b){for(var S=0;S<w.length;S++)if(b(w[S],S,w))return S;return-1},xl=function(w,b){return w[Tl(w,b)]},ra=function(w){c(S,w);var b=f(S);function S(M,R,H){var z;r(this,S),(z=b.call(this,R._interaction)).dropzone=void 0,z.dragEvent=void 0,z.relatedTarget=void 0,z.draggable=void 0,z.propagationStopped=!1,z.immediatePropagationStopped=!1;var G=H==="dragleave"?M.prev:M.cur,q=G.element,ne=G.dropzone;return z.type=H,z.target=q,z.currentTarget=q,z.dropzone=ne,z.dragEvent=R,z.relatedTarget=R.target,z.draggable=R.interactable,z.timeStamp=R.timeStamp,z}return a(S,[{key:"reject",value:function(){var M=this,R=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&R.cur.dropzone===this.dropzone&&R.cur.element===this.target)if(R.prev.dropzone=this.dropzone,R.prev.element=this.target,R.rejected=!0,R.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var H=R.activeDrops,z=Tl(H,function(q){var ne=q.dropzone,J=q.element;return ne===M.dropzone&&J===M.target});R.activeDrops.splice(z,1);var G=new S(R,this.dragEvent,"dropdeactivate");G.dropzone=this.dropzone,G.target=this.target,this.dropzone.fire(G)}else this.dropzone.fire(new S(R,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),S}(Sl);function Jt(w,b){for(var S=0,M=w.slice();S<M.length;S++){var R=M[S],H=R.dropzone,z=R.element;b.dropzone=H,b.target=z,H.fire(b),b.propagationStopped=b.immediatePropagationStopped=!1}}function tu(w,b){for(var S=function(H,z){for(var G=[],q=0,ne=H.interactables.list;q<ne.length;q++){var J=ne[q];if(J.options.drop.enabled){var re=J.options.drop.accept;if(!(k.element(re)&&re!==z||k.string(re)&&!X(z,re)||k.func(re)&&!re({dropzone:J,draggableElement:z})))for(var de=0,ve=J.getAllElements();de<ve.length;de++){var be=ve[de];be!==z&&G.push({dropzone:J,element:be,rect:J.getRect(be)})}}}return G}(w,b),M=0;M<S.length;M++){var R=S[M];R.rect=R.dropzone.getRect(R.element)}return S}function Lh(w,b,S){for(var M=w.dropState,R=w.interactable,H=w.element,z=[],G=0,q=M.activeDrops;G<q.length;G++){var ne=q[G],J=ne.dropzone,re=ne.element,de=ne.rect,ve=J.dropCheck(b,S,R,H,re,de);z.push(ve?re:null)}var be=function(Te){for(var Le,De,je,ot=[],Et=0;Et<Te.length;Et++){var Qe=Te[Et],ct=Te[Le];if(Qe&&Et!==Le)if(ct){var ji=Z(Qe),un=Z(ct);if(ji!==Qe.ownerDocument)if(un!==Qe.ownerDocument)if(ji!==un){ot=ot.length?ot:ie(ct);var Ts=void 0;if(ct instanceof N.HTMLElement&&Qe instanceof N.SVGElement&&!(Qe instanceof N.SVGSVGElement)){if(Qe===un)continue;Ts=Qe.ownerSVGElement}else Ts=Qe;for(var Ir=ie(Ts,ct.ownerDocument),oa=0;Ir[oa]&&Ir[oa]===ot[oa];)oa++;var Jy=[Ir[oa-1],Ir[oa],ot[oa]];if(Jy[0])for(var Km=Jy[0].lastChild;Km;){if(Km===Jy[1]){Le=Et,ot=Ir;break}if(Km===Jy[2])break;Km=Km.previousSibling}}else je=ct,(parseInt(I(De=Qe).getComputedStyle(De).zIndex,10)||0)>=(parseInt(I(je).getComputedStyle(je).zIndex,10)||0)&&(Le=Et);else Le=Et}else Le=Et}return Le}(z);return M.activeDrops[be]||null}function Al(w,b,S){var M=w.dropState,R={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return S.type==="dragstart"&&(R.activate=new ra(M,S,"dropactivate"),R.activate.target=null,R.activate.dropzone=null),S.type==="dragend"&&(R.deactivate=new ra(M,S,"dropdeactivate"),R.deactivate.target=null,R.deactivate.dropzone=null),M.rejected||(M.cur.element!==M.prev.element&&(M.prev.dropzone&&(R.leave=new ra(M,S,"dragleave"),S.dragLeave=R.leave.target=M.prev.element,S.prevDropzone=R.leave.dropzone=M.prev.dropzone),M.cur.dropzone&&(R.enter=new ra(M,S,"dragenter"),S.dragEnter=M.cur.element,S.dropzone=M.cur.dropzone)),S.type==="dragend"&&M.cur.dropzone&&(R.drop=new ra(M,S,"drop"),S.dropzone=M.cur.dropzone,S.relatedTarget=M.cur.element),S.type==="dragmove"&&M.cur.dropzone&&(R.move=new ra(M,S,"dropmove"),S.dropzone=M.cur.dropzone)),R}function nu(w,b){var S=w.dropState,M=S.activeDrops,R=S.cur,H=S.prev;b.leave&&H.dropzone.fire(b.leave),b.enter&&R.dropzone.fire(b.enter),b.move&&R.dropzone.fire(b.move),b.drop&&R.dropzone.fire(b.drop),b.deactivate&&Jt(M,b.deactivate),S.prev.dropzone=R.dropzone,S.prev.element=R.element}function ir(w,b){var S=w.interaction,M=w.iEvent,R=w.event;if(M.type==="dragmove"||M.type==="dragend"){var H=S.dropState;b.dynamicDrop&&(H.activeDrops=tu(b,S.element));var z=M,G=Lh(S,z,R);H.rejected=H.rejected&&!!G&&G.dropzone===H.cur.dropzone&&G.element===H.cur.element,H.cur.dropzone=G&&G.dropzone,H.cur.element=G&&G.element,H.events=Al(S,0,z)}}var $y={id:"actions/drop",install:function(w){var b=w.actions,S=w.interactStatic,M=w.Interactable,R=w.defaults;w.usePlugin(K),M.prototype.dropzone=function(H){return function(z,G){if(k.object(G)){if(z.options.drop.enabled=G.enabled!==!1,G.listeners){var q=At(G.listeners),ne=Object.keys(q).reduce(function(re,de){return re[/^(enter|leave)/.test(de)?"drag".concat(de):/^(activate|deactivate|move)/.test(de)?"drop".concat(de):de]=q[de],re},{}),J=z.options.drop.listeners;J&&z.off(J),z.on(ne),z.options.drop.listeners=ne}return k.func(G.ondrop)&&z.on("drop",G.ondrop),k.func(G.ondropactivate)&&z.on("dropactivate",G.ondropactivate),k.func(G.ondropdeactivate)&&z.on("dropdeactivate",G.ondropdeactivate),k.func(G.ondragenter)&&z.on("dragenter",G.ondragenter),k.func(G.ondragleave)&&z.on("dragleave",G.ondragleave),k.func(G.ondropmove)&&z.on("dropmove",G.ondropmove),/^(pointer|center)$/.test(G.overlap)?z.options.drop.overlap=G.overlap:k.number(G.overlap)&&(z.options.drop.overlap=Math.max(Math.min(1,G.overlap),0)),"accept"in G&&(z.options.drop.accept=G.accept),"checker"in G&&(z.options.drop.checker=G.checker),z}return k.bool(G)?(z.options.drop.enabled=G,z):z.options.drop}(this,H)},M.prototype.dropCheck=function(H,z,G,q,ne,J){return function(re,de,ve,be,Te,Le,De){var je=!1;if(!(De=De||re.getRect(Le)))return!!re.options.drop.checker&&re.options.drop.checker(de,ve,je,re,Le,be,Te);var ot=re.options.drop.overlap;if(ot==="pointer"){var Et=Bt(be,Te,"drag"),Qe=Jc(de);Qe.x+=Et.x,Qe.y+=Et.y;var ct=Qe.x>De.left&&Qe.x<De.right,ji=Qe.y>De.top&&Qe.y<De.bottom;je=ct&&ji}var un=be.getRect(Te);if(un&&ot==="center"){var Ts=un.left+un.width/2,Ir=un.top+un.height/2;je=Ts>=De.left&&Ts<=De.right&&Ir>=De.top&&Ir<=De.bottom}return un&&k.number(ot)&&(je=Math.max(0,Math.min(De.right,un.right)-Math.max(De.left,un.left))*Math.max(0,Math.min(De.bottom,un.bottom)-Math.max(De.top,un.top))/(un.width*un.height)>=ot),re.options.drop.checker&&(je=re.options.drop.checker(de,ve,je,re,Le,be,Te)),je}(this,H,z,G,q,ne,J)},S.dynamicDrop=function(H){return k.bool(H)?(w.dynamicDrop=H,S):w.dynamicDrop},_e(b.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),b.methodDict.drop="dropzone",w.dynamicDrop=!1,R.actions.drop=$y.defaults},listeners:{"interactions:before-action-start":function(w){var b=w.interaction;b.prepared.name==="drag"&&(b.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(w,b){var S=w.interaction,M=(w.event,w.iEvent);if(S.prepared.name==="drag"){var R=S.dropState;R.activeDrops=[],R.events={},R.activeDrops=tu(b,S.element),R.events=Al(S,0,M),R.events.activate&&(Jt(R.activeDrops,R.events.activate),b.fire("actions/drop:start",{interaction:S,dragEvent:M}))}},"interactions:action-move":ir,"interactions:after-action-move":function(w,b){var S=w.interaction,M=w.iEvent;if(S.prepared.name==="drag"){var R=S.dropState;nu(S,R.events),b.fire("actions/drop:move",{interaction:S,dragEvent:M}),R.events={}}},"interactions:action-end":function(w,b){if(w.interaction.prepared.name==="drag"){var S=w.interaction,M=w.iEvent;ir(w,b),nu(S,S.dropState.events),b.fire("actions/drop:end",{interaction:S,dragEvent:M})}},"interactions:stop":function(w){var b=w.interaction;if(b.prepared.name==="drag"){var S=b.dropState;S&&(S.activeDrops=null,S.events=null,S.cur.dropzone=null,S.cur.element=null,S.prev.dropzone=null,S.prev.element=null,S.rejected=!1)}}},getActiveDrops:tu,getDrop:Lh,getDropEvents:Al,fireDropEvents:nu,filterEventType:function(w){return w.search("drag")===0||w.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},te=$y;function Q(w){var b=w.interaction,S=w.iEvent,M=w.phase;if(b.prepared.name==="gesture"){var R=b.pointers.map(function(ne){return ne.pointer}),H=M==="start",z=M==="end",G=b.interactable.options.deltaSource;if(S.touches=[R[0],R[1]],H)S.distance=Dh(R,G),S.box=Oh(R),S.scale=1,S.ds=0,S.angle=Rh(R,G),S.da=0,b.gesture.startDistance=S.distance,b.gesture.startAngle=S.angle;else if(z||b.pointers.length<2){var q=b.prevEvent;S.distance=q.distance,S.box=q.box,S.scale=q.scale,S.ds=0,S.angle=q.angle,S.da=0}else S.distance=Dh(R,G),S.box=Oh(R),S.scale=S.distance/b.gesture.startDistance,S.angle=Rh(R,G),S.ds=S.scale-b.gesture.scale,S.da=S.angle-b.gesture.angle;b.gesture.distance=S.distance,b.gesture.angle=S.angle,k.number(S.scale)&&S.scale!==1/0&&!isNaN(S.scale)&&(b.gesture.scale=S.scale)}}var se={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(w){var b=w.actions,S=w.Interactable,M=w.defaults;S.prototype.gesturable=function(R){return k.object(R)?(this.options.gesture.enabled=R.enabled!==!1,this.setPerAction("gesture",R),this.setOnEvents("gesture",R),this):k.bool(R)?(this.options.gesture.enabled=R,this):this.options.gesture},b.map.gesture=se,b.methodDict.gesture="gesturable",M.actions.gesture=se.defaults},listeners:{"interactions:action-start":Q,"interactions:action-move":Q,"interactions:action-end":Q,"interactions:new":function(w){w.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(w){if(!(w.interaction.pointers.length<2)){var b=w.interactable.options.gesture;if(b&&b.enabled)return w.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(w){return w.search("gesture")===0}},le=se;function Ae(w,b,S,M,R,H,z){if(!b)return!1;if(b===!0){var G=k.number(H.width)?H.width:H.right-H.left,q=k.number(H.height)?H.height:H.bottom-H.top;if(z=Math.min(z,Math.abs((w==="left"||w==="right"?G:q)/2)),G<0&&(w==="left"?w="right":w==="right"&&(w="left")),q<0&&(w==="top"?w="bottom":w==="bottom"&&(w="top")),w==="left"){var ne=G>=0?H.left:H.right;return S.x<ne+z}if(w==="top"){var J=q>=0?H.top:H.bottom;return S.y<J+z}if(w==="right")return S.x>(G>=0?H.right:H.left)-z;if(w==="bottom")return S.y>(q>=0?H.bottom:H.top)-z}return!!k.element(M)&&(k.element(b)?b===M:fe(M,b,R))}function Re(w){var b=w.iEvent,S=w.interaction;if(S.prepared.name==="resize"&&S.resizeAxes){var M=b;S.interactable.options.resize.square?(S.resizeAxes==="y"?M.delta.x=M.delta.y:M.delta.y=M.delta.x,M.axes="xy"):(M.axes=S.resizeAxes,S.resizeAxes==="x"?M.delta.y=0:S.resizeAxes==="y"&&(M.delta.x=0))}}var We,Ce,Ue={id:"actions/resize",before:["actions/drag"],install:function(w){var b=w.actions,S=w.browser,M=w.Interactable,R=w.defaults;Ue.cursors=function(H){return H.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(S),Ue.defaultMargin=S.supportsTouch||S.supportsPointerEvent?20:10,M.prototype.resizable=function(H){return function(z,G,q){return k.object(G)?(z.options.resize.enabled=G.enabled!==!1,z.setPerAction("resize",G),z.setOnEvents("resize",G),k.string(G.axis)&&/^x$|^y$|^xy$/.test(G.axis)?z.options.resize.axis=G.axis:G.axis===null&&(z.options.resize.axis=q.defaults.actions.resize.axis),k.bool(G.preserveAspectRatio)?z.options.resize.preserveAspectRatio=G.preserveAspectRatio:k.bool(G.square)&&(z.options.resize.square=G.square),z):k.bool(G)?(z.options.resize.enabled=G,z):z.options.resize}(this,H,w)},b.map.resize=Ue,b.methodDict.resize="resizable",R.actions.resize=Ue.defaults},listeners:{"interactions:new":function(w){w.interaction.resizeAxes="xy"},"interactions:action-start":function(w){(function(b){var S=b.iEvent,M=b.interaction;if(M.prepared.name==="resize"&&M.prepared.edges){var R=S,H=M.rect;M._rects={start:_e({},H),corrected:_e({},H),previous:_e({},H),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},R.edges=M.prepared.edges,R.rect=M._rects.corrected,R.deltaRect=M._rects.delta}})(w),Re(w)},"interactions:action-move":function(w){(function(b){var S=b.iEvent,M=b.interaction;if(M.prepared.name==="resize"&&M.prepared.edges){var R=S,H=M.interactable.options.resize.invert,z=H==="reposition"||H==="negate",G=M.rect,q=M._rects,ne=q.start,J=q.corrected,re=q.delta,de=q.previous;if(_e(de,J),z){if(_e(J,G),H==="reposition"){if(J.top>J.bottom){var ve=J.top;J.top=J.bottom,J.bottom=ve}if(J.left>J.right){var be=J.left;J.left=J.right,J.right=be}}}else J.top=Math.min(G.top,ne.bottom),J.bottom=Math.max(G.bottom,ne.top),J.left=Math.min(G.left,ne.right),J.right=Math.max(G.right,ne.left);for(var Te in J.width=J.right-J.left,J.height=J.bottom-J.top,J)re[Te]=J[Te]-de[Te];R.edges=M.prepared.edges,R.rect=J,R.deltaRect=re}})(w),Re(w)},"interactions:action-end":function(w){var b=w.iEvent,S=w.interaction;if(S.prepared.name==="resize"&&S.prepared.edges){var M=b;M.edges=S.prepared.edges,M.rect=S._rects.corrected,M.deltaRect=S._rects.delta}},"auto-start:check":function(w){var b=w.interaction,S=w.interactable,M=w.element,R=w.rect,H=w.buttons;if(R){var z=_e({},b.coords.cur.page),G=S.options.resize;if(G&&G.enabled&&(!b.pointerIsDown||!/mouse|pointer/.test(b.pointerType)||H&G.mouseButtons)){if(k.object(G.edges)){var q={left:!1,right:!1,top:!1,bottom:!1};for(var ne in q)q[ne]=Ae(ne,G.edges[ne],z,b._latestPointer.eventTarget,M,R,G.margin||Ue.defaultMargin);q.left=q.left&&!q.right,q.top=q.top&&!q.bottom,(q.left||q.right||q.top||q.bottom)&&(w.action={name:"resize",edges:q})}else{var J=G.axis!=="y"&&z.x>R.right-Ue.defaultMargin,re=G.axis!=="x"&&z.y>R.bottom-Ue.defaultMargin;(J||re)&&(w.action={name:"resize",axes:(J?"x":"")+(re?"y":"")})}return!w.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(w){var b=w.edges,S=w.axis,M=w.name,R=Ue.cursors,H=null;if(S)H=R[M+S];else if(b){for(var z="",G=0,q=["top","bottom","left","right"];G<q.length;G++){var ne=q[G];b[ne]&&(z+=ne)}H=R[z]}return H},filterEventType:function(w){return w.search("resize")===0},defaultMargin:null},qe=Ue,Ze={id:"actions",install:function(w){w.usePlugin(le),w.usePlugin(qe),w.usePlugin(K),w.usePlugin(te)}},it=0,yt={request:function(w){return We(w)},cancel:function(w){return Ce(w)},init:function(w){if(We=w.requestAnimationFrame,Ce=w.cancelAnimationFrame,!We)for(var b=["ms","moz","webkit","o"],S=0;S<b.length;S++){var M=b[S];We=w["".concat(M,"RequestAnimationFrame")],Ce=w["".concat(M,"CancelAnimationFrame")]||w["".concat(M,"CancelRequestAnimationFrame")]}We=We&&We.bind(w),Ce=Ce&&Ce.bind(w),We||(We=function(R){var H=Date.now(),z=Math.max(0,16-(H-it)),G=w.setTimeout(function(){R(H+z)},z);return it=H+z,G},Ce=function(R){return clearTimeout(R)})}},Oe={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(w){Oe.isScrolling=!0,yt.cancel(Oe.i),w.autoScroll=Oe,Oe.interaction=w,Oe.prevTime=Oe.now(),Oe.i=yt.request(Oe.scroll)},stop:function(){Oe.isScrolling=!1,Oe.interaction&&(Oe.interaction.autoScroll=null),yt.cancel(Oe.i)},scroll:function(){var w=Oe.interaction,b=w.interactable,S=w.element,M=w.prepared.name,R=b.options[M].autoScroll,H=Wt(R.container,b,S),z=Oe.now(),G=(z-Oe.prevTime)/1e3,q=R.speed*G;if(q>=1){var ne={x:Oe.x*q,y:Oe.y*q};if(ne.x||ne.y){var J=Qn(H);k.window(H)?H.scrollBy(ne.x,ne.y):H&&(H.scrollLeft+=ne.x,H.scrollTop+=ne.y);var re=Qn(H),de={x:re.x-J.x,y:re.y-J.y};(de.x||de.y)&&b.fire({type:"autoscroll",target:S,interactable:b,delta:de,interaction:w,container:H})}Oe.prevTime=z}Oe.isScrolling&&(yt.cancel(Oe.i),Oe.i=yt.request(Oe.scroll))},check:function(w,b){var S;return(S=w.options[b].autoScroll)==null?void 0:S.enabled},onInteractionMove:function(w){var b=w.interaction,S=w.pointer;if(b.interacting()&&Oe.check(b.interactable,b.prepared.name))if(b.simulation)Oe.x=Oe.y=0;else{var M,R,H,z,G=b.interactable,q=b.element,ne=b.prepared.name,J=G.options[ne].autoScroll,re=Wt(J.container,G,q);if(k.window(re))z=S.clientX<Oe.margin,M=S.clientY<Oe.margin,R=S.clientX>re.innerWidth-Oe.margin,H=S.clientY>re.innerHeight-Oe.margin;else{var de=ge(re);z=S.clientX<de.left+Oe.margin,M=S.clientY<de.top+Oe.margin,R=S.clientX>de.right-Oe.margin,H=S.clientY>de.bottom-Oe.margin}Oe.x=R?1:z?-1:0,Oe.y=H?1:M?-1:0,Oe.isScrolling||(Oe.margin=J.margin,Oe.speed=J.speed,Oe.start(b))}}};function Wt(w,b,S){return(k.string(w)?gt(w,b,S):w)||I(S)}function Qn(w){return k.window(w)&&(w=window.document.body),{x:w.scrollLeft,y:w.scrollTop}}var iu={id:"auto-scroll",install:function(w){var b=w.defaults,S=w.actions;w.autoScroll=Oe,Oe.now=function(){return w.now()},S.phaselessTypes.autoscroll=!0,b.perAction.autoScroll=Oe.defaults},listeners:{"interactions:new":function(w){w.interaction.autoScroll=null},"interactions:destroy":function(w){w.interaction.autoScroll=null,Oe.stop(),Oe.interaction&&(Oe.interaction=null)},"interactions:stop":Oe.stop,"interactions:action-move":function(w){return Oe.onInteractionMove(w)}}},$m=iu;function su(w,b){var S=!1;return function(){return S||(A.console.warn(b),S=!0),w.apply(this,arguments)}}function Wm(w,b){return w.name=b.name,w.axis=b.axis,w.edges=b.edges,w}function ax(w){return k.bool(w)?(this.options.styleCursor=w,this):w===null?(delete this.options.styleCursor,this):this.options.styleCursor}function lx(w){return k.func(w)?(this.options.actionChecker=w,this):w===null?(delete this.options.actionChecker,this):this.options.actionChecker}var ru={id:"auto-start/interactableMethods",install:function(w){var b=w.Interactable;b.prototype.getAction=function(S,M,R,H){var z=function(G,q,ne,J,re){var de=G.getRect(J),ve=q.buttons||{0:1,1:4,3:8,4:16}[q.button],be={action:null,interactable:G,interaction:ne,element:J,rect:de,buttons:ve};return re.fire("auto-start:check",be),be.action}(this,M,R,H,w);return this.options.actionChecker?this.options.actionChecker(S,M,z,this,H,R):z},b.prototype.ignoreFrom=su(function(S){return this._backCompatOption("ignoreFrom",S)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),b.prototype.allowFrom=su(function(S){return this._backCompatOption("allowFrom",S)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),b.prototype.actionChecker=lx,b.prototype.styleCursor=ax}};function Cl(w,b,S,M,R){return b.testIgnoreAllow(b.options[w.name],S,M)&&b.options[w.name].enabled&&Wy(b,S,w,R)?w:null}function Um(w,b,S,M,R,H,z){for(var G=0,q=M.length;G<q;G++){var ne=M[G],J=R[G],re=ne.getAction(b,S,w,J);if(re){var de=Cl(re,ne,J,H,z);if(de)return{action:de,interactable:ne,element:J}}}return{action:null,interactable:null,element:null}}function Fh(w,b,S,M,R){var H=[],z=[],G=M;function q(J){H.push(J),z.push(G)}for(;k.element(G);){H=[],z=[],R.interactables.forEachMatch(G,q);var ne=Um(w,b,S,H,z,M,R);if(ne.action&&!ne.interactable.options[ne.action.name].manualStart)return ne;G=$(G)}return{action:null,interactable:null,element:null}}function cx(w,b,S){var M=b.action,R=b.interactable,H=b.element;M=M||{name:null},w.interactable=R,w.element=H,Wm(w.prepared,M),w.rect=R&&M.name?R.getRect(H):null,DO(w,S),S.fire("autoStart:prepared",{interaction:w})}function Wy(w,b,S,M){var R=w.options,H=R[S.name].max,z=R[S.name].maxPerElement,G=M.autoStart.maxInteractions,q=0,ne=0,J=0;if(!(H&&z&&G))return!1;for(var re=0,de=M.interactions.list;re<de.length;re++){var ve=de[re],be=ve.prepared.name;if(ve.interacting()&&(++q>=G||ve.interactable===w&&((ne+=be===S.name?1:0)>=H||ve.element===b&&(J++,be===S.name&&J>=z))))return!1}return G>0}function OO(w,b){return k.number(w)?(b.autoStart.maxInteractions=w,this):b.autoStart.maxInteractions}function ux(w,b,S){var M=S.autoStart.cursorElement;M&&M!==w&&(M.style.cursor=""),w.ownerDocument.documentElement.style.cursor=b,w.style.cursor=b,S.autoStart.cursorElement=b?w:null}function DO(w,b){var S=w.interactable,M=w.element,R=w.prepared;if(w.pointerType==="mouse"&&S&&S.options.styleCursor){var H="";if(R.name){var z=S.options[R.name].cursorChecker;H=k.func(z)?z(R,S,M,w._interacting):b.actions.map[R.name].getCursor(R)}ux(w.element,H||"",b)}else b.autoStart.cursorElement&&ux(b.autoStart.cursorElement,"",b)}var n6={id:"auto-start/base",before:["actions"],install:function(w){var b=w.interactStatic,S=w.defaults;w.usePlugin(ru),S.base.actionChecker=null,S.base.styleCursor=!0,_e(S.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),b.maxInteractions=function(M){return OO(M,w)},w.autoStart={maxInteractions:1/0,withinInteractionLimit:Wy,cursorElement:null}},listeners:{"interactions:down":function(w,b){var S=w.interaction,M=w.pointer,R=w.event,H=w.eventTarget;S.interacting()||cx(S,Fh(S,M,R,H,b),b)},"interactions:move":function(w,b){(function(S,M){var R=S.interaction,H=S.pointer,z=S.event,G=S.eventTarget;R.pointerType!=="mouse"||R.pointerIsDown||R.interacting()||cx(R,Fh(R,H,z,G,M),M)})(w,b),function(S,M){var R=S.interaction;if(R.pointerIsDown&&!R.interacting()&&R.pointerWasMoved&&R.prepared.name){M.fire("autoStart:before-start",S);var H=R.interactable,z=R.prepared.name;z&&H&&(H.options[z].manualStart||!Wy(H,R.element,R.prepared,M)?R.stop():(R.start(R.prepared,H,R.element),DO(R,M)))}}(w,b)},"interactions:stop":function(w,b){var S=w.interaction,M=S.interactable;M&&M.options.styleCursor&&ux(S.element,"",b)}},maxInteractions:OO,withinInteractionLimit:Wy,validateAction:Cl},dx=n6,i6={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(w,b){var S=w.interaction,M=w.eventTarget,R=w.dx,H=w.dy;if(S.prepared.name==="drag"){var z=Math.abs(R),G=Math.abs(H),q=S.interactable.options.drag,ne=q.startAxis,J=z>G?"x":z<G?"y":"xy";if(S.prepared.axis=q.lockAxis==="start"?J[0]:q.lockAxis,J!=="xy"&&ne!=="xy"&&ne!==J){S.prepared.name=null;for(var re=M,de=function(be){if(be!==S.interactable){var Te=S.interactable.options.drag;if(!Te.manualStart&&be.testIgnoreAllow(Te,re,M)){var Le=be.getAction(S.downPointer,S.downEvent,S,re);if(Le&&Le.name==="drag"&&function(De,je){if(!je)return!1;var ot=je.options.drag.startAxis;return De==="xy"||ot==="xy"||ot===De}(J,be)&&dx.validateAction(Le,be,re,M,b))return be}}};k.element(re);){var ve=b.interactables.forEachMatch(re,de);if(ve){S.prepared.name="drag",S.interactable=ve,S.element=re;break}re=$(re)}}}}}};function hx(w){var b=w.prepared&&w.prepared.name;if(!b)return null;var S=w.interactable.options;return S[b].hold||S[b].delay}var s6={id:"auto-start/hold",install:function(w){var b=w.defaults;w.usePlugin(dx),b.perAction.hold=0,b.perAction.delay=0},listeners:{"interactions:new":function(w){w.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(w){var b=w.interaction,S=hx(b);S>0&&(b.autoStartHoldTimer=setTimeout(function(){b.start(b.prepared,b.interactable,b.element)},S))},"interactions:move":function(w){var b=w.interaction,S=w.duplicate;b.autoStartHoldTimer&&b.pointerWasMoved&&!S&&(clearTimeout(b.autoStartHoldTimer),b.autoStartHoldTimer=null)},"autoStart:before-start":function(w){var b=w.interaction;hx(b)>0&&(b.prepared.name=null)}},getHoldDuration:hx},r6=s6,o6={id:"auto-start",install:function(w){w.usePlugin(dx),w.usePlugin(r6),w.usePlugin(i6)}},a6=function(w){return/^(always|never|auto)$/.test(w)?(this.options.preventDefault=w,this):k.bool(w)?(this.options.preventDefault=w?"always":"never",this):this.options.preventDefault};function l6(w){var b=w.interaction,S=w.event;b.interactable&&b.interactable.checkAndPreventDefault(S)}var RO={id:"core/interactablePreventDefault",install:function(w){var b=w.Interactable;b.prototype.preventDefault=a6,b.prototype.checkAndPreventDefault=function(S){return function(M,R,H){var z=M.options.preventDefault;if(z!=="never")if(z!=="always"){if(R.events.supportsPassive&&/^touch(start|move)$/.test(H.type)){var G=I(H.target).document,q=R.getDocOptions(G);if(!q||!q.events||q.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(H.type)||k.element(H.target)&&X(H.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||H.preventDefault()}else H.preventDefault()}(this,w,S)},w.interactions.docEvents.push({type:"dragstart",listener:function(S){for(var M=0,R=w.interactions.list;M<R.length;M++){var H=R[M];if(H.element&&(H.element===S.target||C(H.element,S.target)))return void H.interactable.checkAndPreventDefault(S)}}})},listeners:["down","move","up","cancel"].reduce(function(w,b){return w["interactions:".concat(b)]=l6,w},{})};function Uy(w,b){if(b.phaselessTypes[w])return!0;for(var S in b.map)if(w.indexOf(S)===0&&w.substr(S.length)in b.phases)return!0;return!1}function Nh(w){var b={};for(var S in w){var M=w[S];k.plainObject(M)?b[S]=Nh(M):k.array(M)?b[S]=eu(M):b[S]=M}return b}var fx=function(){function w(b){r(this,w),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=b,this.result=jy(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return a(w,[{key:"start",value:function(b,S){var M,R,H=b.phase,z=this.interaction,G=function(ne){var J=ne.interactable.options[ne.prepared.name],re=J.modifiers;return re&&re.length?re:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(de){var ve=J[de];return ve&&ve.enabled&&{options:ve,methods:ve._methods}}).filter(function(de){return!!de})}(z);this.prepareStates(G),this.startEdges=_e({},z.edges),this.edges=_e({},this.startEdges),this.startOffset=(M=z.rect,R=S,M?{left:R.x-M.left,top:R.y-M.top,right:M.right-R.x,bottom:M.bottom-R.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var q=this.fillArg({phase:H,pageCoords:S,preEnd:!1});return this.result=jy(),this.startAll(q),this.result=this.setAll(q)}},{key:"fillArg",value:function(b){var S=this.interaction;return b.interaction=S,b.interactable=S.interactable,b.element=S.element,b.rect||(b.rect=S.rect),b.edges||(b.edges=this.startEdges),b.startOffset=this.startOffset,b}},{key:"startAll",value:function(b){for(var S=0,M=this.states;S<M.length;S++){var R=M[S];R.methods.start&&(b.state=R,R.methods.start(b))}}},{key:"setAll",value:function(b){var S=b.phase,M=b.preEnd,R=b.skipModifiers,H=b.rect,z=b.edges;b.coords=_e({},b.pageCoords),b.rect=_e({},H),b.edges=_e({},z);for(var G=R?this.states.slice(R):this.states,q=jy(b.coords,b.rect),ne=0;ne<G.length;ne++){var J,re=G[ne],de=re.options,ve=_e({},b.coords),be=null;(J=re.methods)!=null&&J.set&&this.shouldDo(de,M,S)&&(b.state=re,be=re.methods.set(b),vt(b.edges,b.rect,{x:b.coords.x-ve.x,y:b.coords.y-ve.y})),q.eventProps.push(be)}_e(this.edges,b.edges),q.delta.x=b.coords.x-b.pageCoords.x,q.delta.y=b.coords.y-b.pageCoords.y,q.rectDelta.left=b.rect.left-H.left,q.rectDelta.right=b.rect.right-H.right,q.rectDelta.top=b.rect.top-H.top,q.rectDelta.bottom=b.rect.bottom-H.bottom;var Te=this.result.coords,Le=this.result.rect;if(Te&&Le){var De=q.rect.left!==Le.left||q.rect.right!==Le.right||q.rect.top!==Le.top||q.rect.bottom!==Le.bottom;q.changed=De||Te.x!==q.coords.x||Te.y!==q.coords.y}return q}},{key:"applyToInteraction",value:function(b){var S=this.interaction,M=b.phase,R=S.coords.cur,H=S.coords.start,z=this.result,G=this.startDelta,q=z.delta;M==="start"&&_e(this.startDelta,z.delta);for(var ne=0,J=[[H,G],[R,q]];ne<J.length;ne++){var re=J[ne],de=re[0],ve=re[1];de.page.x+=ve.x,de.page.y+=ve.y,de.client.x+=ve.x,de.client.y+=ve.y}var be=this.result.rectDelta,Te=b.rect||S.rect;Te.left+=be.left,Te.right+=be.right,Te.top+=be.top,Te.bottom+=be.bottom,Te.width=Te.right-Te.left,Te.height=Te.bottom-Te.top}},{key:"setAndApply",value:function(b){var S=this.interaction,M=b.phase,R=b.preEnd,H=b.skipModifiers,z=this.setAll(this.fillArg({preEnd:R,phase:M,pageCoords:b.modifiedCoords||S.coords.cur.page}));if(this.result=z,!z.changed&&(!H||H<this.states.length)&&S.interacting())return!1;if(b.modifiedCoords){var G=S.coords.cur.page,q={x:b.modifiedCoords.x-G.x,y:b.modifiedCoords.y-G.y};z.coords.x+=q.x,z.coords.y+=q.y,z.delta.x+=q.x,z.delta.y+=q.y}this.applyToInteraction(b)}},{key:"beforeEnd",value:function(b){var S=b.interaction,M=b.event,R=this.states;if(R&&R.length){for(var H=!1,z=0;z<R.length;z++){var G=R[z];b.state=G;var q=G.options,ne=G.methods,J=ne.beforeEnd&&ne.beforeEnd(b);if(J)return this.endResult=J,!1;H=H||!H&&this.shouldDo(q,!0,b.phase,!0)}H&&S.move({event:M,preEnd:!0})}}},{key:"stop",value:function(b){var S=b.interaction;if(this.states&&this.states.length){var M=_e({states:this.states,interactable:S.interactable,element:S.element,rect:null},b);this.fillArg(M);for(var R=0,H=this.states;R<H.length;R++){var z=H[R];M.state=z,z.methods.stop&&z.methods.stop(M)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(b){this.states=[];for(var S=0;S<b.length;S++){var M=b[S],R=M.options,H=M.methods,z=M.name;this.states.push({options:R,methods:H,index:S,name:z})}return this.states}},{key:"restoreInteractionCoords",value:function(b){var S=b.interaction,M=S.coords,R=S.rect,H=S.modification;if(H.result){for(var z=H.startDelta,G=H.result,q=G.delta,ne=G.rectDelta,J=0,re=[[M.start,z],[M.cur,q]];J<re.length;J++){var de=re[J],ve=de[0],be=de[1];ve.page.x-=be.x,ve.page.y-=be.y,ve.client.x-=be.x,ve.client.y-=be.y}R.left-=ne.left,R.right-=ne.right,R.top-=ne.top,R.bottom-=ne.bottom}}},{key:"shouldDo",value:function(b,S,M,R){return!(!b||b.enabled===!1||R&&!b.endOnly||b.endOnly&&!S||M==="start"&&!b.setStart)}},{key:"copyFrom",value:function(b){this.startOffset=b.startOffset,this.startDelta=b.startDelta,this.startEdges=b.startEdges,this.edges=b.edges,this.states=b.states.map(function(S){return Nh(S)}),this.result=jy(_e({},b.result.coords),_e({},b.result.rect))}},{key:"destroy",value:function(){for(var b in this)this[b]=null}}]),w}();function jy(w,b){return{rect:b,coords:w,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function kl(w,b){var S=w.defaults,M={start:w.start,set:w.set,beforeEnd:w.beforeEnd,stop:w.stop},R=function(H){var z=H||{};for(var G in z.enabled=z.enabled!==!1,S)G in z||(z[G]=S[G]);var q={options:z,methods:M,name:b,enable:function(){return z.enabled=!0,q},disable:function(){return z.enabled=!1,q}};return q};return b&&typeof b=="string"&&(R._defaults=S,R._methods=M),R}function jm(w){var b=w.iEvent,S=w.interaction.modification.result;S&&(b.modifiers=S.eventProps)}var c6={id:"modifiers/base",before:["actions"],install:function(w){w.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(w){var b=w.interaction;b.modification=new fx(b)},"interactions:before-action-start":function(w){var b=w.interaction,S=w.interaction.modification;S.start(w,b.coords.start.page),b.edges=S.edges,S.applyToInteraction(w)},"interactions:before-action-move":function(w){var b=w.interaction,S=b.modification,M=S.setAndApply(w);return b.edges=S.edges,M},"interactions:before-action-end":function(w){var b=w.interaction,S=b.modification,M=S.beforeEnd(w);return b.edges=S.startEdges,M},"interactions:action-start":jm,"interactions:action-move":jm,"interactions:action-end":jm,"interactions:after-action-start":function(w){return w.interaction.modification.restoreInteractionCoords(w)},"interactions:after-action-move":function(w){return w.interaction.modification.restoreInteractionCoords(w)},"interactions:stop":function(w){return w.interaction.modification.stop(w)}}}
vendor: 6,054 bytes, line 136
136,LO=c6,FO={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},gx=function(w){c(S,w);var b=f(S);function S(M,R,H,z,G,q,ne){var J;r(this,S),(J=b.call(this,M)).relatedTarget=null,J.screenX=void 0,J.screenY=void 0,J.button=void 0,J.buttons=void 0,J.ctrlKey=void 0,J.shiftKey=void 0,J.altKey=void 0,J.metaKey=void 0,J.page=void 0,J.client=void 0,J.delta=void 0,J.rect=void 0,J.x0=void 0,J.y0=void 0,J.t0=void 0,J.dt=void 0,J.duration=void 0,J.clientX0=void 0,J.clientY0=void 0,J.velocity=void 0,J.speed=void 0,J.swipe=void 0,J.axes=void 0,J.preEnd=void 0,G=G||M.element;var re=M.interactable,de=(re&&re.options||FO).deltaSource,ve=Bt(re,G,H),be=z==="start",Te=z==="end",Le=be?h(J):M.prevEvent,De=be?M.coords.start:Te?{page:Le.page,client:Le.client,timeStamp:M.coords.cur.timeStamp}:M.coords.cur;return J.page=_e({},De.page),J.client=_e({},De.client),J.rect=_e({},M.rect),J.timeStamp=De.timeStamp,Te||(J.page.x-=ve.x,J.page.y-=ve.y,J.client.x-=ve.x,J.client.y-=ve.y),J.ctrlKey=R.ctrlKey,J.altKey=R.altKey,J.shiftKey=R.shiftKey,J.metaKey=R.metaKey,J.button=R.button,J.buttons=R.buttons,J.target=G,J.currentTarget=G,J.preEnd=q,J.type=ne||H+(z||""),J.interactable=re,J.t0=be?M.pointers[M.pointers.length-1].downTime:Le.t0,J.x0=M.coords.start.page.x-ve.x,J.y0=M.coords.start.page.y-ve.y,J.clientX0=M.coords.start.client.x-ve.x,J.clientY0=M.coords.start.client.y-ve.y,J.delta=be||Te?{x:0,y:0}:{x:J[de].x-Le[de].x,y:J[de].y-Le[de].y},J.dt=M.coords.delta.timeStamp,J.duration=J.timeStamp-J.t0,J.velocity=_e({},M.coords.velocity[de]),J.speed=gi(J.velocity.x,J.velocity.y),J.swipe=Te||z==="inertiastart"?J.getSwipe():null,J}return a(S,[{key:"getSwipe",value:function(){var M=this._interaction;if(M.prevEvent.speed<600||this.timeStamp-M.prevEvent.timeStamp>150)return null;var R=180*Math.atan2(M.prevEvent.velocityY,M.prevEvent.velocityX)/Math.PI;R<0&&(R+=360);var H=112.5<=R&&R<247.5,z=202.5<=R&&R<337.5;return{up:z,down:!z&&22.5<=R&&R<157.5,left:H,right:!H&&(292.5<=R||R<67.5),angle:R,speed:M.prevEvent.speed,velocity:{x:M.prevEvent.velocityX,y:M.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),S}(Sl);Object.defineProperties(gx.prototype,{pageX:{get:function(){return this.page.x},set:function(w){this.page.x=w}},pageY:{get:function(){return this.page.y},set:function(w){this.page.y=w}},clientX:{get:function(){return this.client.x},set:function(w){this.client.x=w}},clientY:{get:function(){return this.client.y},set:function(w){this.client.y=w}},dx:{get:function(){return this.delta.x},set:function(w){this.delta.x=w}},dy:{get:function(){return this.delta.y},set:function(w){this.delta.y=w}},velocityX:{get:function(){return this.velocity.x},set:function(w){this.velocity.x=w}},velocityY:{get:function(){return this.velocity.y},set:function(w){this.velocity.y=w}}});var u6=a(function w(b,S,M,R,H){r(this,w),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=b,this.pointer=S,this.event=M,this.downTime=R,this.downTarget=H}),d6=function(w){return w.interactable="",w.element="",w.prepared="",w.pointerIsDown="",w.pointerWasMoved="",w._proxy="",w}({}),NO=function(w){return w.start="",w.move="",w.end="",w.stop="",w.interacting="",w}({}),h6=0,f6=function(){function w(b){var S=this,M=b.pointerType,R=b.scopeFire;r(this,w),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=su(function(J){this.move(J)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=h6++,this._scopeFire=R,this.pointerType=M;var H=this;this._proxy={};var z=function(J){Object.defineProperty(S._proxy,J,{get:function(){return H[J]}})};for(var G in d6)z(G);var q=function(J){Object.defineProperty(S._proxy,J,{value:function(){return H[J].apply(H,arguments)}})};for(var ne in NO)q(ne);this._scopeFire("interactions:new",{interaction:this})}return a(w,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(b,S,M){var R=this.updatePointer(b,S,M,!0),H=this.pointers[R];this._scopeFire("interactions:down",{pointer:b,event:S,eventTarget:M,pointerIndex:R,pointerInfo:H,type:"down",interaction:this})}},{key:"start",value:function(b,S,M){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(b.name==="gesture"?2:1)||!S.options[b.name].enabled)&&(Wm(this.prepared,b),this.interactable=S,this.element=M,this.rect=S.getRect(M),this.edges=this.prepared.edges?_e({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(b,S,M){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(b,S,M,!1);var R,H,z=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(R=this.coords.cur.client.x-this.coords.start.client.x,H=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=gi(R,H)>this.pointerMoveTolerance);
vendor: 5,030 bytes, line 136
136var G,q,ne,J=this.getPointerIndex(b),re={pointer:b,pointerIndex:J,pointerInfo:this.pointers[J],event:S,type:"move",eventTarget:M,dx:R,dy:H,duplicate:z,interaction:this};z||(G=this.coords.velocity,q=this.coords.delta,ne=Math.max(q.timeStamp/1e3,.001),G.page.x=q.page.x/ne,G.page.y=q.page.y/ne,G.client.x=q.client.x/ne,G.client.y=q.client.y/ne,G.timeStamp=ne),this._scopeFire("interactions:move",re),z||this.simulation||(this.interacting()&&(re.type=null,this.move(re)),this.pointerWasMoved&&xi(this.coords.prev,this.coords.cur))}},{key:"move",value:function(b){b&&b.event||mi(this.coords.delta),(b=_e({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},b||{})).phase="move",this._doPhase(b)}},{key:"pointerUp",value:function(b,S,M,R){var H=this.getPointerIndex(b);H===-1&&(H=this.updatePointer(b,S,M,!1));var z=/cancel$/i.test(S.type)?"cancel":"up";this._scopeFire("interactions:".concat(z),{pointer:b,pointerIndex:H,pointerInfo:this.pointers[H],event:S,eventTarget:M,type:z,curEventTarget:R,interaction:this}),this.simulation||this.end(S),this.removePointer(b,S)}},{key:"documentBlur",value:function(b){this.end(b),this._scopeFire("interactions:blur",{event:b,type:"blur",interaction:this})}},{key:"end",value:function(b){var S;this._ending=!0,b=b||this._latestPointer.event,this.interacting()&&(S=this._doPhase({event:b,interaction:this,phase:"end"})),this._ending=!1,S===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(b){var S=Zc(b);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:Tl(this.pointers,function(M){return M.id===S})}},{key:"getPointerInfo",value:function(b){return this.pointers[this.getPointerIndex(b)]}},{key:"updatePointer",value:function(b,S,M,R){var H,z,G,q=Zc(b),ne=this.getPointerIndex(b),J=this.pointers[ne];return R=R!==!1&&(R||/(down|start)$/i.test(S.type)),J?J.pointer=b:(J=new u6(q,b,S,null,null),ne=this.pointers.length,this.pointers.push(J)),Hy(this.coords.cur,this.pointers.map(function(re){return re.pointer}),this._now()),H=this.coords.delta,z=this.coords.prev,G=this.coords.cur,H.page.x=G.page.x-z.page.x,H.page.y=G.page.y-z.page.y,H.client.x=G.client.x-z.client.x,H.client.y=G.client.y-z.client.y,H.timeStamp=G.timeStamp-z.timeStamp,R&&(this.pointerIsDown=!0,J.downTime=this.coords.cur.timeStamp,J.downTarget=M,Wi(this.downPointer,b),this.interacting()||(xi(this.coords.start,this.coords.cur),xi(this.coords.prev,this.coords.cur),this.downEvent=S,this.pointerWasMoved=!1)),this._updateLatestPointer(b,S,M),this._scopeFire("interactions:update-pointer",{pointer:b,event:S,eventTarget:M,down:R,pointerInfo:J,pointerIndex:ne,interaction:this}),ne}},{key:"removePointer",value:function(b,S){var M=this.getPointerIndex(b);if(M!==-1){var R=this.pointers[M];this._scopeFire("interactions:remove-pointer",{pointer:b,event:S,eventTarget:null,pointerIndex:M,pointerInfo:R,interaction:this}),this.pointers.splice(M,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(b,S,M){this._latestPointer.pointer=b,this._latestPointer.event=S,this._latestPointer.eventTarget=M}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(b,S,M,R){return new gx(this,b,this.prepared.name,S,this.element,M,R)}},{key:"_fireEvent",value:function(b){var S;(S=this.interactable)==null||S.fire(b),(!this.prevEvent||b.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=b)}},{key:"_doPhase",value:function(b){var S=b.event,M=b.phase,R=b.preEnd,H=b.type,z=this.rect;if(z&&M==="move"&&(vt(this.edges,z,this.coords.delta[this.interactable.options.deltaSource]),z.width=z.right-z.left,z.height=z.bottom-z.top),this._scopeFire("interactions:before-action-".concat(M),b)===!1)return!1;var G=b.iEvent=this._createPreparedEvent(S,M,R,H);return this._scopeFire("interactions:action-".concat(M),b),M==="start"&&(this.prevEvent=G),this._fireEvent(G),this._scopeFire("interactions:after-action-".concat(M),b),!0}},{key:"_now",value:function(){return Date.now()}}]),w}();function BO(w){VO(w.interaction)}function VO(w){if(!function(S){return!(!S.offset.pending.x&&!S.offset.pending.y)}(w))return!1;var b=w.offset.pending;return mx(w.coords.cur,b),mx(w.coords.delta,b),vt(w.edges,w.rect,b),b.x=0,b.y=0,!0}function g6(w){var b=w.x,S=w.y;this.offset.pending.x+=b,this.offset.pending.y+=S,this.offset.total.x+=b,this.offset.total.y+=S}function mx(w,b){var S=w.page,M=w.client,R=b.x,H=b.y;S.x+=R,S.y+=H,M.x+=R,M.y+=H}NO.offsetBy="";var m6={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(w){
vendor: 6,092 bytes, line 136
136w.Interaction.prototype.offsetBy=g6},listeners:{"interactions:new":function(w){w.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(w){return function(b){b.pointerIsDown&&(mx(b.coords.cur,b.offset.total),b.offset.pending.x=0,b.offset.pending.y=0)}(w.interaction)},"interactions:before-action-start":BO,"interactions:before-action-move":BO,"interactions:before-action-end":function(w){var b=w.interaction;if(VO(b))return b.move({offset:!0}),b.end(),!1},"interactions:stop":function(w){var b=w.interaction;b.offset.total.x=0,b.offset.total.y=0,b.offset.pending.x=0,b.offset.pending.y=0}}},HO=m6,p6=function(){function w(b){r(this,w),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=b}return a(w,[{key:"start",value:function(b){var S=this.interaction,M=Gy(S);if(!M||!M.enabled)return!1;var R=S.coords.velocity.client,H=gi(R.x,R.y),z=this.modification||(this.modification=new fx(S));if(z.copyFrom(S.modification),this.t0=S._now(),this.allowResume=M.allowResume,this.v0=H,this.currentOffset={x:0,y:0},this.startCoords=S.coords.cur.page,this.modifierArg=z.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-S.coords.cur.timeStamp<50&&H>M.minSpeed&&H>M.endSpeed)this.startInertia();else{if(z.result=z.setAll(this.modifierArg),!z.result.changed)return!1;this.startSmoothEnd()}return S.modification.result.rect=null,S.offsetBy(this.targetOffset),S._doPhase({interaction:S,event:b,phase:"inertiastart"}),S.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),S.modification.result.rect=null,this.active=!0,S.simulation=this,!0}},{key:"startInertia",value:function(){var b=this,S=this.interaction.coords.velocity.client,M=Gy(this.interaction),R=M.resistance,H=-Math.log(M.endSpeed/this.v0)/R;this.targetOffset={x:(S.x-H)/R,y:(S.y-H)/R},this.te=H,this.lambda_v0=R/this.v0,this.one_ve_v0=1-M.endSpeed/this.v0;var z=this.modification,G=this.modifierArg;G.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},z.result=z.setAll(G),z.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+z.result.delta.x,y:this.targetOffset.y+z.result.delta.y}),this.onNextFrame(function(){return b.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var b=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return b.smoothEndTick()})}},{key:"onNextFrame",value:function(b){var S=this;this.timeout=yt.request(function(){S.active&&b()})}},{key:"inertiaTick",value:function(){var b,S,M,R,H,z,G,q=this,ne=this.interaction,J=Gy(ne).resistance,re=(ne._now()-this.t0)/1e3;if(re<this.te){var de,ve=1-(Math.exp(-J*re)-this.lambda_v0)/this.one_ve_v0;this.isModified?(b=0,S=0,M=this.targetOffset.x,R=this.targetOffset.y,H=this.modifiedOffset.x,z=this.modifiedOffset.y,de={x:zO(G=ve,b,M,H),y:zO(G,S,R,z)}):de={x:this.targetOffset.x*ve,y:this.targetOffset.y*ve};var be={x:de.x-this.currentOffset.x,y:de.y-this.currentOffset.y};this.currentOffset.x+=be.x,this.currentOffset.y+=be.y,ne.offsetBy(be),ne.move(),this.onNextFrame(function(){return q.inertiaTick()})}else ne.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var b=this,S=this.interaction,M=S._now()-this.t0,R=Gy(S).smoothEndDuration;if(M<R){var H={x:$O(M,0,this.targetOffset.x,R),y:$O(M,0,this.targetOffset.y,R)},z={x:H.x-this.currentOffset.x,y:H.y-this.currentOffset.y};this.currentOffset.x+=z.x,this.currentOffset.y+=z.y,S.offsetBy(z),S.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return b.smoothEndTick()})}else S.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(b){var S=b.pointer,M=b.event,R=b.eventTarget,H=this.interaction;H.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),H.updatePointer(S,M,R,!0),H._doPhase({interaction:H,event:M,phase:"resume"}),xi(H.coords.prev,H.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,yt.cancel(this.timeout)}}]),w}();function Gy(w){var b=w.interactable,S=w.prepared;return b&&b.options&&S.name&&b.options[S.name].inertia}var b6={id:"inertia",before:["modifiers","actions"],install:function(w){var b=w.defaults;w.usePlugin(HO),w.usePlugin(LO),w.actions.phases.inertiastart=!0,w.actions.phases.resume=!0,b.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(w){var b=w.interaction;b.inertia=new p6(b)},"interactions:before-action-end":function(w){var b=w.interaction,S=w.event;return(!b._interacting||b.simulation||!b.inertia.start(S))&&null},"interactions:down":function(w){var b=w.interaction,S=w.eventTarget,M=b.inertia;if(M.active)for(var R=S;k.element(R);){if(R===b.element){M.resume(w);break}R=$(R)}},"interactions:stop":function(w){var b=w.interaction.inertia;b.active&&b.stop()},"interactions:before-action-resume":function(w){var b=w.interaction.modification;b.stop(w),b.start(w,w.interaction.coords.cur.page),b.applyToInteraction(w)},"interactions:before-action-inertiastart":function(w){return w.interaction.modification.setAndApply(w)},"interactions:action-resume":jm,"interactions:action-inertiastart":jm,"interactions:after-action-inertiastart":function(w){return w.interaction.modification.restoreInteractionCoords(w)},"interactions:after-action-resume":function(w){return w.interaction.modification.restoreInteractionCoords(w)}}};function zO(w,b,S,M){var R=1-w;
vendor: 21,785 bytes, line 136
136return R*R*b+2*R*w*S+w*w*M}function $O(w,b,S,M){return-S*(w/=M)*(w-2)+b}var w6=b6;function WO(w,b){for(var S=0;S<b.length;S++){var M=b[S];if(w.immediatePropagationStopped)break;M(w)}}var UO=function(){function w(b){r(this,w),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=_e({},b||{})}return a(w,[{key:"fire",value:function(b){var S,M=this.global;(S=this.types[b.type])&&WO(b,S),!b.propagationStopped&&M&&(S=M[b.type])&&WO(b,S)}},{key:"on",value:function(b,S){var M=At(b,S);for(b in M)this.types[b]=zm(this.types[b]||[],M[b])}},{key:"off",value:function(b,S){var M=At(b,S);for(b in M){var R=this.types[b];if(R&&R.length)for(var H=0,z=M[b];H<z.length;H++){var G=z[H],q=R.indexOf(G);q!==-1&&R.splice(q,1)}}}},{key:"getRect",value:function(b){return null}}]),w}(),v6=function(){function w(b){r(this,w),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=b,Wi(this,b)}return a(w,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),w}();function Gm(w){return k.object(w)?{capture:!!w.capture,passive:!!w.passive}:{capture:!!w,passive:!1}}function Yy(w,b){return w===b||(typeof w=="boolean"?!!b.capture===w&&!b.passive:!!w.capture==!!b.capture&&!!w.passive==!!b.passive)}var y6={id:"events",install:function(w){var b,S=[],M={},R=[],H={add:z,remove:G,addDelegate:function(J,re,de,ve,be){var Te=Gm(be);if(!M[de]){M[de]=[];for(var Le=0;Le<R.length;Le++){var De=R[Le];z(De,de,q),z(De,de,ne,!0)}}var je=M[de],ot=xl(je,function(Et){return Et.selector===J&&Et.context===re});ot||(ot={selector:J,context:re,listeners:[]},je.push(ot)),ot.listeners.push({func:ve,options:Te})},removeDelegate:function(J,re,de,ve,be){var Te,Le=Gm(be),De=M[de],je=!1;if(De)for(Te=De.length-1;Te>=0;Te--){var ot=De[Te];if(ot.selector===J&&ot.context===re){for(var Et=ot.listeners,Qe=Et.length-1;Qe>=0;Qe--){var ct=Et[Qe];if(ct.func===ve&&Yy(ct.options,Le)){Et.splice(Qe,1),Et.length||(De.splice(Te,1),G(re,de,q),G(re,de,ne,!0)),je=!0;break}}if(je)break}}},delegateListener:q,delegateUseCapture:ne,delegatedEvents:M,documents:R,targets:S,supportsOptions:!1,supportsPassive:!1};function z(J,re,de,ve){if(J.addEventListener){var be=Gm(ve),Te=xl(S,function(Le){return Le.eventTarget===J});Te||(Te={eventTarget:J,events:{}},S.push(Te)),Te.events[re]||(Te.events[re]=[]),xl(Te.events[re],function(Le){return Le.func===de&&Yy(Le.options,be)})||(J.addEventListener(re,de,H.supportsOptions?be:be.capture),Te.events[re].push({func:de,options:be}))}}function G(J,re,de,ve){if(J.addEventListener&&J.removeEventListener){var be=Tl(S,function(ji){return ji.eventTarget===J}),Te=S[be];if(Te&&Te.events)if(re!=="all"){var Le=!1,De=Te.events[re];if(De){if(de==="all"){for(var je=De.length-1;je>=0;je--){var ot=De[je];G(J,re,ot.func,ot.options)}return}for(var Et=Gm(ve),Qe=0;Qe<De.length;Qe++){var ct=De[Qe];if(ct.func===de&&Yy(ct.options,Et)){J.removeEventListener(re,de,H.supportsOptions?Et:Et.capture),De.splice(Qe,1),De.length===0&&(delete Te.events[re],Le=!0);break}}}Le&&!Object.keys(Te.events).length&&S.splice(be,1)}else for(re in Te.events)Te.events.hasOwnProperty(re)&&G(J,re,"all")}}function q(J,re){for(var de=Gm(re),ve=new v6(J),be=M[J.type],Te=Hm(J)[0],Le=Te;k.element(Le);){for(var De=0;De<be.length;De++){var je=be[De],ot=je.selector,Et=je.context;if(X(Le,ot)&&C(Et,Te)&&C(Et,Le)){var Qe=je.listeners;ve.currentTarget=Le;for(var ct=0;ct<Qe.length;ct++){var ji=Qe[ct];Yy(ji.options,de)&&ji.func(ve)}}}Le=$(Le)}}function ne(J){return q(J,!0)}return(b=w.document)==null||b.createElement("div").addEventListener("test",null,{get capture(){return H.supportsOptions=!0},get passive(){return H.supportsPassive=!0}}),w.events=H,H}},px={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(w){for(var b=0,S=px.methodOrder;b<S.length;b++){var M=S[b],R=px[M](w);if(R)return R}return null},simulationResume:function(w){var b=w.pointerType,S=w.eventType,M=w.eventTarget,R=w.scope;if(!/down|start/i.test(S))return null;for(var H=0,z=R.interactions.list;H<z.length;H++){var G=z[H],q=M;if(G.simulation&&G.simulation.allowResume&&G.pointerType===b)for(;q;){if(q===G.element)return G;q=$(q)}}return null},mouseOrPen:function(w){var b,S=w.pointerId,M=w.pointerType,R=w.eventType,H=w.scope;if(M!=="mouse"&&M!=="pen")return null;for(var z=0,G=H.interactions.list;z<G.length;z++){var q=G[z];if(q.pointerType===M){if(q.simulation&&!jO(q,S))continue;if(q.interacting())return q;b||(b=q)}}if(b)return b;for(var ne=0,J=H.interactions.list;ne<J.length;ne++){var re=J[ne];if(!(re.pointerType!==M||/down/i.test(R)&&re.simulation))return re}return null},hasPointer:function(w){for(var b=w.pointerId,S=0,M=w.scope.interactions.list;S<M.length;S++){var R=M[S];if(jO(R,b))return R}return null},idle:function(w){for(var b=w.pointerType,S=0,M=w.scope.interactions.list;S<M.length;S++){var R=M[S];if(R.pointers.length===1){var H=R.interactable;if(H&&(!H.options.gesture||!H.options.gesture.enabled))continue}else if(R.pointers.length>=2)continue;if(!R.interacting()&&b===R.pointerType)return R}return null}};function jO(w,b){return w.pointers.some(function(S){return S.id===b})}var _6=px,bx=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function GO(w,b){return function(S){var M=b.interactions.list,R=Qc(S),H=Hm(S),z=H[0],G=H[1],q=[];if(/^touch/.test(S.type)){b.prevTouchTime=b.now();for(var ne=0,J=S.changedTouches;ne<J.length;ne++){var re=J[ne],de={pointer:re,pointerId:Zc(re),pointerType:R,eventType:S.type,eventTarget:z,curEventTarget:G,scope:b},ve=YO(de);q.push([de.pointer,de.eventTarget,de.curEventTarget,ve])}}else{var be=!1;if(!_.supportsPointerEvent&&/mouse/.test(S.type)){for(var Te=0;Te<M.length&&!be;Te++)be=M[Te].pointerType!=="mouse"&&M[Te].pointerIsDown;be=be||b.now()-b.prevTouchTime<500||S.timeStamp===0}if(!be){var Le={pointer:S,pointerId:Zc(S),pointerType:R,eventType:S.type,curEventTarget:G,eventTarget:z,scope:b},De=YO(Le);q.push([Le.pointer,Le.eventTarget,Le.curEventTarget,De])}}for(var je=0;je<q.length;je++){var ot=q[je],Et=ot[0],Qe=ot[1],ct=ot[2];ot[3][w](Et,S,Qe,ct)}}}function YO(w){var b=w.pointerType,S=w.scope,M={interaction:_6.search(w),searchDetails:w};return S.fire("interactions:find",M),M.interaction||S.interactions.new({pointerType:b})}function wx(w,b){var S=w.doc,M=w.scope,R=w.options,H=M.interactions.docEvents,z=M.events,G=z[b];for(var q in M.browser.isIOS&&!R.events&&(R.events={passive:!1}),z.delegatedEvents)G(S,q,z.delegateListener),G(S,q,z.delegateUseCapture,!0);for(var ne=R&&R.events,J=0;J<H.length;J++){var re=H[J];G(S,re.type,re.listener,ne)}}var E6={id:"core/interactions",install:function(w){for(var b={},S=0;S<bx.length;S++){var M=bx[S];b[M]=GO(M,w)}var R,H=_.pEventTypes;function z(){for(var G=0,q=w.interactions.list;G<q.length;G++){var ne=q[G];if(ne.pointerIsDown&&ne.pointerType==="touch"&&!ne._interacting)for(var J=function(){var ve=de[re];w.documents.some(function(be){return C(be.doc,ve.downTarget)})||ne.removePointer(ve.pointer,ve.event)},re=0,de=ne.pointers;re<de.length;re++)J()}}(R=N.PointerEvent?[{type:H.down,listener:z},{type:H.down,listener:b.pointerDown},{type:H.move,listener:b.pointerMove},{type:H.up,listener:b.pointerUp},{type:H.cancel,listener:b.pointerUp}]:[{type:"mousedown",listener:b.pointerDown},{type:"mousemove",listener:b.pointerMove},{type:"mouseup",listener:b.pointerUp},{type:"touchstart",listener:z},{type:"touchstart",listener:b.pointerDown},{type:"touchmove",listener:b.pointerMove},{type:"touchend",listener:b.pointerUp},{type:"touchcancel",listener:b.pointerUp}]).push({type:"blur",listener:function(G){for(var q=0,ne=w.interactions.list;q<ne.length;q++)ne[q].documentBlur(G)}}),w.prevTouchTime=0,w.Interaction=function(G){c(ne,G);var q=f(ne);function ne(){return r(this,ne),q.apply(this,arguments)}return a(ne,[{key:"pointerMoveTolerance",get:function(){return w.interactions.pointerMoveTolerance},set:function(J){w.interactions.pointerMoveTolerance=J}},{key:"_now",value:function(){return w.now()}}]),ne}(f6),w.interactions={list:[],new:function(G){G.scopeFire=function(ne,J){return w.fire(ne,J)};var q=new w.Interaction(G);return w.interactions.list.push(q),q},listeners:b,docEvents:R,pointerMoveTolerance:1},w.usePlugin(RO)},listeners:{"scope:add-document":function(w){return wx(w,"add")},"scope:remove-document":function(w){return wx(w,"remove")},"interactable:unset":function(w,b){for(var S=w.interactable,M=b.interactions.list.length-1;M>=0;M--){var R=b.interactions.list[M];R.interactable===S&&(R.stop(),b.fire("interactions:destroy",{interaction:R}),R.destroy(),b.interactions.list.length>2&&b.interactions.list.splice(M,1))}}},onDocSignal:wx,doOnInteractions:GO,methodNames:bx},S6=E6,Il=function(w){return w[w.On=0]="On",w[w.Off=1]="Off",w}(Il||{}),T6=function(){function w(b,S,M,R){r(this,w),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new UO,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=S.actions,this.target=b,this._context=S.context||M,this._win=I(et(b)?this._context:b),this._doc=this._win.document,this._scopeEvents=R,this.set(S)}return a(w,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(b,S){return k.func(S.onstart)&&this.on("".concat(b,"start"),S.onstart),k.func(S.onmove)&&this.on("".concat(b,"move"),S.onmove),k.func(S.onend)&&this.on("".concat(b,"end"),S.onend),k.func(S.oninertiastart)&&this.on("".concat(b,"inertiastart"),S.oninertiastart),this}},{key:"updatePerActionListeners",value:function(b,S,M){var R,H=this,z=(R=this._actions.map[b])==null?void 0:R.filterEventType,G=function(q){return(z==null||z(q))&&Uy(q,H._actions)};(k.array(S)||k.object(S))&&this._onOff(Il.Off,b,S,void 0,G),(k.array(M)||k.object(M))&&this._onOff(Il.On,b,M,void 0,G)}},{key:"setPerAction",value:function(b,S){var M=this._defaults;for(var R in S){var H=R,z=this.options[b],G=S[H];H==="listeners"&&this.updatePerActionListeners(b,z.listeners,G),k.array(G)?z[H]=eu(G):k.plainObject(G)?(z[H]=_e(z[H]||{},Nh(G)),k.object(M.perAction[H])&&"enabled"in M.perAction[H]&&(z[H].enabled=G.enabled!==!1)):k.bool(G)&&k.object(M.perAction[H])?z[H].enabled=G:z[H]=G}}},{key:"getRect",value:function(b){return b=b||(k.element(this.target)?this.target:null),k.string(this.target)&&(b=b||this._context.querySelector(this.target)),he(b)}},{key:"rectChecker",value:function(b){var S=this;return k.func(b)?(this.getRect=function(M){var R=_e({},b.apply(S,M));return"width"in R||(R.width=R.right-R.left,R.height=R.bottom-R.top),R},this):b===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(b,S){if(et(S)||k.object(S)){for(var M in this.options[b]=S,this._actions.map)this.options[M][b]=S;return this}return this.options[b]}},{key:"origin",value:function(b){return this._backCompatOption("origin",b)}},{key:"deltaSource",value:function(b){return b==="page"||b==="client"?(this.options.deltaSource=b,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var b=this.target;return k.string(b)?Array.from(this._context.querySelectorAll(b)):k.func(b)&&b.getAllElements?b.getAllElements():k.element(b)?[b]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(b){return this._context===b.ownerDocument||C(this._context,b)}},{key:"testIgnoreAllow",value:function(b,S,M){return!this.testIgnore(b.ignoreFrom,S,M)&&this.testAllow(b.allowFrom,S,M)}},{key:"testAllow",value:function(b,S,M){return!b||!!k.element(M)&&(k.string(b)?fe(M,b,S):!!k.element(b)&&C(b,M))}},{key:"testIgnore",value:function(b,S,M){return!(!b||!k.element(M))&&(k.string(b)?fe(M,b,S):!!k.element(b)&&C(b,M))}},{key:"fire",value:function(b){return this.events.fire(b),this}},{key:"_onOff",value:function(b,S,M,R,H){k.object(S)&&!k.array(S)&&(R=M,M=null);var z=At(S,M,H);for(var G in z){G==="wheel"&&(G=_.wheelEvent);for(var q=0,ne=z[G];q<ne.length;q++){var J=ne[q];Uy(G,this._actions)?this.events[b===Il.On?"on":"off"](G,J):k.string(this.target)?this._scopeEvents[b===Il.On?"addDelegate":"removeDelegate"](this.target,this._context,G,J,R):this._scopeEvents[b===Il.On?"add":"remove"](this.target,G,J,R)}}return this}},{key:"on",value:function(b,S,M){return this._onOff(Il.On,b,S,M)}},{key:"off",value:function(b,S,M){return this._onOff(Il.Off,b,S,M)}},{key:"set",value:function(b){var S=this._defaults;for(var M in k.object(b)||(b={}),this.options=Nh(S.base),this._actions.methodDict){var R=M,H=this._actions.methodDict[R];this.options[R]={},this.setPerAction(R,_e(_e({},S.perAction),S.actions[R])),this[H](b[R])}for(var z in b)z!=="getRect"?k.func(this[z])&&this[z](b[z]):this.rectChecker(b.getRect);return this}},{key:"unset",value:function(){if(k.string(this.target))for(var b in this._scopeEvents.delegatedEvents)for(var S=this._scopeEvents.delegatedEvents[b],M=S.length-1;M>=0;M--){var R=S[M],H=R.selector,z=R.context,G=R.listeners;H===this.target&&z===this._context&&S.splice(M,1);for(var q=G.length-1;q>=0;q--)this._scopeEvents.removeDelegate(this.target,this._context,b,G[q][0],G[q][1])}else this._scopeEvents.remove(this.target,"all")}}]),w}(),x6=function(){function w(b){var S=this;r(this,w),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=b,b.addListeners({"interactable:unset":function(M){var R=M.interactable,H=R.target,z=k.string(H)?S.selectorMap[H]:H[S.scope.id],G=Tl(z,function(q){return q===R});z.splice(G,1)}})}return a(w,[{key:"new",value:function(b,S){S=_e(S||{},{actions:this.scope.actions});var M=new this.scope.Interactable(b,S,this.scope.document,this.scope.events);return this.scope.addDocument(M._doc),this.list.push(M),k.string(b)?(this.selectorMap[b]||(this.selectorMap[b]=[]),this.selectorMap[b].push(M)):(M.target[this.scope.id]||Object.defineProperty(b,this.scope.id,{value:[],configurable:!0}),b[this.scope.id].push(M)),this.scope.fire("interactable:new",{target:b,options:S,interactable:M,win:this.scope._win}),M}},{key:"getExisting",value:function(b,S){var M=S&&S.context||this.scope.document,R=k.string(b),H=R?this.selectorMap[b]:b[this.scope.id];if(H)return xl(H,function(z){return z._context===M&&(R||z.inContext(b))})}},{key:"forEachMatch",value:function(b,S){for(var M=0,R=this.list;M<R.length;M++){var H=R[M],z=void 0;if((k.string(H.target)?k.element(b)&&X(b,H.target):b===H.target)&&H.inContext(b)&&(z=S(H)),z!==void 0)return z}}}]),w}(),A6=function(){function w(){var b=this;r(this,w),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=_,this.defaults=Nh(FO),this.Eventable=UO,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(M){var R=function H(z,G){var q=M.interactables.getExisting(z,G);return q||((q=M.interactables.new(z,G)).events.global=H.globalEvents),q};return R.getPointerAverage=zy,R.getTouchBBox=Oh,R.getTouchDistance=Dh,R.getTouchAngle=Rh,R.getElementRect=he,R.getElementClientRect=ge,R.matchesSelector=X,R.closest=B,R.globalEvents={},R.version="1.10.27",R.scope=M,R.use=function(H,z){return this.scope.usePlugin(H,z),this},R.isSet=function(H,z){return!!this.scope.interactables.get(H,z&&z.context)},R.on=su(function(H,z,G){if(k.string(H)&&H.search(" ")!==-1&&(H=H.trim().split(/ +/)),k.array(H)){for(var q=0,ne=H;q<ne.length;q++){var J=ne[q];this.on(J,z,G)}return this}if(k.object(H)){for(var re in H)this.on(re,H[re],z);return this}return Uy(H,this.scope.actions)?this.globalEvents[H]?this.globalEvents[H].push(z):this.globalEvents[H]=[z]:this.scope.events.add(this.scope.document,H,z,{options:G}),this},"The interact.on() method is being deprecated"),R.off=su(function(H,z,G){if(k.string(H)&&H.search(" ")!==-1&&(H=H.trim().split(/ +/)),k.array(H)){for(var q=0,ne=H;q<ne.length;q++){var J=ne[q];this.off(J,z,G)}return this}if(k.object(H)){for(var re in H)this.off(re,H[re],z);return this}var de;return Uy(H,this.scope.actions)?H in this.globalEvents&&(de=this.globalEvents[H].indexOf(z))!==-1&&this.globalEvents[H].splice(de,1):this.scope.events.remove(this.scope.document,H,z,G),this},"The interact.off() method is being deprecated"),R.debug=function(){return this.scope},R.supportsTouch=function(){return _.supportsTouch},R.supportsPointerEvent=function(){return _.supportsPointerEvent},R.stop=function(){for(var H=0,z=this.scope.interactions.list;H<z.length;H++)z[H].stop();return this},R.pointerMoveTolerance=function(H){return k.number(H)?(this.scope.interactions.pointerMoveTolerance=H,this):this.scope.interactions.pointerMoveTolerance},R.addDocument=function(H,z){this.scope.addDocument(H,z)},R.removeDocument=function(H){this.scope.removeDocument(H)},R}(this),this.InteractEvent=gx,this.Interactable=void 0,this.interactables=new x6(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(M){return b.removeDocument(M.target)};var S=this;this.Interactable=function(M){c(H,M);var R=f(H);function H(){return r(this,H),R.apply(this,arguments)}return a(H,[{key:"_defaults",get:function(){return S.defaults}},{key:"set",value:function(z){return p(u(H.prototype),"set",this).call(this,z),S.fire("interactable:set",{options:z,interactable:this}),this}},{key:"unset",value:function(){p(u(H.prototype),"unset",this).call(this);var z=S.interactables.list.indexOf(this);z<0||(S.interactables.list.splice(z,1),S.fire("interactable:unset",{interactable:this}))}}]),H}(T6)}return a(w,[{key:"addListeners",value:function(b,S){this.listenerMaps.push({id:S,map:b})}},{key:"fire",value:function(b,S){for(var M=0,R=this.listenerMaps;M<R.length;M++){var H=R[M].map[b];if(H&&H(S,this,b)===!1)return!1}}},{key:"init",value:function(b){return this.isInitialized?this:function(S,M){return S.isInitialized=!0,k.window(M)&&O(M),N.init(M),_.init(M),yt.init(M),S.window=M,S.document=M.document,S.usePlugin(S6),S.usePlugin(y6),S}(this,b)}},{key:"pluginIsInstalled",value:function(b){var S=b.id;return S?!!this._plugins.map[S]:this._plugins.list.indexOf(b)!==-1}},{key:"usePlugin",value:function(b,S){if(!this.isInitialized)return this;if(this.pluginIsInstalled(b))return this;if(b.id&&(this._plugins.map[b.id]=b),this._plugins.list.push(b),b.install&&b.install(this,S),b.listeners&&b.before){for(var M=0,R=this.listenerMaps.length,H=b.before.reduce(function(G,q){return G[q]=!0,G[qO(q)]=!0,G},{});M<R;M++){var z=this.listenerMaps[M].id;if(z&&(H[z]||H[qO(z)]))break}this.listenerMaps.splice(M,0,{id:b.id,map:b.listeners})}else b.listeners&&this.listenerMaps.push({id:b.id,map:b.listeners});return this}},{key:"addDocument",value:function(b,S){if(this.getDocIndex(b)!==-1)return!1;var M=I(b);S=S?_e({},S):{},this.documents.push({doc:b,options:S}),this.events.documents.push(b),b!==this.document&&this.events.add(M,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:b,window:M,scope:this,options:S})}},{key:"removeDocument",value:function(b){var S=this.getDocIndex(b),M=I(b),R=this.documents[S].options;this.events.remove(M,"unload",this.onWindowUnload),this.documents.splice(S,1),this.events.documents.splice(S,1),this.fire("scope:remove-document",{doc:b,window:M,scope:this,options:R})}},{key:"getDocIndex",value:function(b){for(var S=0;S<this.documents.length;S++)if(this.documents[S].doc===b)return S;return-1}},{key:"getDocOptions",value:function(b){var S=this.getDocIndex(b);return S===-1?null:this.documents[S].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),w}();function qO(w){return w&&w.replace(/\/.*$/,"")}var KO=new A6,Ui=KO.interactStatic,C6=typeof globalThis<"u"?globalThis:window;KO.init(C6);var k6=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(w){var b=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(M){var R=M[0],H=M[1];return R in w||H in w}),S=function(M,R){for(var H=w.range,z=w.limits,G=z===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:z,q=w.offset,ne=q===void 0?{x:0,y:0}:q,J={range:H,grid:w,x:null,y:null},re=0;re<b.length;re++){var de=b[re],ve=de[0],be=de[1],Te=Math.round((M-ne.x)/w[ve]),Le=Math.round((R-ne.y)/w[be]);J[ve]=Math.max(G.left,Math.min(G.right,Te*w[ve]+ne.x)),J[be]=Math.max(G.top,Math.min(G.bottom,Le*w[be]+ne.y))}return J};return S.grid=w,S.coordFields=b,S}}),I6={id:"snappers",install:function(w){var b=w.interactStatic;b.snappers=_e(b.snappers||{},k6),b.createSnapGrid=b.snappers.grid}},P6=I6,M6={start:function(w){var b=w.state,S=w.rect,M=w.edges,R=w.pageCoords,H=b.options,z=H.ratio,G=H.enabled,q=b.options,ne=q.equalDelta,J=q.modifiers;z==="preserve"&&(z=S.width/S.height),b.startCoords=_e({},R),b.startRect=_e({},S),b.ratio=z,b.equalDelta=ne;var re=b.linkedEdges={top:M.top||M.left&&!M.bottom,left:M.left||M.top&&!M.right,bottom:M.bottom||M.right&&!M.top,right:M.right||M.bottom&&!M.left};if(b.xIsPrimaryAxis=!(!M.left&&!M.right),b.equalDelta){var de=(re.left?1:-1)*(re.top?1:-1);b.edgeSign={x:de,y:de}}else b.edgeSign={x:re.left?-1:1,y:re.top?-1:1};if(G!==!1&&_e(M,re),J!=null&&J.length){var ve=new fx(w.interaction);ve.copyFrom(w.interaction.modification),ve.prepareStates(J),b.subModification=ve,ve.startAll(i({},w))}},set:function(w){var b=w.state,S=w.rect,M=w.coords,R=b.linkedEdges,H=_e({},M),z=b.equalDelta?O6:D6;if(_e(w.edges,R),z(b,b.xIsPrimaryAxis,M,S),!b.subModification)return null;var G=_e({},S);vt(R,G,{x:M.x-H.x,y:M.y-H.y});var q=b.subModification.setAll(i(i({},w),{},{rect:G,edges:R,pageCoords:M,prevCoords:M,prevRect:G})),ne=q.delta;return q.changed&&(z(b,Math.abs(ne.x)>Math.abs(ne.y),q.coords,q.rect),_e(M,q.coords)),q.eventProps}
vendor: 4,421 bytes, line 136
136,defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function O6(w,b,S){var M=w.startCoords,R=w.edgeSign;b?S.y=M.y+(S.x-M.x)*R.y:S.x=M.x+(S.y-M.y)*R.x}function D6(w,b,S,M){var R=w.startRect,H=w.startCoords,z=w.ratio,G=w.edgeSign;if(b){var q=M.width/z;S.y=H.y+(q-R.height)*G.y}else{var ne=M.height*z;S.x=H.x+(ne-R.width)*G.x}}var R6=kl(M6,"aspectRatio"),XO=function(){};XO._defaults={};var qy=XO;function ou(w,b,S){return k.func(w)?$e(w,b.interactable,b.element,[S.x,S.y,b]):$e(w,b.interactable,b.element)}var Ky={start:function(w){var b=w.rect,S=w.startOffset,M=w.state,R=w.interaction,H=w.pageCoords,z=M.options,G=z.elementRect,q=_e({left:0,top:0,right:0,bottom:0},z.offset||{});if(b&&G){var ne=ou(z.restriction,R,H);if(ne){var J=ne.right-ne.left-b.width,re=ne.bottom-ne.top-b.height;J<0&&(q.left+=J,q.right+=J),re<0&&(q.top+=re,q.bottom+=re)}q.left+=S.left-b.width*G.left,q.top+=S.top-b.height*G.top,q.right+=S.right-b.width*(1-G.right),q.bottom+=S.bottom-b.height*(1-G.bottom)}M.offset=q},set:function(w){var b=w.coords,S=w.interaction,M=w.state,R=M.options,H=M.offset,z=ou(R.restriction,S,b);if(z){var G=function(q){return!q||"left"in q&&"top"in q||((q=_e({},q)).left=q.x||0,q.top=q.y||0,q.right=q.right||q.left+q.width,q.bottom=q.bottom||q.top+q.height),q}(z);b.x=Math.max(Math.min(G.right-H.right,b.x),G.left+H.left),b.y=Math.max(Math.min(G.bottom-H.bottom,b.y),G.top+H.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},L6=kl(Ky,"restrict"),JO={top:1/0,left:1/0,bottom:-1/0,right:-1/0},ZO={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function QO(w,b){for(var S=0,M=["top","left","bottom","right"];S<M.length;S++){var R=M[S];R in w||(w[R]=b[R])}return w}var Ym={noInner:JO,noOuter:ZO,start:function(w){var b,S=w.interaction,M=w.startOffset,R=w.state,H=R.options;H&&(b=Vt(ou(H.offset,S,S.coords.start.page))),b=b||{x:0,y:0},R.offset={top:b.y+M.top,left:b.x+M.left,bottom:b.y-M.bottom,right:b.x-M.right}},set:function(w){var b=w.coords,S=w.edges,M=w.interaction,R=w.state,H=R.offset,z=R.options;if(S){var G=_e({},b),q=ou(z.inner,M,G)||{},ne=ou(z.outer,M,G)||{};QO(q,JO),QO(ne,ZO),S.top?b.y=Math.min(Math.max(ne.top+H.top,G.y),q.top+H.top):S.bottom&&(b.y=Math.max(Math.min(ne.bottom+H.bottom,G.y),q.bottom+H.bottom)),S.left?b.x=Math.min(Math.max(ne.left+H.left,G.x),q.left+H.left):S.right&&(b.x=Math.max(Math.min(ne.right+H.right,G.x),q.right+H.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},F6=kl(Ym,"restrictEdges"),N6=_e({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(w){}},Ky.defaults),B6=kl({start:Ky.start,set:Ky.set,defaults:N6},"restrictRect"),V6={width:-1/0,height:-1/0},H6={width:1/0,height:1/0},z6=kl({start:function(w){return Ym.start(w)},set:function(w){var b=w.interaction,S=w.state,M=w.rect,R=w.edges,H=S.options;if(R){var z=An(ou(H.min,b,w.coords))||V6,G=An(ou(H.max,b,w.coords))||H6;S.options={endOnly:H.endOnly,inner:_e({},Ym.noInner),outer:_e({},Ym.noOuter)},R.top?(S.options.inner.top=M.bottom-z.height,S.options.outer.top=M.bottom-G.height):R.bottom&&(S.options.inner.bottom=M.top+z.height,S.options.outer.bottom=M.top+G.height),R.left?(S.options.inner.left=M.right-z.width,S.options.outer.left=M.right-G.width):R.right&&(S.options.inner.right=M.left+z.width,S.options.outer.right=M.left+G.width),Ym.set(w),S.options=H}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),vx={start:function(w){var b,S=w.interaction,M=w.interactable,R=w.element,H=w.rect,z=w.state,G=w.startOffset,q=z.options,ne=q.offsetWithOrigin?function(de){var ve=de.interaction.element,be=Vt($e(de.state.options.origin,null,null,[ve])),Te=be||Bt(de.interactable,ve,de.interaction.prepared.name);return Te}(w):{x:0,y:0};if(q.offset==="startCoords")b={x:S.coords.start.page.x,y:S.coords.start.page.y};else{var J=$e(q.offset,M,R,[S]);(b=Vt(J)||{x:0,y:0}).x+=ne.x,b.y+=ne.y}var re=q.relativePoints;z.offsets=H&&re&&re.length?re.map(function(de,ve){return{index:ve,relativePoint:de,x:G.left-H.width*de.x+b.x,y:G.top-H.height*de.y+b.y}}):[{index:0,relativePoint:null,x:b.x,y:b.y}]},set:function(w){var b=w.interaction,S=w.coords,M=w.state,R=M.options,H=M.offsets,z=Bt(b.interactable,b.element,b.prepared.name),G=_e({},S),q=[];R.offsetWithOrigin||(G.x-=z.x,G.y-=z.y);for(var ne=0,J=H;ne<J.length;ne++)for(var re=J[ne],de=G.x-re.x,ve=G.y-re.y,be=0,Te=R.targets.length;be<Te;be++){var Le=R.targets[be],De=void 0;
vendor: 9,962 bytes, line 136
136(De=k.func(Le)?Le(de,ve,b._proxy,re,be):Le)&&q.push({x:(k.number(De.x)?De.x:de)+re.x,y:(k.number(De.y)?De.y:ve)+re.y,range:k.number(De.range)?De.range:R.range,source:Le,index:be,offset:re})}for(var je={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},ot=0;ot<q.length;ot++){var Et=q[ot],Qe=Et.range,ct=Et.x-G.x,ji=Et.y-G.y,un=gi(ct,ji),Ts=un<=Qe;Qe===1/0&&je.inRange&&je.range!==1/0&&(Ts=!1),je.target&&!(Ts?je.inRange&&Qe!==1/0?un/Qe<je.distance/je.range:Qe===1/0&&je.range!==1/0||un<je.distance:!je.inRange&&un<je.distance)||(je.target=Et,je.distance=un,je.range=Qe,je.inRange=Ts,je.delta.x=ct,je.delta.y=ji)}return je.inRange&&(S.x=je.target.x,S.y=je.target.y),M.closest=je,je},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},$6=kl(vx,"snap"),Xy={start:function(w){var b=w.state,S=w.edges,M=b.options;if(!S)return null;w.state={options:{targets:null,relativePoints:[{x:S.left?0:1,y:S.top?0:1}],offset:M.offset||"self",origin:{x:0,y:0},range:M.range}},b.targetFields=b.targetFields||[["width","height"],["x","y"]],vx.start(w),b.offsets=w.state.offsets,w.state=b},set:function(w){var b=w.interaction,S=w.state,M=w.coords,R=S.options,H=S.offsets,z={x:M.x-H[0].x,y:M.y-H[0].y};S.options=_e({},R),S.options.targets=[];for(var G=0,q=R.targets||[];G<q.length;G++){var ne=q[G],J=void 0;if(J=k.func(ne)?ne(z.x,z.y,b):ne){for(var re=0,de=S.targetFields;re<de.length;re++){var ve=de[re],be=ve[0],Te=ve[1];if(be in J||Te in J){J.x=J[be],J.y=J[Te];break}}S.options.targets.push(J)}}var Le=vx.set(w);return S.options=R,Le},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},W6=kl(Xy,"snapSize"),yx={aspectRatio:R6,restrictEdges:F6,restrict:L6,restrictRect:B6,restrictSize:z6,snapEdges:kl({start:function(w){var b=w.edges;return b?(w.state.targetFields=w.state.targetFields||[[b.left?"left":"right",b.top?"top":"bottom"]],Xy.start(w)):null},set:Xy.set,defaults:_e(Nh(Xy.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:$6,snapSize:W6,spring:qy,avoid:qy,transform:qy,rubberband:qy},U6={id:"modifiers",install:function(w){var b=w.interactStatic;for(var S in w.usePlugin(LO),w.usePlugin(P6),b.modifiers=yx,yx){var M=yx[S],R=M._defaults,H=M._methods;R._methods=H,w.defaults.perAction[S]=R}}},j6=U6,eD=function(w){c(S,w);var b=f(S);function S(M,R,H,z,G,q){var ne;if(r(this,S),Wi(h(ne=b.call(this,G)),H),H!==R&&Wi(h(ne),R),ne.timeStamp=q,ne.originalEvent=H,ne.type=M,ne.pointerId=Zc(R),ne.pointerType=Qc(R),ne.target=z,ne.currentTarget=null,M==="tap"){var J=G.getPointerIndex(R);ne.dt=ne.timeStamp-G.pointers[J].downTime;var re=ne.timeStamp-G.tapTime;ne.double=!!G.prevTap&&G.prevTap.type!=="doubletap"&&G.prevTap.target===ne.target&&re<500}else M==="doubletap"&&(ne.dt=R.timeStamp-G.tapTime,ne.double=!0);return ne}return a(S,[{key:"_subtractOrigin",value:function(M){var R=M.x,H=M.y;return this.pageX-=R,this.pageY-=H,this.clientX-=R,this.clientY-=H,this}},{key:"_addOrigin",value:function(M){var R=M.x,H=M.y;return this.pageX+=R,this.pageY+=H,this.clientX+=R,this.clientY+=H,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),S}(Sl),qm={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(w){w.pointerEvents=qm,w.defaults.actions.pointerEvents=qm.defaults,_e(w.actions.phaselessTypes,qm.types)},listeners:{"interactions:new":function(w){var b=w.interaction;b.prevTap=null,b.tapTime=0},"interactions:update-pointer":function(w){var b=w.down,S=w.pointerInfo;!b&&S.hold||(S.hold={duration:1/0,timeout:null})},"interactions:move":function(w,b){var S=w.interaction,M=w.pointer,R=w.event,H=w.eventTarget;w.duplicate||S.pointerIsDown&&!S.pointerWasMoved||(S.pointerIsDown&&_x(w),Pl({interaction:S,pointer:M,event:R,eventTarget:H,type:"move"},b))},"interactions:down":function(w,b){(function(S,M){for(var R=S.interaction,H=S.pointer,z=S.event,G=S.eventTarget,q=S.pointerIndex,ne=R.pointers[q].hold,J=ye(G),re={interaction:R,pointer:H,event:z,eventTarget:G,type:"hold",targets:[],path:J,node:null},de=0;de<J.length;de++){var ve=J[de];re.node=ve,M.fire("pointerEvents:collect-targets",re)}if(re.targets.length){for(var be=1/0,Te=0,Le=re.targets;Te<Le.length;Te++){var De=Le[Te].eventable.options.holdDuration;De<be&&(be=De)}ne.duration=be,ne.timeout=setTimeout(function(){Pl({interaction:R,eventTarget:G,pointer:H,event:z,type:"hold"},M)},be)}})(w,b),Pl(w,b)},"interactions:up":function(w,b){_x(w),Pl(w,b),function(S,M){var R=S.interaction,H=S.pointer,z=S.event,G=S.eventTarget;R.pointerWasMoved||Pl({interaction:R,eventTarget:G,pointer:H,event:z,type:"tap"},M)}(w,b)},"interactions:cancel":function(w,b){_x(w),Pl(w,b)}},PointerEvent:eD,fire:Pl,collectEventTargets:tD,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function Pl(w,b){var S=w.interaction,M=w.pointer,R=w.event,H=w.eventTarget,z=w.type,G=w.targets,q=G===void 0?tD(w,b):G,ne=new eD(z,M,R,H,S,b.now());b.fire("pointerEvents:new",{pointerEvent:ne});for(var J={interaction:S,pointer:M,event:R,eventTarget:H,targets:q,type:z,pointerEvent:ne},re=0;re<q.length;re++){var de=q[re];for(var ve in de.props||{})ne[ve]=de.props[ve];var be=Bt(de.eventable,de.node);if(ne._subtractOrigin(be),ne.eventable=de.eventable,ne.currentTarget=de.node,de.eventable.fire(ne),ne._addOrigin(be),ne.immediatePropagationStopped||ne.propagationStopped&&re+1<q.length&&q[re+1].node!==ne.currentTarget)break}if(b.fire("pointerEvents:fired",J),z==="tap"){var Te=ne.double?Pl({interaction:S,pointer:M,event:R,eventTarget:H,type:"doubletap"},b):ne;S.prevTap=Te,S.tapTime=Te.timeStamp}return ne}function tD(w,b){var S=w.interaction,M=w.pointer,R=w.event,H=w.eventTarget,z=w.type,G=S.getPointerIndex(M),q=S.pointers[G];if(z==="tap"&&(S.pointerWasMoved||!q||q.downTarget!==H))return[];for(var ne=ye(H),J={interaction:S,pointer:M,event:R,eventTarget:H,type:z,path:ne,targets:[],node:null},re=0;re<ne.length;re++){var de=ne[re];J.node=de,b.fire("pointerEvents:collect-targets",J)}return z==="hold"&&(J.targets=J.targets.filter(function(ve){var be,Te;return ve.eventable.options.holdDuration===((be=S.pointers[G])==null||(Te=be.hold)==null?void 0:Te.duration)})),J.targets}function _x(w){var b=w.interaction,S=w.pointerIndex,M=b.pointers[S].hold;M&&M.timeout&&(clearTimeout(M.timeout),M.timeout=null)}var G6=Object.freeze({__proto__:null,default:qm});function Y6(w){var b=w.interaction;b.holdIntervalHandle&&(clearInterval(b.holdIntervalHandle),b.holdIntervalHandle=null)}var q6={id:"pointer-events/holdRepeat",install:function(w){w.usePlugin(qm);var b=w.pointerEvents;b.defaults.holdRepeatInterval=0,b.types.holdrepeat=w.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(w,b){return w["pointerEvents:".concat(b)]=Y6,w},{"pointerEvents:new":function(w){var b=w.pointerEvent;b.type==="hold"&&(b.count=(b.count||0)+1)},"pointerEvents:fired":function(w,b){var S=w.interaction,M=w.pointerEvent,R=w.eventTarget,H=w.targets;if(M.type==="hold"&&H.length){var z=H[0].eventable.options.holdRepeatInterval;z<=0||(S.holdIntervalHandle=setTimeout(function(){b.pointerEvents.fire({interaction:S,eventTarget:R,type:"hold",pointer:M,event:M},b)},z))}}})},K6=q6,X6={id:"pointer-events/interactableTargets",install:function(w){var b=w.Interactable;b.prototype.pointerEvents=function(M){return _e(this.events.options,M),this};var S=b.prototype._backCompatOption;b.prototype._backCompatOption=function(M,R){var H=S.call(this,M,R);return H===this&&(this.events.options[M]=R),H}},listeners:{"pointerEvents:collect-targets":function(w,b){var S=w.targets,M=w.node,R=w.type,H=w.eventTarget;b.interactables.forEachMatch(M,function(z){var G=z.events,q=G.options;G.types[R]&&G.types[R].length&&z.testIgnoreAllow(q,M,H)&&S.push({node:M,eventable:G,props:{interactable:z}})})},"interactable:new":function(w){var b=w.interactable;b.events.getRect=function(S){return b.getRect(S)}},"interactable:set":function(w,b){var S=w.interactable,M=w.options;_e(S.events.options,b.pointerEvents.defaults),_e(S.events.options,M.pointerEvents||{})}}},J6=X6,Z6={id:"pointer-events",install:function(w){w.usePlugin(G6),w.usePlugin(K6),w.usePlugin(J6)}},Q6=Z6,e7={id:"reflow",install:function(w){var b=w.Interactable;w.actions.phases.reflow=!0,b.prototype.reflow=function(S){return function(M,R,H){for(var z=M.getAllElements(),G=H.window.Promise,q=G?[]:null,ne=function(){var re=z[J],de=M.getRect(re);if(!de)return 1;var ve,be=xl(H.interactions.list,function(De){return De.interacting()&&De.interactable===M&&De.element===re&&De.prepared.name===R.name});if(be)be.move(),q&&(ve=be._reflowPromise||new G(function(De){be._reflowResolve=De}));else{var Te=An(de),Le=function(De){return{coords:De,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:Te.x,y:Te.y},client:{x:Te.x,y:Te.y},timeStamp:H.now()});ve=function(De,je,ot,Et,Qe){var ct=De.interactions.new({pointerType:"reflow"}),ji={interaction:ct,event:Qe,pointer:Qe,eventTarget:ot,phase:"reflow"};ct.interactable=je,ct.element=ot,ct.prevEvent=Qe,ct.updatePointer(Qe,Qe,ot,!0),mi(ct.coords.delta),Wm(ct.prepared,Et),ct._doPhase(ji);var un=De.window,Ts=un.Promise,Ir=Ts?new Ts(function(oa){ct._reflowResolve=oa}):void 0;return ct._reflowPromise=Ir,ct.start(Et,je,ot),ct._interacting?(ct.move(ji),ct.end(Qe)):(ct.stop(),ct._reflowResolve()),ct.removePointer(Qe,Qe),Ir}(H,M,re,R,Le)}q&&q.push(ve)},J=0;J<z.length&&!ne();J++);
136return q&&G.all(q).then(function(){return M})}(this,S,w)}},listeners:{"interactions:stop":function(w,b){var S=w.interaction;S.pointerType==="reflow"&&(S._reflowResolve&&S._reflowResolve(),function(M,R){M.splice(M.indexOf(R),1)}(b.interactions.list,S))}}},t7=e7;if(Ui.use(RO),Ui.use(HO),Ui.use(Q6),Ui.use(w6),Ui.use(j6),Ui.use(o6),Ui.use(Ze),Ui.use($m),Ui.use(t7),Ui.default=Ui,s(n)==="object"&&n)try{n.exports=Ui}catch{}return Ui.default=Ui,Ui})})(xE,xE.exports);var Hoe=xE.exports;const zoe=zI(Hoe);/*! 137 * Virtual Select v1.0.46 138 * https://sa-si-dev.github.io/virtual-select 139 * Licensed under MIT (https://github.com/sa-si-dev/virtual-select/blob/master/LICENSE) 140 */(function(){function n(j){return function(L){if(Array.isArray(L))return t(L)}(j)||function(L){if(typeof Symbol<"u"&&L[Symbol.iterator]!=null||L["@@iterator"]!=null)return Array.from(L)}(j)||function(L,N){if(L){if(typeof L=="string")return t(L,N);var m=Object.prototype.toString.call(L).slice(8,-1);return m==="Object"&&L.constructor&&(m=L.constructor.name),m==="Map"||m==="Set"?Array.from(L):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?t(L,N):void 0}}(j)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 141In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function t(j,L){(L==null||L>j.length)&&(L=j.length);for(var N=0,m=new Array(L);N<L;N++)m[N]=j[N];return m}function e(j){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},e(j)}function i(j,L){for(var N=0;N<L.length;N++){var m=L[N];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(j,(_=m.key,C=void 0,C=function(B,$){if(e(B)!=="object"||B===null)return B;var X=B[Symbol.toPrimitive];if(X!==void 0){var Z=X.call(B,$||"default");if(e(Z)!=="object")return Z;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(B)}(_,"string"),e(C)==="symbol"?C:String(C)),m)}var _,C}var s=function(){function j(){(function(_,C){if(!(_ instanceof C))throw new TypeError("Cannot call a class as a function")})(this,j)}var L,N,m;return L=j,m=[{key:"getString",value:function(_){return _||_===0?_.toString():""}},{key:"convertToBoolean",value:function(_){return _===!0||_==="true"||_!==!1&&_!=="false"&&arguments.length>1&&arguments[1]!==void 0&&arguments[1]}},{key:"isEmpty",value:function(_){var C=!1;return _?Array.isArray(_)?_.length===0&&(C=!0):e(_)==="object"&&Object.keys(_).length===0&&(C=!0):C=!0,C}},{key:"isNotEmpty",value:function(_){return!this.isEmpty(_)}},{key:"removeItemFromArray",value:function(_,C){var B=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Array.isArray(_)||!_.length)return _;var $=B?n(_):_,X=$.indexOf(C);return X!==-1&&$.splice(X,1),$}},{key:"removeArrayEmpty",value:function(_){return Array.isArray(_)&&_.length?_.filter(function(C){return!!C}):[]}},{key:"getRandomInt",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,B=Math.ceil(C),$=Math.floor(_);return Math.floor(Math.random()*($-B-1))+B}},{key:"regexEscape",value:function(_){return _.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"normalizeString",value:function(_){return _.normalize("NFD").replace(/[^\w]/g,"")}},{key:"willTextOverflow",value:function(_,C){var B=document.createElement("div");B.style.position="absolute",B.style.visibility="hidden",B.style.whiteSpace="nowrap",B.style.fontSize=window.getComputedStyle(_).fontSize,B.style.fontFamily=window.getComputedStyle(_).fontFamily,B.textContent=C,document.body.appendChild(B);var $=B.clientWidth;return document.body.removeChild(B),$>_.clientWidth}},{key:"replaceDoubleQuotesWithHTML",value:function(_){return _.replace(/"/g,""")}},{key:"containsHTML",value:function(_){return/<[a-z][\s\S]*>/i.test(_)}}],(N=null)&&i(L.prototype,N),m&&i(L,m),Object.defineProperty(L,"prototype",{writable:!1}),j}();function r(j){return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},r(j)}function o(j,L){return function(N){if(Array.isArray(N))return N}(j)||function(N,m){var _=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(_!=null){var C,B,$,X,Z=[],ie=!0,fe=!1;try{if($=(_=_.call(N)).next,m===0){if(Object(_)!==_)return;ie=!1}else for(;!(ie=(C=$.call(_)).done)&&(Z.push(C.value),Z.length!==m);ie=!0);}catch(ae){fe=!0,B=ae}
141finally{try{if(!ie&&_.return!=null&&(X=_.return(),Object(X)!==X))return}finally{if(fe)throw B}}return Z}}(j,L)||l(j,L)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 142In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function a(j){return function(L){if(Array.isArray(L))return c(L)}(j)||function(L){if(typeof Symbol<"u"&&L[Symbol.iterator]!=null||L["@@iterator"]!=null)return Array.from(L)}(j)||l(j)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 143In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function l(j,L){if(j){if(typeof j=="string")return c(j,L);var N=Object.prototype.toString.call(j).slice(8,-1);return N==="Object"&&j.constructor&&(N=j.constructor.name),N==="Map"||N==="Set"?Array.from(j):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?c(j,L):void 0}}function c(j,L){(L==null||L>j.length)&&(L=j.length);for(var N=0,m=new Array(L);N<L;N++)m[N]=j[N];return m}function u(j,L){for(var N=0;N<L.length;N++){var m=L[N];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(j,(_=m.key,C=void 0,C=function(B,$){if(r(B)!=="object"||B===null)return B;var X=B[Symbol.toPrimitive];if(X!==void 0){var Z=X.call(B,$||"default");if(r(Z)!=="object")return Z;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(B)}(_,"string"),r(C)==="symbol"?C:String(C)),m)}var _,C}var d=function(){function j(){(function(_,C){if(!(_ instanceof C))throw new TypeError("Cannot call a class as a function")})(this,j)}var L,N,m;return L=j,m=[{key:"addClass",value:function(_,C){if(_){var B=C.split(" ");j.getElements(_).forEach(function($){var X;(X=$.classList).add.apply(X,a(B))})}}},{key:"removeClass",value:function(_,C){if(_){var B=C.split(" ");j.getElements(_).forEach(function($){var X;(X=$.classList).remove.apply(X,a(B))})}}},{key:"toggleClass",value:function(_,C,B){var $;_&&(B!==void 0&&($=!!B),j.getElements(_).forEach(function(X){X.classList.toggle(C,$)}))}},{key:"hasClass",value:function(_,C){return!!_&&_.classList.contains(C)}},{key:"hasEllipsis",value:function(_){return!!_&&_.scrollWidth>_.offsetWidth}},{key:"getData",value:function(_,C,B){if(_){var $=_?_.dataset[C]:"";return B==="number"?$=parseFloat($)||0:$==="true"?$=!0:$==="false"&&($=!1),$}}},{key:"setData",value:function(_,C,B){_&&(_.dataset[C]=B)}},{key:"setAttr",value:function(_,C,B){_&&_.setAttribute(C,B)}},{key:"setAttrFromEle",value:function(_,C,B,$){var X={};B.forEach(function(Z){X[Z]=_.getAttribute(Z)}),B.forEach(function(Z){var ie=X[Z];(ie||$.indexOf(Z)!==-1&&ie==="")&&C.setAttribute(Z,ie)})}},{key:"setStyle",value:function(_,C,B){_&&(_.style[C]=B)}},{key:"setStyles",value:function(_,C){_&&C&&Object.keys(C).forEach(function(B){_.style[B]=C[B]})}},{key:"setAria",value:function(_,C,B){var $=C;$!=="role"&&($="aria-".concat($)),_.setAttribute($,B)}},{key:"getElements",value:function(_){return _?_.forEach===void 0?[_]:_:[]}},{key:"getElementsBySelector",value:function(){var _,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,$=B!==void 0?B:document;return C!==""&&(_=$.querySelectorAll(C)),_!==void 0?Array.from(_):[]}},{key:"addEvent",value:function(_,C,B){_&&s.removeArrayEmpty(C.split(" ")).forEach(function($){j.getElements(_).forEach(function(X){X.addEventListener($,B)})})}},{key:"dispatchEvent",value:function(_,C){var B=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(_){var $=j.getElements(_);setTimeout(function(){$.forEach(function(X){X.dispatchEvent(new CustomEvent(C,{bubbles:B}))})},0)}}},{key:"getAttributesText",value:function(_){var C="";return _&&Object.entries(_).forEach(function(B){var $=o(B,2),X=$[0],Z=$[1];Z!==void 0&&(C+=" ".concat(X,'="').concat(Z,'" '))}),C}},{key:"convertPropToDataAttr",value:function(_){return _?"data-".concat(_).replace(/([A-Z])/g,"-$1").toLowerCase():""}},{key:"changeTabIndex",value:function(_,C){_?j.getElements(_).forEach(function(B){B.tabIndex=C}):console.log(_,"Invalid element provided.")}},{key:"removeEvent",value:function(_,C,B){_&&j.getElements(_).forEach(function($){$.removeEventListener(C,B)})}}],(N=null)&&u(L.prototype,N),m&&u(L,m),Object.defineProperty(L,"prototype",{writable:!1}),j}();function h(j,L){var N=Object.keys(j);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(j);L&&(m=m.filter(function(_){return Object.getOwnPropertyDescriptor(j,_).enumerable})),N.push.apply(N,m)}return N}function f(j){for(var L=1;L<arguments.length;L++){var N=arguments[L]!=null?arguments[L]:{};
143L%2?h(Object(N),!0).forEach(function(m){p(j,m,N[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(N)):h(Object(N)).forEach(function(m){Object.defineProperty(j,m,Object.getOwnPropertyDescriptor(N,m))})}return j}function p(j,L,N){return(L=T(L))in j?Object.defineProperty(j,L,{value:N,enumerable:!0,configurable:!0,writable:!0}):j[L]=N,j}function v(j){return v=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},v(j)}function E(j,L){return function(N){if(Array.isArray(N))return N}(j)||function(N,m){var _=N==null?null:typeof Symbol<"u"&&N[Symbol.iterator]||N["@@iterator"];if(_!=null){var C,B,$,X,Z=[],ie=!0,fe=!1;try{if($=(_=_.call(N)).next,m===0){if(Object(_)!==_)return;ie=!1}else for(;!(ie=(C=$.call(_)).done)&&(Z.push(C.value),Z.length!==m);ie=!0);}catch(ae){fe=!0,B=ae}finally{try{if(!ie&&_.return!=null&&(X=_.return(),Object(X)!==X))return}finally{if(fe)throw B}}return Z}}(j,L)||A(j,L)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 144In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(j){return function(L){if(Array.isArray(L))return O(L)}(j)||function(L){if(typeof Symbol<"u"&&L[Symbol.iterator]!=null||L["@@iterator"]!=null)return Array.from(L)}(j)||A(j)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 145In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function A(j,L){if(j){if(typeof j=="string")return O(j,L);var N=Object.prototype.toString.call(j).slice(8,-1);return N==="Object"&&j.constructor&&(N=j.constructor.name),N==="Map"||N==="Set"?Array.from(j):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?O(j,L):void 0}}function O(j,L){(L==null||L>j.length)&&(L=j.length);for(var N=0,m=new Array(L);N<L;N++)m[N]=j[N];return m}function I(j,L){for(var N=0;N<L.length;N++){var m=L[N];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(j,T(m.key),m)}}function T(j){var L=function(N,m){if(v(N)!=="object"||N===null)return N;var _=N[Symbol.toPrimitive];if(_!==void 0){var C=_.call(N,m||"default");if(v(C)!=="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(N)}(j,"string");return v(L)==="symbol"?L:String(L)}var P,k={13:"onEnterPress",38:"onUpArrowPress",40:"onDownArrowPress",46:"onBackspaceOrDeletePress",8:"onBackspaceOrDeletePress"},D=["autofocus","disabled","multiple","required"],U=["autofocus","class","disabled","id","multiple","name","placeholder","required"],Y=["additionalClasses","additionalDropboxClasses","additionalDropboxContainerClasses","additionalToggleButtonClasses","aliasKey","allOptionsSelectedText","allowNewOption","alwaysShowSelectedOptionsCount","alwaysShowSelectedOptionsLabel","ariaLabelledby","ariaLabelText","ariaLabelClearButtonText","autoSelectFirstOption","clearButtonText","descriptionKey","disableAllOptionsSelectedText","disableOptionGroupCheckbox","disableSelectAll","disableValidation","dropboxWidth","dropboxWrapper","emptyValue","enableSecureText","focusSelectedOptionOnOpen","hasOptionDescription","hideClearButton","hideValueTooltipOnSelectAll","keepAlwaysOpen","labelKey","markSearchResults","maxValues","maxWidth","minValues","moreText","noOfDisplayValues","noOptionsText","noSearchResultsText","optionHeight","optionSelectedText","optionsCount","optionsSelectedText","popupDropboxBreakpoint","popupPosition","position","search","searchByStartsWith","searchDelay","searchFormLabel","searchGroup","searchNormalize","searchPlaceholderText","selectAllOnlyVisible","selectAllText","setValueAsArray","showDropboxAsPopup","showOptionsOnlyOnSearch","showSelectedOptionsFirst","showValueAsTags","silentInitialValueSet","textDirection","tooltipAlignment","tooltipFontSize","tooltipMaxWidth","updatePositionThrottle","useGroupValue","valueKey","zIndex"],K=function(){function j(_){(function(C,B){if(!(C instanceof B))throw new TypeError("Cannot call a class as a function")})(this,j);try{this.createSecureTextElements(),this.setProps(_),this.setDisabledOptions(_.disabledOptions),this.setOptions(_.options),this.render()}catch(C){console.warn("Couldn't initiate Virtual Select"),console.error(C)}}var L,N,m;return L=j,N=[{key:"render",value:function(){if(this.$ele){var _=this.uniqueId,C="vscomp-wrapper",B="vscomp-toggle-button",$=this.showValueAsTags?"":this.getTooltipAttrText(this.placeholder,!0,!0),X=this.getTooltipAttrText(this.clearButtonText),Z=this.ariaLabelledby?'aria-labelledby="'.concat(this.ariaLabelledby,'"'):"",ie=this.ariaLabelText?'aria-label="'.concat(this.ariaLabelText,'"'):"",fe=this.ariaLabelClearButtonText?'aria-label="'.concat(this.ariaLabelClearButtonText,'"'):"",ae=!1;this.additionalClasses&&(C+=" ".concat(this.additionalClasses)),this.additionalToggleButtonClasse
vendor: 6,460 bytes, lines 145-185
145s&&(B+=" ".concat(this.additionalToggleButtonClasses)),this.multiple&&(C+=" multiple",this.disableSelectAll||(C+=" has-select-all")),this.hideClearButton||(C+=" has-clear-button"),this.keepAlwaysOpen?(C+=" keep-always-open",ae=!0):C+=" closed",this.showAsPopup&&(C+=" show-as-popup"),this.hasSearch&&(C+=" has-search-input"),this.showValueAsTags&&(C+=" show-value-as-tags"),this.textDirection&&(C+=" text-direction-".concat(this.textDirection)),this.popupPosition&&(C+=" popup-position-".concat(this.popupPosition.toLowerCase()));var ge='<div id="vscomp-ele-wrapper-'.concat(_,'" class="vscomp-ele-wrapper ').concat(C,`" tabindex="0" 146 role="combobox" aria-haspopup="listbox" aria-controls="vscomp-dropbox-container-`).concat(_,`" 147 aria-expanded="`).concat(ae,'" ').concat(Z," ").concat(ie,`> 148 <input type="hidden" name="`).concat(this.name,`" class="vscomp-hidden-input"> 149 <div class="`).concat(B,`"> 150 <div class="vscomp-value" `).concat($,`> 151 `).concat(this.placeholder,` 152 </div> 153 <div class="vscomp-arrow"></div> 154 <div class="vscomp-clear-button toggle-button-child" `).concat(X,` 155 tabindex="0" `).concat(fe,`> 156 <i class="vscomp-clear-icon"></i> 157 </div> 158 </div> 159 160 `).concat(this.renderDropbox({wrapperClasses:C}),` 161 </div>`);this.$ele.innerHTML=ge,this.$body=document.querySelector("body"),this.$wrapper=this.$ele.querySelector(".vscomp-wrapper"),this.hasDropboxWrapper?(this.$allWrappers=[this.$wrapper,this.$dropboxWrapper],this.$dropboxContainer=this.$dropboxWrapper.querySelector(".vscomp-dropbox-container"),d.addClass(this.$dropboxContainer,"pop-comp-wrapper")):(this.$allWrappers=[this.$wrapper],this.$dropboxContainer=this.$wrapper.querySelector(".vscomp-dropbox-container")),this.$toggleButton=this.$ele.querySelector(".vscomp-toggle-button"),this.$clearButton=this.$ele.querySelector(".vscomp-clear-button"),this.$valueText=this.$ele.querySelector(".vscomp-value"),this.$hiddenInput=this.$ele.querySelector(".vscomp-hidden-input"),this.$dropbox=this.$dropboxContainer.querySelector(".vscomp-dropbox"),this.$dropboxCloseButton=this.$dropboxContainer.querySelector(".vscomp-dropbox-close-button"),this.$dropboxContainerBottom=this.$dropboxContainer.querySelector(".vscomp-dropbox-container-bottom"),this.$dropboxContainerTop=this.$dropboxContainer.querySelector(".vscomp-dropbox-container-top"),this.$search=this.$dropboxContainer.querySelector(".vscomp-search-wrapper"),this.$optionsContainer=this.$dropboxContainer.querySelector(".vscomp-options-container"),this.$optionsList=this.$dropboxContainer.querySelector(".vscomp-options-list"),this.$options=this.$dropboxContainer.querySelector(".vscomp-options"),this.$noOptions=this.$dropboxContainer.querySelector(".vscomp-no-options"),this.$noSearchResults=this.$dropboxContainer.querySelector(".vscomp-no-search-results"),this.afterRenderWrapper()}}},{key:"renderDropbox",value:function(_){var C=_.wrapperClasses,B=this.dropboxWrapper!=="self"?document.querySelector(this.dropboxWrapper):null,$="vscomp-dropbox";this.additionalDropboxClasses&&($+=" ".concat(this.additionalDropboxClasses));var X="vscomp-dropbox-container";this.additionalDropboxContainerClasses&&(X+=" ".concat(this.additionalDropboxContainerClasses));var Z='<div id="vscomp-dropbox-container-'.concat(this.uniqueId,'" role="listbox" class="').concat(X,`"> 162 <div class="vscomp-dropbox-container-top" aria-hidden="true" tabindex="0"> </div> 163 <div class="`).concat($,`"> 164 <div class="vscomp-search-wrapper"></div> 165 166 <div class="vscomp-options-container"> 167 <div class="vscomp-options-loader"></div> 168 169 <div class="vscomp-options-list"> 170 <div class="vscomp-options"></div> 171 </div> 172 </div> 173 174 <div class="vscomp-options-bottom-freezer"></div> 175 <div class="vscomp-no-options">`).concat(this.noOptionsText,`</div> 176 <div class="vscomp-no-search-results">`).concat(this.noSearchResultsText,`</div> 177 178 <span class="vscomp-dropbox-close-button"><i class="vscomp-clear-icon"></i></span> 179 </div> 180 <div class="vscomp-dropbox-container-bottom" aria-hidden="true" tabindex="0"> </div> 181 </div>`);if(B){var ie=document.createElement("div");return this.$dropboxWrapper=ie,this.hasDropboxWrapper=!0,ie.innerHTML=Z,B.appendChild(ie),d.addClass(ie,"vscomp-dropbox-wrapper ".concat(C)),""}return this.hasDropboxWrapper=!1,Z}},{key:"renderOptions",value:function(){var _,C=this,B="",$=this.getVisibleOptions(),X="",Z="",ie=!(!this.markSearchResults||!this.searchValue),fe=this.labelRenderer,ae=this.disableOptionGroupCheckbox,ge=this.uniqueId,he=this.searchGroup,ye=typeof fe=="function",et=s.convertToBoolean,_e="";if(ie&&(_=new RegExp("(".concat(s.regexEscape(this.searchValue),")(?!([^<]+)?>)"),"gi")),this.multiple&&(X='<span class="checkbox-icon"></span>'),this.allowNewOption){var gt=this.getTooltipAttrText("New Option");Z='<span class="vscomp-new-option-icon" '.concat(gt,"></span>")}$.forEach(function($e){var Vt,An=$e.index,vt="vscomp-option",Bt=C.getTooltipAttrText("",!0,!0),At=X,Ti="",gi="",kr="",Wi="",xi="-1",mi=et($e.isSelected),nr="";if($e.classNames&&(vt+=" ".concat($e.classNames)),$e.isFocused&&(xi="0",vt+=" focused"),$e.isDisabled&&(vt+=" disabled",nr='aria-disabled="true"'),$e.isGroupTitle&&(_e=$e.label,vt+=" group-title",ae&&(At="")),mi&&(vt+=" selected"),$e.isGroupOption){var jn="";vt+=" group-option",kr='data-group-index="'.concat($e.groupIndex,'"'),$e.customData?(_e=$e.customData.group_name!==void 0?"".concat($e.customData.group_name,", "):"",jn=$e.customData.description!==void 0?" ".concat($e.customData.description,","):"",Wi='aria-label="'.concat(_e," ").concat($e.label,", ").concat(jn,'"')):Wi='aria-label="'.concat(_e,", ").concat($e.label,'"')}Vt=ye?fe($e):$e.label,$e.description&&(gi='<div class="vscomp-option-description" '.concat(Bt,">").concat($e.description,"</div>")),$e.isCurrentNew?(vt+=" current-new",Ti+=Z):!ie||$e.isGroupTitle&&!he||(Vt=Vt.replace(_,"<mark>$1</mark>")),B+='<div role="option" aria-selected="'.concat(mi,'" id="vscomp-option-').concat(ge,"-").concat(An,`" 182 class="`).concat(vt,'" data-value="').concat($e.value,'" data-index="').concat(An,'" data-visible-index="').concat($e.visibleIndex,`" 183 tabindex=`).concat(xi," ").concat(kr," ").concat(nr," ").concat(Wi,` 184 > 185 `).concat(At,`
186 <span class="vscomp-option-text" `).concat(Bt,`> 187 `).concat(Vt,` 188 </span> 189 `).concat(gi,` 190 `).concat(Ti,` 191 </div>`)}),_e="",this.$options.innerHTML=B,this.$visibleOptions=this.$options.querySelectorAll(".vscomp-option"),this.afterRenderOptions()}},{key:"renderSearch",value:function(){if(this.hasSearchContainer){var _="",C="";this.multiple&&!this.disableSelectAll&&(_=`<span class="vscomp-toggle-all-button"> 192 <span class="checkbox-icon vscomp-toggle-all-checkbox"></span> 193 <span class="vscomp-toggle-all-label">`.concat(this.selectAllText,`</span> 194 </span>`)),this.hasSearch&&(C='<label for="vscomp-search-input-'.concat(this.uniqueId,`" class="vscomp-search-label" 195 id="vscomp-search-label-`).concat(this.uniqueId,`" 196 > 197 `).concat(this.searchFormLabel,` 198 </label> 199 <input type="text" class="vscomp-search-input" placeholder="`).concat(this.searchPlaceholderText,`" 200 id="vscomp-search-input-`).concat(this.uniqueId,`"> 201 <span class="vscomp-search-clear">×</span>`));var B=`<div class="vscomp-search-container"> 202 `.concat(_,` 203 `).concat(C,` 204 </div>`);this.$search.innerHTML=B,this.$searchInput=this.$dropboxContainer.querySelector(".vscomp-search-input"),this.$searchClear=this.$dropboxContainer.querySelector(".vscomp-search-clear"),this.$toggleAllButton=this.$dropboxContainer.querySelector(".vscomp-toggle-all-button"),this.$toggleAllCheckbox=this.$dropboxContainer.querySelector(".vscomp-toggle-all-checkbox"),this.addEvent(this.$searchInput,"input","onSearch"),this.addEvent(this.$searchClear,"click","onSearchClear"),this.addEvent(this.$toggleAllButton,"click","onToggleAllOptions"),this.addEvent(this.$dropboxContainerBottom,"focus","onDropboxContainerTopOrBottomFocus"),this.addEvent(this.$dropboxContainerTop,"focus","onDropboxContainerTopOrBottomFocus")}}},{key:"addEvents",value:function(){this.addEvent(document,"click","onDocumentClick"),this.addEvent(this.$allWrappers,"keydown","onKeyDown"),this.addEvent(this.$toggleButton,"click","onToggleButtonClick"),this.addEvent(this.$clearButton,"click keydown","onClearButtonClick"),this.addEvent(this.$dropboxContainer,"click","onDropboxContainerClick"),this.addEvent(this.$dropboxCloseButton,"click","onDropboxCloseButtonClick"),this.addEvent(this.$optionsContainer,"scroll","onOptionsScroll"),this.addEvent(this.$options,"click","onOptionsClick"),this.addEvent(this.$options,"mouseover","onOptionsMouseOver"),this.addEvent(this.$options,"touchmove","onOptionsTouchMove"),this.addMutationObserver()}},{key:"addEvent",value:function(_,C,B){var $=this;_&&s.removeArrayEmpty(C.split(" ")).forEach(function(X){var Z="".concat(B,"-").concat(X),ie=$.events[Z];ie||(ie=$[B].bind($),$.events[Z]=ie),d.addEvent(_,X,ie)})}},{key:"removeEvents",value:function(){this.removeEvent(document,"click","onDocumentClick"),this.removeEvent(this.$allWrappers,"keydown","onKeyDown"),this.removeEvent(this.$toggleButton,"click","onToggleButtonClick"),this.removeEvent(this.$clearButton,"click keydown","onClearButtonClick"),this.removeEvent(this.$dropboxContainer,"click","onDropboxContainerClick"),this.removeEvent(this.$dropboxCloseButton,"click","onDropboxCloseButtonClick"),this.removeEvent(this.$optionsContainer,"scroll","onOptionsScroll"),this.removeEvent(this.$options,"click","onOptionsClick"),this.removeEvent(this.$options,"mouseover","onOptionsMouseOver"),this.removeEvent(this.$options,"touchmove","onOptionsTouchMove"),this.removeMutationObserver()}},{key:"removeEvent",value:function(_,C,B){var $=this;_&&s.removeArrayEmpty(C.split(" ")).forEach(function(X){var Z="".concat(B,"-").concat(X),ie=$.events[Z];ie&&d.removeEvent(_,X,ie)})}},{key:"onDocumentClick",value:function(_){var C=_.target.closest(".vscomp-wrapper");C!==this.$wrapper&&C!==this.$dropboxWrapper&&this.isOpened()&&this.closeDropbox()}},{key:"onKeyDown",value:function(_){var C=_.which||_.keyCode,B=k[C];if(document.activeElement===this.$searchInput&&_.shiftKey&&C===9)return _.preventDefault(),void(this.keepAlwaysOpen?this.$dropboxContainerTop.focus():(this.closeDropbox(),this.$wrapper.focu
204s()));if(document.activeElement===this.$searchInput&&C===9)return _.preventDefault(),void this.focusFirstVisibleOption();if(C===27||_.key==="Escape"){var $=this.showAsPopup?this.$wrapper:this.$dropboxWrapper;if((document.activeElement===$||$.contains(document.activeElement))&&!this.keepAlwaysOpen)return this.closeDropbox(),void this.$wrapper.focus()}B&&this[B](_)}},{key:"onEnterPress",value:function(_){_.preventDefault(),this.isOpened()?this.selectFocusedOption():this.$ele.disabled===!1&&this.openDropbox()}},{key:"onDownArrowPress",value:function(_){_.preventDefault(),this.isOpened()?this.focusOption({direction:"next"}):this.openDropbox()}},{key:"onUpArrowPress",value:function(_){_.preventDefault(),this.isOpened()?this.focusOption({direction:"previous"}):this.openDropbox()}},{key:"onBackspaceOrDeletePress",value:function(_){_.target===this.$wrapper&&(_.preventDefault(),this.selectedValues.length>0&&this.reset())}},{key:"onToggleButtonClick",value:function(_){var C=_.target;C.closest(".vscomp-value-tag-clear-button")?this.removeValue(C.closest(".vscomp-value-tag")):C.closest(".toggle-button-child")||this.toggleDropbox()}},{key:"onClearButtonClick",value:function(_){_.type==="click"?this.reset():_.type!=="keydown"||_.code!=="Enter"&&_.code!=="Space"||(_.stopPropagation(),this.reset())}},{key:"onOptionsScroll",value:function(){this.setVisibleOptions()}},{key:"onOptionsClick",value:function(_){var C=_.target.closest(".vscomp-option");C&&!d.hasClass(C,"disabled")&&(d.hasClass(C,"group-title")?this.onGroupTitleClick(C):this.selectOption(C,{event:_}))}},{key:"onGroupTitleClick",value:function(_){if(_&&this.multiple&&!this.disableOptionGroupCheckbox){var C=!d.hasClass(_,"selected");this.toggleGroupTitleCheckbox(_,C),this.toggleGroupOptions(_,C)}}},{key:"onDropboxContainerClick",value:function(_){_.target.closest(".vscomp-dropbox")||this.closeDropbox()}},{key:"onDropboxCloseButtonClick",value:function(){this.closeDropbox()}},{key:"onOptionsMouseOver",value:function(_){var C=_.target.closest(".vscomp-option");C&&this.isOpened()&&(d.hasClass(C,"disabled")||d.hasClass(C,"group-title")?this.removeOptionFocus():this.focusOption({$option:C}))}},{key:"onOptionsTouchMove",value:function(){this.removeOptionFocus()}},{key:"onSearch",value:function(_){_.stopPropagation(),this.setSearchValue(_.target.value,!0)}},{key:"onSearchClear",value:function(){this.setSearchValue(""),this.focusSearchInput()}},{key:"onToggleAllOptions",value:function(){this.toggleAllOptions()}},{key:"onDropboxContainerTopOrBottomFocus",value:function(){this.closeDropbox()}},{key:"onResize",value:function(){this.setOptionsContainerHeight(!0)}},{key:"addMutationObserver",value:function(){var _=this;if(this.hasDropboxWrapper){var C=this.$ele;this.mutationObserver=new MutationObserver(function(B){var $=!1,X=!1;B.forEach(function(Z){$||($=x(Z.addedNodes).some(function(ie){return!(ie!==C&&!ie.contains(C))})),X||(X=x(Z.removedNodes).some(function(ie){return!(ie!==C&&!ie.contains(C))}))}),X&&!$&&_.destroy()}),this.mutationObserver.observe(document.querySelector("body"),{childList:!0,subtree:!0})}}},{key:"removeMutationObserver",value:function(){this.mutationObserver.disconnect()}},{key:"beforeValueSet",value:function(_){this.toggleAllOptionsClass(!_&&void 0)}},{key:"beforeSelectNewValue",value:function(){var _=this,C=this.getNewOption(),B=C.index;this.newValues.push(C.value),this.setOptionProp(B,"isCurrentNew",!1),this.setOptionProp(B,"isNew",!0),setTimeout(function(){_.setSearchValue(""),_.focusSearchInput()},0)}},{key:"afterRenderWrapper",value:function(){d.addClass(this.$ele,"vscomp-ele"),this.renderSearch(),this.setEleStyles(),this.setDropboxStyles(),this.setOptionsHeight(),this.setVisibleOptions(),this.setOptionsContainerHeight(),this.addEvents(),this.setEleProps(),this.keepAlwaysOpen||this.showAsPopup||this.initDropboxPopover(),this.initialSelectedValue?this.setValueMethod(this.initialSelectedValue,this.silentInitialValueSet):this.autoSelectFirstOption&&this.visibleOptions.length&&this.setValueMethod(this.visibleOptions[0].value,this.silentInitialValueSet),this.showOptionsOnlyOnSearch&&this.setSearchValue("",!1,!0),this.initialDisabled&&this.disable(),this.autofocus&&this.focus()}},{key:"afterRenderOptions",value:function(){var _=this.getVisibleOptions(),C=!this.options.length&&!this.hasServerSearch,B=!C&&!_.length;if((!this.allowNewOption||this.hasServerSearch||this.showOptionsOnlyOnSearch)&&(d.toggleClass(this.$allWrappers,"has-no-search-results",B),B?(d.setAttr(this.$noSearchResults,"tabindex","0"),d.setAttr(this.$noSearchResults,"aria-hidden","false")):(d.setAttr(this.$noSearchResults,"tabindex","-1"),d.setAttr(this.$noSearchResults,"aria-hidden","true"))),d.toggleClass(this.$allWrappers,"has-no-options",C),C?(d.setAttr(this.$noOptions,"tabindex","0"),d.setAttr(this.$noOptions,"aria-hidden","false")):(d.setAttr(this.$noOptions,"tabindex","-1"),d.setAttr(this.$noOptions,"aria-hidden","true")),this.setOptionAttr(),this.setOptionsPosition(),this.setOptionsTooltip(),document.activeElement!==this.$searchInput){var $=d.getElementsBySelector(".focused",this.$dropboxContainer)[0];
204$!==void 0&&$.focus()}}},{key:"afterSetOptionsContainerHeight",value:function(_){_&&this.showAsPopup&&this.setVisibleOptions()}},{key:"afterSetSearchValue",value:function(){var _=this;this.hasServerSearch?(clearInterval(this.serverSearchTimeout),this.serverSearchTimeout=setTimeout(function(){_.serverSearch()},this.searchDelay)):this.setVisibleOptionsCount(),this.selectAllOnlyVisible&&this.toggleAllOptionsClass(),this.focusOption({focusFirst:!0})}},{key:"afterSetVisibleOptionsCount",value:function(){this.scrollToTop(),this.setOptionsHeight(),this.setVisibleOptions(),this.updatePosition()}},{key:"afterValueSet",value:function(){this.scrollToTop(),this.setSearchValue(""),this.renderOptions()}},{key:"afterSetOptions",value:function(_){_&&this.setSelectedProp(),this.setOptionsHeight(),this.setVisibleOptions(),this.showOptionsOnlyOnSearch&&this.setSearchValue("",!1,!0),_||this.reset()}},{key:"setProps",value:function(_){var C=this.setDefaultProps(_);this.setPropsFromElementAttr(C);var B=s.convertToBoolean;this.$ele=C.ele,this.dropboxWrapper=C.dropboxWrapper,this.valueKey=C.valueKey,this.labelKey=C.labelKey,this.descriptionKey=C.descriptionKey,this.aliasKey=C.aliasKey,this.optionHeightText=C.optionHeight,this.optionHeight=parseFloat(this.optionHeightText),this.multiple=B(C.multiple),this.hasSearch=B(C.search),this.searchByStartsWith=B(C.searchByStartsWith),this.searchGroup=B(C.searchGroup),this.hideClearButton=B(C.hideClearButton),this.autoSelectFirstOption=B(C.autoSelectFirstOption),this.hasOptionDescription=B(C.hasOptionDescription),this.silentInitialValueSet=B(C.silentInitialValueSet),this.allowNewOption=B(C.allowNewOption),this.markSearchResults=B(C.markSearchResults),this.showSelectedOptionsFirst=B(C.showSelectedOptionsFirst),this.disableSelectAll=B(C.disableSelectAll),this.keepAlwaysOpen=B(C.keepAlwaysOpen),this.showDropboxAsPopup=B(C.showDropboxAsPopup),this.hideValueTooltipOnSelectAll=B(C.hideValueTooltipOnSelectAll),this.showOptionsOnlyOnSearch=B(C.showOptionsOnlyOnSearch),this.selectAllOnlyVisible=B(C.selectAllOnlyVisible),this.alwaysShowSelectedOptionsCount=B(C.alwaysShowSelectedOptionsCount),this.alwaysShowSelectedOptionsLabel=B(C.alwaysShowSelectedOptionsLabel),this.disableAllOptionsSelectedText=B(C.disableAllOptionsSelectedText),this.showValueAsTags=B(C.showValueAsTags),this.disableOptionGroupCheckbox=B(C.disableOptionGroupCheckbox),this.enableSecureText=B(C.enableSecureText),this.setValueAsArray=B(C.setValueAsArray),this.disableValidation=B(C.disableValidation),this.initialDisabled=B(C.disabled),this.required=B(C.required),this.autofocus=B(C.autofocus),this.useGroupValue=B(C.useGroupValue),this.focusSelectedOptionOnOpen=B(C.focusSelectedOptionOnOpen),this.noOptionsText=C.noOptionsText,this.noSearchResultsText=C.noSearchResultsText,this.selectAllText=C.selectAllText,this.searchNormalize=C.searchNormalize,this.searchPlaceholderText=C.searchPlaceholderText,this.searchFormLabel=C.searchFormLabel,this.optionsSelectedText=C.optionsSelectedText,this.optionSelectedText=C.optionSelectedText,this.allOptionsSelectedText=C.allOptionsSelectedText,this.clearButtonText=C.clearButtonText,this.moreText=C.moreText,this.placeholder=C.placeholder,this.position=C.position,this.textDirection=C.textDirection,this.dropboxWidth=C.dropboxWidth,this.tooltipFontSize=C.tooltipFontSize,this.tooltipAlignment=C.tooltipAlignment,this.tooltipMaxWidth=C.tooltipMaxWidth,this.updatePositionThrottle=C.updatePositionThrottle,this.noOfDisplayValues=parseInt(C.noOfDisplayValues),this.zIndex=parseInt(C.zIndex),this.maxValues=parseInt(C.maxValues),this.minValues=parseInt(C.minValues),this.name=this.secureText(C.name),this.additionalClasses=C.additionalClasses,this.additionalDropboxClasses=C.additionalDropboxClasses,this.additionalDropboxContainerClasses=C.additionalDropboxContainerClasses,this.additionalToggleButtonClasses=C.additionalToggleButtonClasses,this.popupDropboxBreakpoint=C.popupDropboxBreakpoint,this.popupPosition=C.popupPosition,this.onServerSearch=C.onServerSearch,this.labelRenderer=C.labelRenderer,this.selectedLabelRenderer=C.selectedLabelRenderer,this.initialSelectedValue=C.selectedValue===0?"0":C.selectedValue,this.emptyValue=C.emptyValue,this.ariaLabelledby=C.ariaLabelledby,this.ariaLabelText=C.ariaLabelText,this.ariaLabelClearButtonText=C.ariaLabelClearButtonText,this.maxWidth=C.maxWidth,this.searchDelay=C.searchDelay,this.selectedValues=[],this.selectedOptions=[],this.newValues=[],this.events={},this.tooltipEnterDelay=200,this.searchValue="",this.searchValueOriginal="",this.isAllSelected=!1,(C.search===void 0&&this.multiple||this.allowNewOption||this.showOptionsOnlyOnSearch)&&(this.hasSearch=!0),this.hasServerSearch=typeof this.onServerSearch=="function",(this.maxValues||this.hasServerSearch||this.showOptionsOnlyOnSearch)&&(this.disableSelectAll=!0,this.disableOptionGroupCheckbox=!0),this.keepAlwaysOpen&&(this.dropboxWrapper="self"),this.showAsPopup=this.showDropboxAsPopup&&!this.keepAlwaysOpen&&window.innerWidth<=parseFloat(this.popupDropboxBreakpoint),this.hasSearchContainer=this.hasSearch||this.multiple&&!this.disableSelectAll,this.optionsCount=this.getOptionsCount(C.optionsCount),this.halfOptionsCount=Math.ceil(this.optionsCount/2),this.optionsHeight=this.getOptionsHeight(),this.uniqueId=this.getUniqueId()}}
204,{key:"setDefaultProps",value:function(_){var C={dropboxWrapper:"self",valueKey:"value",labelKey:"label",descriptionKey:"description",aliasKey:"alias",ariaLabelText:"Options list",ariaLabelClearButtonText:"Clear button",optionsCount:5,noOfDisplayValues:50,optionHeight:"40px",noOptionsText:"No options found",noSearchResultsText:"No results found",selectAllText:"Select All",searchNormalize:!1,searchPlaceholderText:"Search...",searchFormLabel:"Search",clearButtonText:"Clear",moreText:"more...",optionsSelectedText:"options selected",optionSelectedText:"option selected",allOptionsSelectedText:"All",placeholder:"Select",position:"bottom left",zIndex:_.keepAlwaysOpen?1:2,tooltipFontSize:"14px",tooltipAlignment:"center",tooltipMaxWidth:"300px",updatePositionThrottle:100,name:"",additionalClasses:"",additionalDropboxClasses:"",additionalDropboxContainerClasses:"",additionalToggleButtonClasses:"",maxValues:0,showDropboxAsPopup:!0,popupDropboxBreakpoint:"576px",popupPosition:"center",hideValueTooltipOnSelectAll:!0,emptyValue:"",searchDelay:300,focusSelectedOptionOnOpen:!0};return _.hasOptionDescription&&(C.optionsCount=4,C.optionHeight="50px"),Object.assign(C,_)}},{key:"setPropsFromElementAttr",value:function(_){var C=_.ele;Object.keys(P).forEach(function(B){var $=C.getAttribute(B);D.indexOf(B)===-1||$!==""&&$!=="true"||($=!0),$&&(_[P[B]]=$)})}},{key:"setEleProps",value:function(){var _=this.$ele;_.virtualSelect=this,_.value=this.multiple?[]:"",_.name=this.name,_.disabled=!1,_.required=this.required,_.autofocus=this.autofocus,_.multiple=this.multiple,_.form=_.closest("form"),_.reset=j.reset,_.setValue=j.setValueMethod,_.setOptions=j.setOptionsMethod,_.setDisabledOptions=j.setDisabledOptionsMethod,_.setEnabledOptions=j.setEnabledOptionsMethod,_.toggleSelectAll=j.toggleSelectAll,_.isAllSelected=j.isAllSelected,_.addOption=j.addOptionMethod,_.getNewValue=j.getNewValueMethod,_.getDisplayValue=j.getDisplayValueMethod,_.getSelectedOptions=j.getSelectedOptionsMethod,_.getDisabledOptions=j.getDisabledOptionsMethod,_.open=j.openMethod,_.close=j.closeMethod,_.focus=j.focusMethod,_.enable=j.enableMethod,_.disable=j.disableMethod,_.destroy=j.destroyMethod,_.validate=j.validateMethod,_.toggleRequired=j.toggleRequiredMethod,this.hasDropboxWrapper&&(this.$dropboxWrapper.virtualSelect=this)}},{key:"setValueMethod",value:function(_,C){var B={},$={},X=[],Z=this.multiple,ie=_;if(ie){if(Array.isArray(ie)||(ie=[ie]),Z){var fe=this.maxValues;fe&&ie.length>fe&&ie.splice(fe)}else ie.length>1&&(ie=[ie[0]]);ie=ie.map(function(ge){return ge||ge===0?ge.toString():""}),this.useGroupValue&&(ie=this.setGroupOptionsValue(ie)),ie.forEach(function(ge,he){B[ge]=!0,$[ge]=he}),this.allowNewOption&&ie&&this.setNewOptionsFromValue(ie)}if(this.options.forEach(function(ge){B[ge.value]!==!0||ge.isDisabled||ge.isGroupTitle?ge.isSelected=!1:(ge.isSelected=!0,X.push(ge.value))}),Z)this.hasOptionGroup&&this.setGroupsSelectedProp(),X.sort(function(ge,he){return $[ge]-$[he]});else{var ae=E(X,1);X=ae[0]}this.beforeValueSet(),this.setValue(X,{disableEvent:C}),this.afterValueSet()}},{key:"setGroupOptionsValue",value:function(_){var C=[],B={},$={};return _.forEach(function(X){$[X]=!0}),this.options.forEach(function(X){var Z=X.value,ie=$[Z]===!0;X.isGroupTitle?ie&&(B[X.index]=!0):(ie||B[X.groupIndex])&&C.push(Z)}),C}},{key:"setGroupsSelectedProp",value:function(){var _=this.isAllGroupOptionsSelected.bind(this);this.options.forEach(function(C){C.isGroupTitle&&(C.isSelected=_(C.index))})}},{key:"setOptionsMethod",value:function(_,C){this.setOptions(_),this.afterSetOptions(C)}},{key:"setDisabledOptionsMethod",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.setDisabledOptions(_,!0),C||(this.setValueMethod(null),this.toggleAllOptionsClass()),this.setVisibleOptions()}},{key:"setDisabledOptions",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1],B=[];if(_)if(_===!0)C&&this.options.forEach(function(X){return X.isDisabled=!0,B.push(X.value),X});else{B=_.map(function(X){return X.toString()});var $={};B.forEach(function(X){$[X]=!0}),C&&this.options.forEach(function(X){return X.isDisabled=$[X.value]===!0,X})}else C&&this.options.forEach(function(X){return X.isDisabled=!1,X});this.disabledOptions=B}}
204,{key:"setEnabledOptionsMethod",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.setEnabledOptions(_),C||(this.setValueMethod(null),this.toggleAllOptionsClass()),this.setVisibleOptions()}},{key:"setEnabledOptions",value:function(_){if(_!==void 0){var C=[];if(_===!0)this.options.forEach(function($){return $.isDisabled=!1,$});else{var B={};_.forEach(function($){B[$]=!0}),this.options.forEach(function($){var X=B[$.value]!==!0;return $.isDisabled=X,X&&C.push($.value),$})}this.disabledOptions=C}}},{key:"setOptions",value:function(){var _=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],B=[],$=this.disabledOptions.length,X=this.valueKey,Z=this.labelKey,ie=this.descriptionKey,fe=this.aliasKey,ae=this.hasOptionDescription,ge=s.getString,he=s.convertToBoolean,ye=this.secureText.bind(this),et=this.getAlias.bind(this),_e=0,gt=!1,$e={},Vt=!1;this.disabledOptions.forEach(function(Bt){$e[Bt]=!0}),Array.isArray(C)&&C.forEach(function Bt(At){var Ti;v(At)!=="object"&&(p(Ti={},X,At),p(Ti,Z,At),At=Ti);var gi=ye(ge(At[X])),kr=ye(ge(At[Z])),Wi=At.options,xi=!!Wi,mi={index:_e,value:gi,label:kr,labelNormalized:_.searchNormalize?s.normalizeString(kr).toLowerCase():kr.toLowerCase(),alias:et(At[fe]),isVisible:he(At.isVisible,!0),isNew:At.isNew||!1,isGroupTitle:xi,classNames:At.classNames};if(Vt||gi!==""||(Vt=!0),$&&(mi.isDisabled=$e[gi]===!0),At.isGroupOption&&(mi.isGroupOption=!0,mi.groupIndex=At.groupIndex),ae&&(mi.description=ye(ge(At[ie]))),At.customData&&(mi.customData=At.customData),B.push(mi),_e+=1,xi){var nr=mi.index;gt=!0,Wi.forEach(function(jn){jn.isGroupOption=!0,jn.groupIndex=nr,Bt(jn)})}});var An=B.length,vt=this.$ele;vt.options=B,vt.length=An,this.options=B,this.visibleOptionsCount=An,this.lastOptionIndex=An-1,this.newValues=[],this.hasOptionGroup=gt,this.hasEmptyValueOption=Vt,this.setSortedOptions()}},{key:"setServerOptions",value:function(){var _=this,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.setOptionsMethod(C,!0);var B=this.selectedOptions,$=this.options,X=!1;if(B.length){var Z={};X=!0,$.forEach(function(ie){Z[ie.value]=!0}),B.forEach(function(ie){Z[ie.value]!==!0&&(ie.isVisible=!1,$.push(ie))}),this.setOptionsMethod($,!0)}this.allowNewOption&&this.searchValue&&($.some(function(ie){return ie.label.toLowerCase()===_.searchValue})||(X=!0,this.setNewOption())),X?(this.setVisibleOptionsCount(),this.multiple&&this.toggleAllOptionsClass(),this.setValueText()):this.updatePosition(),this.setVisibleOptionsCount(),d.removeClass(this.$allWrappers,"server-searching")}},{key:"setSelectedOptions",value:function(){this.selectedOptions=this.options.filter(function(_){return _.isSelected})}},{key:"setSortedOptions",value:function(){var _=x(this.options);this.showSelectedOptionsFirst&&this.selectedValues.length&&(_=this.hasOptionGroup?this.sortOptionsGroup(_):this.sortOptions(_)),this.sortedOptions=_}},{key:"setVisibleOptions",value:function(){var _=x(this.sortedOptions),C=2*this.optionsCount,B=this.getVisibleStartIndex(),$=this.getNewOption(),X=B+C-1,Z=0;$&&($.visibleIndex=Z,Z+=1),_=_.filter(function(ie){var fe=!1;return ie.isVisible&&!ie.isCurrentNew&&(fe=Z>=B&&Z<=X,ie.visibleIndex=Z,Z+=1),fe}),$&&(_=[$].concat(x(_))),this.visibleOptions=_,this.visibleOptionsCount=_.length,this.renderOptions()}},{key:"setOptionsPosition",value:function(_){var C=parseInt((_||this.getVisibleStartIndex())*this.optionHeight);this.$options.style.transform="translate3d(0, ".concat(C,"px, 0)"),d.setData(this.$options,"top",C)}},{key:"setOptionsTooltip",value:function(){var _=this,C=this.getVisibleOptions(),B=this.hasOptionDescription;C.forEach(function($){var X=_.$dropboxContainer.querySelector('.vscomp-option[data-index="'.concat($.index,'"]'));d.setData(X.querySelector(".vscomp-option-text"),"tooltip",$.label),B&&d.setData(X.querySelector(".vscomp-option-description"),"tooltip",$.description)})}},{key:"setValue",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=C.disableEvent,$=B!==void 0&&B,X=C.disableValidation,Z=X!==void 0&&X;this.hasEmptyValueOption&&_===""||_?Array.isArray(_)?this.selectedValues=x(_):this.selectedValues=[_]:this.selectedValues=[];var ie=this.getValue();this.$ele.value=ie,this.$hiddenInput.value=this.getInputValue(ie),this.isMaxValuesSelected=!!(this.maxValues&&this.maxValues<=this.selectedValues.length),this.toggleAllOptionsClass(),this.setValueText(),d.toggleClass(this.$allWrappers,"has-value",s.isNotEmpty(this.selectedValues)),d.toggleClass(this.$allWrappers,"max-value-selected",this.isMaxValuesSelected),Z||this.validate(),$||d.dispatchEvent(this.$ele,"change",!0)}},{key:"setValueText",value:function(){var _=this,C=this.multiple,B=this.selectedValues,$=this.noOfDisplayValues,X=this.showValueAsTags,Z=this.$valueText,ie=this.selectedLabelRenderer,fe=[],ae=[],ge=B.length,he=0,ye=this.isAllSelected&&!this.hasServerSearch&&!this.disableAllOptionsSelectedText&&!X;if(ye&&this.hideValueTooltipOnSelectAll)Z.innerHTML="".concat(this.allOptionsSelectedText," (").concat(ge,")");
204else{this.getSelectedOptions({fullDetails:!0,keepSelectionOrder:!0}).some(function(vt){if(vt.isCurrentNew)return!1;if(he>=$)return!0;var Bt=vt.label;if(typeof ie=="function"&&(Bt=ie(vt)),fe.push(Bt),he+=1,X){var At=s.willTextOverflow(Z.parentElement,Bt)?_.getTooltipAttrText(Bt,!1,!0):"",Ti='<span class="vscomp-value-tag" data-index="'.concat(vt.index,'" ').concat(At,`> 205 <span class="vscomp-value-tag-content">`).concat(Bt,`</span> 206 <span class="vscomp-value-tag-clear-button"> 207 <i class="vscomp-clear-icon"></i> 208 </span> 209 </span>`);ae.push(Ti)}else ae.push(Bt);return!1});var et=ge-$;et>0&&ae.push('<span class="vscomp-value-tag more-value-count">+ '.concat(et," ").concat(this.moreText,"</span>"));var _e=fe.join(", ");if(_e==="")Z.innerHTML=this.placeholder;else if(Z.innerHTML=_e,C){var gt=this.maxValues;if(this.alwaysShowSelectedOptionsCount||d.hasEllipsis(Z)||gt||X){var $e='<span class="vscomp-selected-value-count">'.concat(ge,"</span>");if(gt&&($e+=' / <span class="vscomp-max-value-count">'.concat(gt,"</span>")),ye)Z.innerHTML="".concat(this.allOptionsSelectedText," (").concat(ge,")");else if(X)Z.innerHTML=ae.join(""),this.$valueTags=Z.querySelectorAll(".vscomp-value-tag"),this.setValueTagAttr();else if(!this.alwaysShowSelectedOptionsLabel){var Vt=ge===1?this.optionSelectedText:this.optionsSelectedText;Z.innerHTML="".concat($e," ").concat(Vt)}}else ae=[]}}var An="";ge===0?An=this.placeholder:X||(An=ae.join(", ")),X||d.setData(Z,"tooltip",An),C&&(X?this.updatePosition():d.setData(Z,"tooltipEllipsisOnly",ge===0))}},{key:"setSearchValue",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1],B=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(_!==this.searchValueOriginal||B){C||(this.$searchInput.value=_);var $=_.replace(/\\/g,"").toLowerCase().trim();this.searchValue=$,this.searchValueOriginal=_,d.toggleClass(this.$allWrappers,"has-search-value",_),this.afterSetSearchValue()}}},{key:"setVisibleOptionsCount",value:function(){var _,C=0,B=!1,$=this.searchGroup,X=this.showOptionsOnlyOnSearch,Z=this.searchByStartsWith,ie=this.searchValue;ie=this.searchNormalize?s.normalizeString(ie):ie;var fe=this.isOptionVisible.bind(this);this.hasOptionGroup&&(_=this.getVisibleOptionGroupsMapping(ie)),this.options.forEach(function(ae){var ge;ae.isCurrentNew||(X&&!ie?(ae.isVisible=!1,ge={isVisible:!1,hasExactOption:!1}):ge=fe({data:ae,searchValue:ie,hasExactOption:B,visibleOptionGroupsMapping:_,searchGroup:$,searchByStartsWith:Z}),ge.isVisible&&(C+=1),B||(B=ge.hasExactOption))}),this.allowNewOption&&(ie&&!B?(this.setNewOption(),C+=1):this.removeNewOption()),this.visibleOptionsCount=C,this.afterSetVisibleOptionsCount()}},{key:"setOptionProp",value:function(_,C,B){this.options[_]&&(this.options[_][C]=B)}},{key:"setOptionsHeight",value:function(){this.$optionsList.style.height="".concat(this.optionHeight*this.visibleOptionsCount,"px")}},{key:"setOptionsContainerHeight",value:function(_){var C;_?this.showAsPopup&&(this.optionsCount=this.getOptionsCount(),this.halfOptionsCount=Math.ceil(this.optionsCount/2),C=this.getOptionsHeight(),this.optionsHeight=C):(C=this.optionsHeight,this.keepAlwaysOpen&&(d.setStyle(this.$noOptions,"height",C),d.setStyle(this.$noSearchResults,"height",C))),d.setStyle(this.$optionsContainer,"max-height",C),this.afterSetOptionsContainerHeight(_)}},{key:"setNewOption",value:function(_){var C=_||this.searchValueOriginal.trim();if(C){var B=this.getNewOption();if(B){var $=B.index;this.setOptionProp($,"value",this.secureText(C)),this.setOptionProp($,"label",this.secureText(C))}else{var X={value:C,label:C};_?(X.isNew=!0,this.newValues.push(C)):X.isCurrentNew=!0,this.addOption(X)}}}},{key:"setSelectedProp",value:function(){var _={};this.selectedValues.forEach(function(C){_[C]=!0}),this.options.forEach(function(C){_[C.value]===!0&&(C.isSelected=!0)})}},{key:"setNewOptionsFromValue",value:function(_){if(_){var C=this.setNewOption.bind(this),B={};this.options.forEach(function($){B[$.value]=!0}),_.forEach(function($){$&&B[$]!==!0&&C($)})}}},{key:"setDropboxWrapperWidth",value:function(){if(!this.showAsPopup){var _=this.dropboxWidth||"".concat(this.$wrapper.offsetWidth,"px");d.setStyle(this.$dropboxContainer,"max-width",_)}}},{key:"setEleStyles",value:function(){var _=this.maxWidth,C={};_&&(C["max-width"]=_),d.setStyles(this.$ele,C)}},{key:"setDropboxStyles",value:function(){var _=this.dropboxWidth,C={},B={"z-index":this.zIndex};_&&(this.showAsPopup?C["max-width"]=_:B.width=_),d.setStyles(this.$dropboxContainer,B),d.setStyles(this.$dropbox,C)}},{key:"setOptionAttr",value:function(){var _=this.$visibleOptions,C=this.options,B="".concat(this.optionHeight,"px"),$=d.setStyle,X=d.getData,Z=d.setData;_&&_.length&&_.forEach(function(ie){var fe=C[X(ie,"index")];$(ie,"height",B),Z(ie,"value",fe.value)})}},{key:"setValueTagAttr",value:function(){var _=this.$valueTags;if(_&&_.length){var C=d.getData,B=d.setData,$=this.options;_.forEach(function(X){var Z=C(X,"index");if(Z!==void 0){var ie=$[Z];B(X,"value",ie.value)}})}}},{key:"setScrollTop",value:function(){var _=this.selectedValues;if(!this.showSelectedOptionsFirst&&this.focusSelectedOptionOnOpen&&_.length!==0){var C,B={};_.forEach(function($){B[$]=!0}),this.options.some(function($){return!!B[$.value]&&(C=$.visibleIndex,!0)}),C&&(this.$optionsContainer.scrollTop=this.optionHeight*C)}}},{key:"getVisibleOptions",value:function(){return this.visibleOptions||[]}},{key:"getValue",value:function(){return this.multiple?this.useGroupValue?this.getGroupValue():this.selectedValues:this.selectedValues[0]||""}},{key:"getGroupValue",value:function(){var _=[],C={};return this.options.forEach(function(B){if(B.isSelected){var $=B.value;B.isGroupTitle?$&&(C[B.index]=!0,_.push($)):C[B.groupIndex]!==!0&&_.push($)}}),_}}
209,{key:"getInputValue",value:function(_){var C=_;return C&&C.length?this.setValueAsArray&&this.multiple&&(C=JSON.stringify(C)):C=this.emptyValue,C}},{key:"getFirstVisibleOptionIndex",value:function(){return Math.ceil(this.$optionsContainer.scrollTop/this.optionHeight)}},{key:"getVisibleStartIndex",value:function(){var _=this.getFirstVisibleOptionIndex()-this.halfOptionsCount;return _<0&&(_=0),_}},{key:"getTooltipAttrText",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1],B=arguments.length>2&&arguments[2]!==void 0&&arguments[2],$={"data-tooltip":(s.containsHTML(_)?s.replaceDoubleQuotesWithHTML(_):_)||"","data-tooltip-enter-delay":this.tooltipEnterDelay,"data-tooltip-z-index":this.zIndex,"data-tooltip-font-size":this.tooltipFontSize,"data-tooltip-alignment":this.tooltipAlignment,"data-tooltip-max-width":this.tooltipMaxWidth,"data-tooltip-ellipsis-only":C,"data-tooltip-allow-html":B};return d.getAttributesText($)}},{key:"getOptionObj",value:function(_){if(_){var C=s.getString,B=this.secureText.bind(this);return{index:_.index,value:B(C(_.value)),label:B(C(_.label)),description:B(C(_.description)),alias:this.getAlias(_.alias),isCurrentNew:_.isCurrentNew||!1,isNew:_.isNew||!1,isVisible:!0}}}},{key:"getNewOption",value:function(){var _=this.options[this.lastOptionIndex];if(_&&_.isCurrentNew)return _}},{key:"getOptionIndex",value:function(_){var C;return this.options.some(function(B){return B.value===_&&(C=B.index,!0)}),C}},{key:"getNewValue",value:function(){var _={};this.newValues.forEach(function(B){_[B]=!0});var C=this.selectedValues.filter(function(B){return _[B]===!0});return this.multiple?C:C[0]}},{key:"getAlias",value:function(_){var C=_;return C&&(C=(C=Array.isArray(C)?C.join(","):C.toString().trim()).toLowerCase()),C||""}},{key:"getDisplayValue",value:function(){var _=[];return this.options.forEach(function(C){C.isSelected&&_.push(C.label)}),this.multiple?_:_[0]||""}},{key:"getSelectedOptions",value:function(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},C=_.fullDetails,B=C!==void 0&&C,$=_.keepSelectionOrder,X=$!==void 0&&$,Z=this.valueKey,ie=this.labelKey,fe=this.selectedValues,ae=[];if(this.options.forEach(function(he){if(he.isSelected&&!he.isGroupTitle)if(B)ae.push(he);else{var ye,et=(p(ye={},Z,he.value),p(ye,ie,he.label),ye);he.isNew&&(et.isNew=!0),he.customData&&(et.customData=he.customData),ae.push(et)}}),X){var ge={};fe.forEach(function(he,ye){ge[he]=ye}),ae.sort(function(he,ye){return ge[he.value]-ge[ye.value]})}return this.multiple||B?ae:ae[0]}},{key:"getDisabledOptions",value:function(){var _=this.valueKey,C=this.labelKey,B=this.disabledOptions,$={},X=[];return B.forEach(function(Z){$[Z]=!0}),this.options.forEach(function(Z){var ie,fe=Z.value,ae=Z.label;$[fe]&&X.push((p(ie={},_,fe),p(ie,C,ae),ie))}),X}},{key:"getVisibleOptionGroupsMapping",value:function(_){var C=this.options,B={},$=this.isOptionVisible.bind(this);return(C=this.structureOptionGroup(C)).forEach(function(X){B[X.index]=X.options.some(function(Z){return $({data:Z,searchValue:_}).isVisible})}),B}},{key:"getOptionsCount",value:function(_){var C;if(this.showAsPopup){var B=80*window.innerHeight/100-48;this.hasSearchContainer&&(B-=40),C=Math.floor(B/this.optionHeight)}else C=parseInt(_);return C}},{key:"getOptionsHeight",value:function(){return"".concat(this.optionsCount*this.optionHeight,"px")}},{key:"getSibling",value:function(_,C){var B=C==="next"?"nextElementSibling":"previousElementSibling",$=_;do $&&($=$[B]);while(d.hasClass($,"disabled")||d.hasClass($,"group-title"));return $}},{key:"getUniqueId",value:function(){var _=s.getRandomInt(1e4);return document.querySelector("#vscomp-ele-wrapper-".concat(_))?this.getUniqueId():_}},{key:"initDropboxPopover",value:function(){var _={ele:this.$ele,target:this.$dropboxContainer,position:this.position,zIndex:this.zIndex,margin:4,transitionDistance:30,hideArrowIcon:!0,disableManualAction:!0,disableUpdatePosition:!this.hasDropboxWrapper,updatePositionThrottle:this.updatePositionThrottle,afterShow:this.afterShowPopper.bind(this),afterHide:this.afterHidePopper.bind(this)};this.dropboxPopover=new PopoverComponent(_)}},{key:"openDropbox",value:function(_){this.isSilentOpen=_,_?d.setStyle(this.$dropboxContainer,"display","inline-flex"):(d.dispatchEvent(this.$ele,"beforeOpen"),d.setAria(this.$wrapper,"expanded",!0)),this.setDropboxWrapperWidth(),d.removeClass(this.$allWrappers,"closed"),d.changeTabIndex(this.$allWrappers,0),this.dropboxPopover&&!_?this.dropboxPopover.show():this.afterShowPopper()}},{key:"afterShowPopper",value:function(){var _=this.isSilentOpen;this.isSilentOpen=!1,_||(this.moveSelectedOptionsFirst(),this.setScrollTop(),d.addClass(this.$allWrappers,"focused"),this.showAsPopup?(d.addClass(this.$body,"vscomp-popup-active"),this.isPopupActive=!0):this.focusElementOnOpen(),d.dispatchEvent(this.$ele,"afterOpen"))}},{key:"closeDropbox",value:function(_){this.isSilentClose=_,this.keepAlwaysOpen?this.removeOptionFocus():(_?d.setStyle(this.$dropboxContainer,"display",""):(d.dispatchEvent(this.$ele,"beforeClose"),d.setAria(this.$wrapper,"expanded",!1),d.setAria(this.$wrapper,"activedescendant","")),this.dropboxPopover&&!_?this.dropboxPopover.hide():this.afterHidePopper())}},{key:"afterHidePopper",value:function(){var _=this.isSilentClose;this.isSilentClose=!1,d.removeClass(this.$allWrappers,"focused"),this.removeOptionFocus(),!_&&this.isPopupActive&&(d.removeClass(this.$body,"vscomp-popup-active"),this.isPopupActive=!1),d.addClass(this.$allWrappers,"closed"),_||(d.dispatchEvent(this.$ele,"afterClose"),(this.initialSelectedValue&&this.initialSelectedValue.length===0||this.selectedValues.length>0)&&this.focus())}},{key:"moveSelectedOptionsFirst",value:function(){this.showSelectedOptionsFirst&&(this.setSortedOptions(),this.$optionsContainer.scrollTop&&this.selectedValues.length?this.scrollToTop():this.setVisibleOptions())}},{key:"toggleDropbox",value:function(){this.isOpened()?this.closeDropbox():this.openDropbox()}},{key:"updatePosition",value:function(){this.dropboxPopover&&this.isOpened()&&this.$ele.updatePosition()}},{key:"isOpened",value:function(){return!d.hasClass(this.$wrapper,"closed")}},{key:"focusSearchInput",value:function(){var _=this.$searchInput;_&&_.focus()}},{key:"focusElementOnOpen",value:function(){var _=this.$searchInput,C=!this.options.length&&!this.hasServerSearch;if(_)C&&!this.allowNewOption?(d.setAttr(_,"disabled",""),this.$noOptions.focus()):(_.removeAttribute("disabled"),_.focus());else{var B=this.$dropbox.querySelector('[tabindex="0"]');d.getData(B,"index")!==void 0?this.focusOption({direction:"next"}):B?B.focus():this.focusFirstVisibleOption()}}},{key:"focusFirstVisibleOption",value:function(){var _=this.$optionsContainer.querySelector("[data-index='".concat(this.getFirstVisibleOptionIndex(),"']"));_?(d.hasClass(_,"group-title")&&(_=this.getSibling(_,"next")),d.setAttr(_,"tabindex","0"),this.$optionsContainer.scrollTop=this.optionHeight*this.getFirstVisibleOptionIndex(),this.focusOption({focusFirst:!0}),_.focus()):(_=this.$dropbox.querySelector('[tabindex="0"]'))&&_.focus()}},{key:"focusOption",value:function(){var _,C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=C.direction,$=C.$option,X=C.focusFirst,Z=this.$dropboxContainer.querySelector(".vscomp-option.focused");
209if($)_=$;else if(!Z||X){var ie=this.getFirstVisibleOptionIndex();_=this.$dropboxContainer.querySelector('.vscomp-option[data-visible-index="'.concat(ie,'"]')),(d.hasClass(_,"disabled")||d.hasClass(_,"group-title"))&&(_=this.getSibling(_,"next"))}else _=this.getSibling(Z,B);_&&_!==Z&&(Z&&this.toggleOptionFocusedState(Z,!1),this.toggleOptionFocusedState(_,!0),this.toggleFocusedProp(d.getData(_,"index"),!0),this.moveFocusedOptionToView(_))}},{key:"moveFocusedOptionToView",value:function(_){var C=_||this.$dropboxContainer.querySelector(".vscomp-option.focused");if(C){var B,$=this.$optionsContainer.getBoundingClientRect(),X=C.getBoundingClientRect(),Z=$.top,ie=$.bottom,fe=$.height,ae=X.top,ge=X.bottom,he=X.height,ye=C.offsetTop,et=d.getData(this.$options,"top","number");Z>ae?B=ye+et:ie<ge&&(B=ye-fe+he+et),B!==void 0&&(this.$optionsContainer.scrollTop=B)}}},{key:"removeOptionFocus",value:function(){var _=this.$dropboxContainer.querySelector(".vscomp-option.focused");_&&(this.toggleOptionFocusedState(_,!1),this.toggleFocusedProp(null))}},{key:"selectOption",value:function(_){var C=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).event;if(_){var B=!d.hasClass(_,"selected");if(B){if(this.multiple&&this.isMaxValuesSelected)return}else if(!this.multiple)return void this.closeDropbox();var $=this.selectedValues,X=d.getData(_,"value"),Z=d.getData(_,"index","number"),ie=d.hasClass(_,"current-new"),fe=!1,ae=this.lastSelectedOptionIndex;if(this.lastSelectedOptionIndex=null,this.toggleSelectedProp(Z,B),B){if(this.multiple)$.push(X),this.toggleAllOptionsClass(),this.toggleGroupOptionsParent(_),C&&C.shiftKey&&(fe=!0);else{$.length&&this.toggleSelectedProp(this.getOptionIndex($[0]),!1),$=[X];var ge=this.$dropboxContainer.querySelector(".vscomp-option.selected");ge&&this.toggleOptionSelectedState(ge,!1),this.closeDropbox(),ie||this.setSearchValue("")}this.lastSelectedOptionIndex=Z,this.toggleOptionSelectedState(_)}else this.multiple&&(this.toggleOptionSelectedState(_),s.removeItemFromArray($,X),this.toggleAllOptionsClass(!1),this.toggleGroupOptionsParent(_,!1));ie&&this.beforeSelectNewValue(),this.setValue($),fe&&this.selectRangeOptions(ae,Z)}}},{key:"selectFocusedOption",value:function(){this.selectOption(this.$dropboxContainer.querySelector(".vscomp-option.focused"))}},{key:"selectRangeOptions",value:function(_,C){var B=this;if(typeof _=="number"&&!this.maxValues){var $,X,Z=this.selectedValues,ie=this.hasOptionGroup,fe={};if(_<C?($=_,X=C):($=C,X=_),this.options.forEach(function(ge){if(!ge.isDisabled&&!ge.isGroupTitle&&ge.isVisible&&!ge.isSelected){var he=ge.index;if(he>$&&he<X){if(ie){var ye=ge.groupIndex;typeof ye=="number"&&(fe[ye]=!0)}ge.isSelected=!0,Z.push(ge.value)}}}),this.toggleAllOptionsClass(),this.setValue(Z),(fe=Object.keys(fe)).length){var ae=this.toggleGroupTitleProp.bind(this);fe.forEach(function(ge){ae(parseInt(ge))})}setTimeout(function(){B.renderOptions()},0)}}},{key:"toggleAllOptions",value:function(_){if(this.multiple&&!this.disableSelectAll){var C=typeof isSelected=="boolean"?_:!d.hasClass(this.$toggleAllCheckbox,"checked"),B=[],$=this.selectAllOnlyVisible;this.options.forEach(function(X){var Z=X;if(!Z.isDisabled&&!Z.isCurrentNew){var ie=Z.isVisible,fe=Z.isSelected;!C&&(!$||ie||!fe)||C&&$&&!ie&&!fe?Z.isSelected=!1:(Z.isSelected=!0,Z.isGroupTitle||B.push(Z.value))}}),this.toggleAllOptionsClass(C),this.setValue(B),this.renderOptions()}}},{key:"toggleAllOptionsClass",value:function(_){if(this.multiple){var C=!1;typeof _=="boolean"||(_=this.isAllOptionsSelected()),!_&&this.selectAllOnlyVisible&&this.searchValue!==""&&(this.visibleOptionsCount>0||this.searchValue==="")&&(C=this.isAllOptionsSelected(!0)),d.toggleClass(this.$toggleAllCheckbox,"checked",_||C),this.isAllSelected=_}}},{key:"isAllOptionsSelected",value:function(_){var C=!1;return this.options.length&&this.selectedValues.length&&(C=!this.options.some(function(B){return!B.isSelected&&!B.isDisabled&&!B.isGroupTitle&&(!_||B.isVisible)})),C}},{key:"isAllGroupOptionsSelected",value:function(_){var C=!1;return this.options.length&&(C=!this.options.some(function(B){return!B.isSelected&&!B.isDisabled&&!B.isGroupTitle&&B.groupIndex===_})),C}},{key:"toggleGroupOptionsParent",value:function(_,C){if(this.hasOptionGroup&&!this.disableOptionGroupCheckbox&&_){var B=d.getData(_,"groupIndex");
209B!==void 0&&(B=parseInt(B));var $=this.$options.querySelector('.vscomp-option[data-index="'.concat(B,'"]')),X=typeof C=="boolean"?C:this.isAllGroupOptionsSelected(B);this.toggleGroupTitleCheckbox($,X),this.toggleGroupTitleProp(B,X)}}},{key:"toggleGroupTitleProp",value:function(_,C){var B=typeof C=="boolean"?C:this.isAllGroupOptionsSelected(_);this.toggleSelectedProp(_,B)}},{key:"toggleGroupOptions",value:function(_,C){var B=this;if(this.hasOptionGroup&&!this.disableOptionGroupCheckbox&&_){var $=d.getData(_,"index","number"),X=this.selectedValues,Z=this.selectAllOnlyVisible,ie={},fe=s.removeItemFromArray;X.forEach(function(ae){ie[ae]=!0}),this.options.forEach(function(ae){if(!ae.isDisabled&&ae.groupIndex===$){var ge=ae.value;!C||Z&&!ae.isVisible?(ae.isSelected=!1,ie[ge]&&fe(X,ge)):(ae.isSelected=!0,ie[ge]||X.push(ge))}}),this.toggleAllOptionsClass(!!C&&null),this.setValue(X),setTimeout(function(){B.renderOptions()},0)}}},{key:"toggleGroupTitleCheckbox",value:function(_,C){if(_){var B=d.getData(_,"index","number");this.toggleSelectedProp(B,C),this.toggleOptionSelectedState(_,C)}}},{key:"toggleFocusedProp",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.focusedOptionIndex&&this.setOptionProp(this.focusedOptionIndex,"isFocused",!1),this.setOptionProp(_,"isFocused",C),this.focusedOptionIndex=_}},{key:"toggleSelectedProp",value:function(_){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.setOptionProp(_,"isSelected",C)}},{key:"scrollToTop",value:function(){var _=!this.isOpened();_&&this.openDropbox(!0),this.$optionsContainer.scrollTop>0&&(this.$optionsContainer.scrollTop=0),_&&this.closeDropbox(!0)}},{key:"reset",value:function(){var _=arguments.length>0&&arguments[0]!==void 0&&arguments[0],C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.options.forEach(function(B){B.isSelected=!1}),this.beforeValueSet(!0),this.setValue(null,{disableEvent:C,disableValidation:_}),this.afterValueSet(),_&&d.removeClass(this.$allWrappers,"has-error"),d.dispatchEvent(this.$ele,"reset")}},{key:"addOption",value:function(_,C){if(_){this.lastOptionIndex+=1;var B=this.getOptionObj(f(f({},_),{},{index:this.lastOptionIndex}));this.options.push(B),this.sortedOptions.push(B),C&&(this.visibleOptionsCount+=1,this.afterSetOptions())}}},{key:"removeOption",value:function(_){(_||_===0)&&(this.options.splice(_,1),this.lastOptionIndex-=1)}},{key:"removeNewOption",value:function(){var _=this.getNewOption();_&&this.removeOption(_.index)}},{key:"sortOptions",value:function(_){return _.sort(function(C,B){var $=C.isSelected||C.isAnySelected,X=B.isSelected||B.isAnySelected;return $||X?$&&(!X||C.index<B.index)?-1:1:0})}},{key:"sortOptionsGroup",value:function(_){var C=this.sortOptions.bind(this),B=this.structureOptionGroup(_);return B.forEach(function($){var X=$.options;$.isAnySelected=X.some(function(Z){return Z.isSelected}),$.isAnySelected&&C(X)}),C(B),this.destructureOptionGroup(B)}},{key:"isOptionVisible",value:function(_){var C=_.data,B=_.searchValue,$=_.hasExactOption,X=_.visibleOptionGroupsMapping,Z=_.searchGroup,ie=_.searchByStartsWith,fe=C.value.toLowerCase(),ae=this.searchNormalize?C.labelNormalized:C.label.toLowerCase(),ge=C.description,he=C.alias,ye=ie?ae.startsWith(B):ae.includes(B);return!C.isGroupTitle||Z&&ye||(ye=X[C.index]),ie||!he||ye||(ye=he.includes(B)),ie||!ge||ye||(ye=ge.toLowerCase().includes(B)),C.isVisible=ye,$||($=ae===B||fe===B),{isVisible:ye,hasExactOption:$}}},{key:"structureOptionGroup",value:function(_){var C=[],B={};return _.forEach(function($){if($.isGroupTitle){var X=[];$.options=X,B[$.index]=X,C.push($)}}),_.forEach(function($){$.isGroupOption&&B[$.groupIndex].push($)}),C}},{key:"destructureOptionGroup",value:function(_){var C=[];return _.forEach(function(B){C.push(B),C=C.concat(B.options)}),C}},{key:"serverSearch",value:function(){d.removeClass(this.$allWrappers,"has-no-search-results"),d.addClass(this.$allWrappers,"server-searching"),this.setSelectedOptions(),this.onServerSearch(this.searchValue,this)}},{key:"removeValue",value:function(_){var C=this.selectedValues,B=d.getData(_,"value");s.removeItemFromArray(C,B),this.setValueMethod(C)}}
209,{key:"focus",value:function(){this.$wrapper.focus()}},{key:"enable",value:function(){this.$ele.disabled=!1,this.$ele.removeAttribute("disabled"),this.$hiddenInput.removeAttribute("disabled"),d.setAria(this.$wrapper,"disabled",!1),d.changeTabIndex(this.$wrapper,0)}},{key:"disable",value:function(){this.$ele.disabled=!0,this.$ele.setAttribute("disabled",""),this.$hiddenInput.setAttribute("disabled",""),d.setAria(this.$wrapper,"disabled",!0),d.changeTabIndex(this.$wrapper,-1),this.$wrapper.blur()}},{key:"validate",value:function(){if(this.disableValidation)return!0;var _=!1,C=this.selectedValues,B=this.minValues;return this.required&&(s.isEmpty(C)||this.multiple&&B&&C.length<B)&&(_=!0),d.toggleClass(this.$allWrappers,"has-error",_),!_}},{key:"destroy",value:function(){var _=this.$ele;_.virtualSelect=void 0,_.value=void 0,_.innerHTML="",this.hasDropboxWrapper&&(this.$dropboxWrapper.remove(),this.removeEvents()),this.dropboxPopover&&this.dropboxPopover.destroy(),d.removeClass(_,"vscomp-ele")}},{key:"createSecureTextElements",value:function(){this.$secureDiv=document.createElement("div"),this.$secureText=document.createTextNode(""),this.$secureDiv.appendChild(this.$secureText)}},{key:"secureText",value:function(_){return _&&this.enableSecureText?(this.$secureText.nodeValue=_,this.$secureDiv.innerHTML):_}},{key:"toggleRequired",value:function(_){this.required=s.convertToBoolean(_),this.$ele.required=this.required}},{key:"toggleOptionSelectedState",value:function(_,C){var B=C;B===void 0&&(B=!d.hasClass(_,"selected")),d.toggleClass(_,"selected",B),d.setAria(_,"selected",B)}},{key:"toggleOptionFocusedState",value:function(_,C){_&&(d.toggleClass(_,"focused",C),d.setAttr(_,"tabindex",C?"0":"-1"),document.activeElement!==this.$searchInput&&_.focus(),C&&d.setAria(this.$wrapper,"activedescendant",_.id))}}],m=[{key:"init",value:function(_){var C=_.ele;if(C){var B=!1;if(typeof C=="string"){var $=(C=document.querySelectorAll(C)).length;if($===0)return;$===1&&(B=!0)}C.length!==void 0&&C.forEach!==void 0||(C=[C],B=!0);var X=[];
209return C.forEach(function(Z){Z.virtualSelect?X.push(Z.virtualSelect):(_.ele=Z,Z.tagName==="SELECT"&&j.setPropsFromSelect(_),X.push(new j(_)))}),B?X[0]:X}}},{key:"getAttrProps",value:function(){var _=d.convertPropToDataAttr,C={};return U.forEach(function(B){C[B]=B}),Y.forEach(function(B){C[_(B)]=B}),C}},{key:"setPropsFromSelect",value:function(_){var C=_.ele,B=[],$=[],X=function ie(fe){var ae=[];return Array.from(fe.children).forEach(function(ge){var he=ge.value,ye={value:he};ge.tagName==="OPTGROUP"?(ye.label=ge.getAttribute("label"),ye.options=ie(ge)):ye.label=ge.innerHTML,ae.push(ye),ge.disabled&&B.push(he),ge.selected&&$.push(he)}),ae}(C),Z=document.createElement("div");d.setAttrFromEle(C,Z,Object.keys(P),D),C.parentNode.insertBefore(Z,C),C.remove(),_.ele=Z,_.options=X,_.disabledOptions=B,_.selectedValue=$}},{key:"onFormReset",value:function(_){var C=_.target.closest("form");C&&C.querySelectorAll(".vscomp-ele-wrapper").forEach(function(B){B.parentElement.virtualSelect.reset(!0)})}},{key:"onFormSubmit",value:function(_){j.validate(_.target.closest("form"))||_.preventDefault()}},{key:"validate",value:function(_){if(!_)return!0;var C=!1;return _.querySelectorAll(".vscomp-ele-wrapper").forEach(function(B){var $=B.parentElement.virtualSelect.validate();C||$||(C=!0)}),!C}},{key:"reset",value:function(){var _=arguments.length>0&&arguments[0]!==void 0&&arguments[0],C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.virtualSelect.reset(_,C)}},{key:"setValueMethod",value:function(){var _;(_=this.virtualSelect).setValueMethod.apply(_,arguments)}},{key:"setOptionsMethod",value:function(){var _;(_=this.virtualSelect).setOptionsMethod.apply(_,arguments)}},{key:"setDisabledOptionsMethod",value:function(){var _;(_=this.virtualSelect).setDisabledOptionsMethod.apply(_,arguments)}},{key:"setEnabledOptionsMethod",value:function(){var _;(_=this.virtualSelect).setEnabledOptionsMethod.apply(_,arguments)}},{key:"toggleSelectAll",value:function(_){this.virtualSelect.toggleAllOptions(_)}},{key:"isAllSelected",value:function(){return this.virtualSelect.isAllSelected}},{key:"addOptionMethod",value:function(_){this.virtualSelect.addOption(_,!0)}},{key:"getNewValueMethod",value:function(){return this.virtualSelect.getNewValue()}},{key:"getDisplayValueMethod",value:function(){return this.virtualSelect.getDisplayValue()}},{key:"getSelectedOptionsMethod",value:function(_){return this.virtualSelect.getSelectedOptions(_)}},{key:"getDisabledOptionsMethod",value:function(){return this.virtualSelect.getDisabledOptions()}},{key:"openMethod",value:function(){return this.virtualSelect.openDropbox()}},{key:"closeMethod",value:function(){return this.virtualSelect.closeDropbox()}},{key:"focusMethod",value:function(){return this.virtualSelect.focus()}},{key:"enableMethod",value:function(){return this.virtualSelect.enable()}},{key:"disableMethod",value:function(){return this.virtualSelect.disable()}},{key:"destroyMethod",value:function(){return this.virtualSelect.destroy()}},{key:"validateMethod",value:function(){return this.virtualSelect.validate()}},{key:"toggleRequiredMethod",value:function(_){return this.virtualSelect.toggleRequired(_)}},{key:"onResizeMethod",value:function(){document.querySelectorAll(".vscomp-ele-wrapper").forEach(function(_){_.parentElement.virtualSelect.onResize()})}}],N&&I(L.prototype,N),m&&I(L,m),Object.defineProperty(L,"prototype",{writable:!1}),j}();document.addEventListener("reset",K.onFormReset),document.addEventListener("submit",K.onFormSubmit),window.addEventListener("resize",K.onResizeMethod),P=K.getAttrProps(),window.VirtualSelect=K,typeof NodeList<"u"&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)})(),function(){function n(o){return function(a){if(Array.isArray(a))return t(a)}(o)||function(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}(o)||function(a,l){if(a){if(typeof a=="string")return t(a,l);var c=Object.prototype.toString.call(a).slice(8,-1);return c==="Object"&&a.constructor&&(c=a.constructor.name),c==="Map"||c==="Set"?Array.from(a):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?t(a,l):void 0}}(o)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 210In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function t(o,a){(a==null||a>o.length)&&(a=o.length);for(var l=0,c=new Array(a);l<a;l++)c[l]=o[l];return c}
210var e=function(){function o(){(function(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")})(this,o)}var a;return a=[{key:"addClass",value:function(l,c){l&&(c=c.split(" "),o.getElements(l).forEach(function(u){var d;(d=u.classList).add.apply(d,n(c))}))}},{key:"removeClass",value:function(l,c){l&&(c=c.split(" "),o.getElements(l).forEach(function(u){var d;(d=u.classList).remove.apply(d,n(c))}))}},{key:"getElements",value:function(l){if(l)return l.forEach===void 0&&(l=[l]),l}},{key:"getMoreVisibleSides",value:function(l){if(!l)return{};var c=l.getBoundingClientRect(),u=window.innerWidth,d=window.innerHeight,h=c.left,f=c.top;return{horizontal:h>u-h-c.width?"left":"right",vertical:f>d-f-c.height?"top":"bottom"}}},{key:"getAbsoluteCoords",value:function(l){if(l){var c=l.getBoundingClientRect(),u=window.pageXOffset,d=window.pageYOffset;return{width:c.width,height:c.height,top:c.top+d,right:c.right+u,bottom:c.bottom+d,left:c.left+u}}}},{key:"getCoords",value:function(l){return l?l.getBoundingClientRect():{}}},{key:"getData",value:function(l,c,u){if(l){var d=l?l.dataset[c]:"";return u==="number"?d=parseFloat(d)||0:d==="true"?d=!0:d==="false"&&(d=!1),d}}},{key:"setData",value:function(l,c,u){l&&(l.dataset[c]=u)}},{key:"setStyle",value:function(l,c,u){l&&(l.style[c]=u)}},{key:"show",value:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"block";o.setStyle(l,"display",c)}},{key:"hide",value:function(l){o.setStyle(l,"display","none")}},{key:"getHideableParent",value:function(l){for(var c,u=l.parentElement;u;){var d=getComputedStyle(u).overflow;if(d.indexOf("scroll")!==-1||d.indexOf("auto")!==-1){c=u;break}u=u.parentElement}return c}}],a&&function(l,c){for(var u=0;u<c.length;u++){var d=c[u];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}(o,a),o}(),i=["top","bottom","left","right"].map(function(o){return"position-".concat(o)}),s={top:"rotate(180deg)",left:"rotate(90deg)",right:"rotate(-90deg)"},r=function(){function o(l){(function(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")})(this,o);try{this.setProps(l),this.init()}catch(c){console.warn("Couldn't initiate popper"),console.error(c)}}var a;return a=[{key:"init",value:function(){var l=this.$popperEle;l&&this.$triggerEle&&(e.setStyle(l,"zIndex",this.zIndex),this.setPosition())}},{key:"setProps",value:function(l){var c=(l=this.setDefaultProps(l)).position?l.position.toLowerCase():"auto";if(this.$popperEle=l.$popperEle,this.$triggerEle=l.$triggerEle,this.$arrowEle=l.$arrowEle,this.margin=parseFloat(l.margin),this.offset=parseFloat(l.offset),this.enterDelay=parseFloat(l.enterDelay),this.exitDelay=parseFloat(l.exitDelay),this.showDuration=parseFloat(l.showDuration),this.hideDuration=parseFloat(l.hideDuration),this.transitionDistance=parseFloat(l.transitionDistance),this.zIndex=parseFloat(l.zIndex),this.afterShowCallback=l.afterShow,this.afterHideCallback=l.afterHide,this.hasArrow=!!this.$arrowEle,c.indexOf(" ")!==-1){var u=c.split(" ");this.position=u[0],this.secondaryPosition=u[1]}else this.position=c}},{key:"setDefaultProps",value:function(l){return Object.assign({position:"auto",margin:8,offset:5,enterDelay:0,exitDelay:0,showDuration:300,hideDuration:200,transitionDistance:10,zIndex:1},l)}},{key:"setPosition",value:function(){e.show(this.$popperEle,"inline-flex");var l,c,u,d=window.innerWidth,h=window.innerHeight,f=e.getAbsoluteCoords(this.$popperEle),p=e.getAbsoluteCoords(this.$triggerEle),v=f.width,E=f.height,x=f.top,A=f.right,O=f.bottom,I=f.left,T=p.width,P=p.height,k=p.top,D=p.right,U=p.bottom,Y=p.left,K=k-x,j=Y-I,L=j,N=K,m=this.position,_=this.secondaryPosition,C=T/2-v/2,B=P/2-E/2,$=this.margin,X=this.transitionDistance,Z=window.scrollY-x,ie=h+Z,fe=window.scrollX-I,ae=d+fe,ge=this.offset;ge&&(Z+=ge,ie-=ge,fe+=ge,ae-=ge),m==="auto"&&(m=e.getMoreVisibleSides(this.$triggerEle).vertical);var he={top:{top:N-E-$,left:L+C},bottom:{top:N+P+$,left:L+C},right:{top:N+B,left:L+T+$},left:{top:N+B,left:L-v-$}},ye=he[m];if(N=ye.top,L=ye.left,_&&(_==="top"?N=K:_==="bottom"?N=K+P-E:_==="left"?L=j:_==="right"&&(L=j+T-v)),L<fe?m==="left"?u="right":L=fe+I>D?D-I:fe:L+v>ae&&(m==="right"?u="left":L=ae+I<Y?Y-A:ae-v),N<Z?m==="top"?u="bottom":N=Z+x>U?U-x:Z:N+E>ie&&(m==="bottom"?u="top":N=ie+x<k?k-O:ie-E),u){var et=he[u];(m=u)==="top"||m==="bottom"?N=et.top:m!=="left"&&m!=="right"||(L=et.left)}
210m==="top"?(l=N+X,c=L):m==="right"?(l=N,c=L-X):m==="left"?(l=N,c=L+X):(l=N-X,c=L);var _e="translate3d(".concat(parseInt(c),"px, ").concat(parseInt(l),"px, 0)");if(e.setStyle(this.$popperEle,"transform",_e),e.setData(this.$popperEle,"fromLeft",c),e.setData(this.$popperEle,"fromTop",l),e.setData(this.$popperEle,"top",N),e.setData(this.$popperEle,"left",L),e.removeClass(this.$popperEle,i.join(" ")),e.addClass(this.$popperEle,"position-".concat(m)),this.hasArrow){var gt=0,$e=0,Vt=L+I,An=N+x,vt=this.$arrowEle.offsetWidth/2,Bt=s[m]||"";m==="top"||m==="bottom"?(gt=T/2+Y-Vt)<vt?gt=vt:gt>v-vt&&(gt=v-vt):m!=="left"&&m!=="right"||(($e=P/2+k-An)<vt?$e=vt:$e>E-vt&&($e=E-vt)),e.setStyle(this.$arrowEle,"transform","translate3d(".concat(parseInt(gt),"px, ").concat(parseInt($e),"px, 0) ").concat(Bt))}e.hide(this.$popperEle)}},{key:"resetPosition",value:function(){e.setStyle(this.$popperEle,"transform","none"),this.setPosition()}},{key:"show",value:function(){var l=this,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=c.resetPosition,d=c.data;clearTimeout(this.exitDelayTimeout),clearTimeout(this.hideDurationTimeout),u&&this.resetPosition(),this.enterDelayTimeout=setTimeout(function(){var h=e.getData(l.$popperEle,"left"),f=e.getData(l.$popperEle,"top"),p="translate3d(".concat(parseInt(h),"px, ").concat(parseInt(f),"px, 0)"),v=l.showDuration;e.show(l.$popperEle,"inline-flex"),e.getCoords(l.$popperEle),e.setStyle(l.$popperEle,"transitionDuration",v+"ms"),e.setStyle(l.$popperEle,"transform",p),e.setStyle(l.$popperEle,"opacity",1),l.showDurationTimeout=setTimeout(function(){typeof l.afterShowCallback=="function"&&l.afterShowCallback(d)},v)},this.enterDelay)}},{key:"hide",value:function(){var l=this,c=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).data;clearTimeout(this.enterDelayTimeout),clearTimeout(this.showDurationTimeout),this.exitDelayTimeout=setTimeout(function(){if(l.$popperEle){var u=parseInt(e.getData(l.$popperEle,"fromLeft")),d=parseInt(e.getData(l.$popperEle,"fromTop")),h="translate3d(".concat(u,"px, ").concat(d,"px, 0)"),f=l.hideDuration;e.setStyle(l.$popperEle,"transitionDuration",f+"ms"),e.setStyle(l.$popperEle,"transform",h),e.setStyle(l.$popperEle,"opacity",0),l.hideDurationTimeout=setTimeout(function(){e.hide(l.$popperEle),typeof l.afterHideCallback=="function"&&l.afterHideCallback(c)},f)}},this.exitDelay)}},{key:"updatePosition",value:function(){e.setStyle(this.$popperEle,"transitionDuration","0ms"),this.resetPosition();var l=parseInt(e.getData(this.$popperEle,"left")),c=parseInt(e.getData(this.$popperEle,"top"));e.show(this.$popperEle,"inline-flex"),e.setStyle(this.$popperEle,"transform","translate3d(".concat(l,"px, ").concat(c,"px, 0)"))}}],a&&function(l,c){for(var u=0;u<c.length;u++){var d=c[u];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}(o.prototype,a),o}();window.PopperComponent=r}(),function(){function n(x){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(x)}function t(x,A){for(var O=0;O<A.length;O++){var I=A[O];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(x,e(I.key),I)}}function e(x){var A=function(O,I){if(n(O)!="object"||!O)return O;var T=O[Symbol.toPrimitive];if(T!==void 0){var P=T.call(O,"string");if(n(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)}(x);return n(A)=="symbol"?A:A+""}var i=function(){return x=function O(){(function(I,T){if(!(I instanceof T))throw new TypeError("Cannot call a class as a function")})(this,O)},A=[{key:"convertToBoolean",value:function(O){return O===!0||O==="true"||O!==!1&&O!=="false"&&arguments.length>1&&arguments[1]!==void 0&&arguments[1]}},{key:"removeArrayEmpty",value:function(O){return Array.isArray(O)&&O.length?O.filter(function(I){return!!I}):[]}},{key:"throttle",value:function(O,I){var T,P=0;return function(){for(var k=arguments.length,D=new Array(k),U=0;U<k;U++)D[U]=arguments[U];var Y=new Date().getTime(),K=I-(Y-P);clearTimeout(T),K<=0?(P=Y,O.apply(void 0,D)):T=setTimeout(function(){O.apply(void 0,D)},K)}}}],A&&t(x,A),Object.defineProperty(x,"prototype",{writable:!1}),x;var x,A}();function s(x){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},s(x)}function r(x){return function(A){if(Array.isArray(A))return o(A)}(x)||function(A){if(typeof Symbol<"u"&&A[Symbol.iterator]!=null||A["@@iterator"]!=null)return Array.from(A)}(x)||function(A,O){if(A){if(typeof A=="string")return o(A,O);var I=Object.prototype.toString.call(A).slice(8,-1);return I==="Object"&&A.constructor&&(I=A.constructor.name),I==="Map"||I==="Set"?Array.from(A):I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I)?o(A,O):void 0}}(x)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 211In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function o(x,A){(A==null||A>x.length)&&(A=x.length);for(var O=0,I=new Array(A);O<A;O++)I[O]=x[O];return I}function a(x,A){for(var O=0;O<A.length;O++){var I=A[O];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(x,l(I.key),I)}}function l(x){var A=function(O,I){if(s(O)!="object"||!O)return O;var T=O[Symbol.toPrimitive];if(T!==void 0){var P=T.call(O,"string");if(s(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)}(x);return s(A)=="symbol"?A:A+""}var c=function(){function x(){(function(I,T){if(!(I instanceof T))throw new TypeError("Cannot call a class as a function")})(this,x)}return A=x,O=[{key:"addClass",value:function(I,T){I&&(T=T.split(" "),x.getElements(I).forEac
211h(function(P){var k;(k=P.classList).add.apply(k,r(T))}))}},{key:"removeClass",value:function(I,T){I&&(T=T.split(" "),x.getElements(I).forEach(function(P){var k;(k=P.classList).remove.apply(k,r(T))}))}},{key:"hasClass",value:function(I,T){return!!I&&I.classList.contains(T)}},{key:"getElement",value:function(I){return I&&(typeof I=="string"?I=document.querySelector(I):I.length!==void 0&&(I=I[0])),I||null}},{key:"getElements",value:function(I){if(I)return I.forEach===void 0&&(I=[I]),I}},{key:"addEvent",value:function(I,T,P){x.addOrRemoveEvent(I,T,P,"add")}},{key:"removeEvent",value:function(I,T,P){x.addOrRemoveEvent(I,T,P,"remove")}},{key:"addOrRemoveEvent",value:function(I,T,P,k){I&&(T=i.removeArrayEmpty(T.split(" "))).forEach(function(D){(I=x.getElements(I)).forEach(function(U){k==="add"?U.addEventListener(D,P):U.removeEventListener(D,P)})})}},{key:"getScrollableParents",value:function(I){if(!I)return[];for(var T=[window],P=I.parentElement;P;){var k=getComputedStyle(P).overflow;k.indexOf("scroll")===-1&&k.indexOf("auto")===-1||T.push(P),P=P.parentElement}return T}},{key:"convertPropToDataAttr",value:function(I){return I?"data-popover-".concat(I).replace(/([A-Z])/g,"-$1").toLowerCase():""}}],O&&a(A,O),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,O}();function u(x){return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},u(x)}function d(x,A){for(var O=0;O<A.length;O++){var I=A[O];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(x,h(I.key),I)}}function h(x){var A=function(O,I){if(u(O)!="object"||!O)return O;var T=O[Symbol.toPrimitive];if(T!==void 0){var P=T.call(O,"string");if(u(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)}(x);return u(A)=="symbol"?A:A+""}var f,p={27:"onEscPress"},v=["target","position","margin","offset","enterDelay","exitDelay","showDuration","hideDuration","transitionDistance","updatePositionThrottle","zIndex","hideOnOuterClick","showOnHover","hideArrowIcon","disableManualAction","disableUpdatePosition"],E=function(){function x(T){(function(P,k){if(!(P instanceof k))throw new TypeError("Cannot call a class as a function")})(this,x);try{this.setProps(T),this.init()}catch(P){console.warn("Couldn't initiate Popover component"),console.error(P)}}return A=x,I=[{key:"init",value:function(T){var P=T.ele;if(P){var k=!1;if(typeof P=="string"){if(!(P=document.querySelectorAll(P)))return;P.length===1&&(k=!0)}P.length===void 0&&(P=[P],k=!0);var D=[];return P.forEach(function(U){T.ele=U,x.destroy(U),D.push(new x(T))}),k?D[0]:D}}},{key:"destroy",value:function(T){if(T){var P=T.popComp;P&&P.destroy()}}},{key:"showMethod",value:function(){this.popComp.show()}},{key:"hideMethod",value:function(){this.popComp.hide()}},{key:"updatePositionMethod",value:function(){this.popComp.popper.updatePosition()}},{key:"getAttrProps",value:function(){var T=c.convertPropToDataAttr,P={};return v.forEach(function(k){P[T(k)]=k}),P}}],(O=[{key:"init",value:function(){this.$popover&&(this.setElementProps(),this.renderArrow(),this.initPopper(),this.addEvents())}},{key:"getEvents",value:function(){var T=[{$ele:document,event:"click",method:"onDocumentClick"},{$ele:document,event:"keydown",method:"onDocumentKeyDown"}];return this.disableManualAction||(T.push({$ele:this.$ele,event:"click",method:"onTriggerEleClick"}),this.showOnHover&&(T.push({$ele:this.$ele,event:"mouseenter",method:"onTriggerEleMouseEnter"}),T.push({$ele:this.$ele,event:"mouseleave",method:"onTriggerEleMouseLeave"}))),T}},{key:"addOrRemoveEvents",value:function(T){var P=this;this.getEvents().forEach(function(k){P.addOrRemoveEvent({action:T,$ele:k.$ele,events:k.event,method:k.method})})}},{key:"addEvents",value:function(){this.addOrRemoveEvents("add")}},{key:"removeEvents",value:function(){this.addOrRemoveEvents("remove"),this.removeScrollEventListeners(),this.removeResizeEventListeners()}},{key:"addOrRemoveEvent",value:function(T){var P=this,k=T.action,D=T.$ele,U=T.events,Y=T.method,K=T.throttle;
vendor: 6,057 bytes, line 211
211D&&(U=i.removeArrayEmpty(U.split(" "))).forEach(function(j){var L="".concat(Y,"-").concat(j),N=P.events[L];N||(N=P[Y].bind(P),K&&(N=i.throttle(N,K)),P.events[L]=N),k==="add"?c.addEvent(D,j,N):c.removeEvent(D,j,N)})}},{key:"addScrollEventListeners",value:function(){this.$scrollableElems=c.getScrollableParents(this.$ele),this.addOrRemoveEvent({action:"add",$ele:this.$scrollableElems,events:"scroll",method:"onAnyParentScroll",throttle:this.updatePositionThrottle})}},{key:"removeScrollEventListeners",value:function(){this.$scrollableElems&&(this.addOrRemoveEvent({action:"remove",$ele:this.$scrollableElems,events:"scroll",method:"onAnyParentScroll"}),this.$scrollableElems=null)}},{key:"addResizeEventListeners",value:function(){this.addOrRemoveEvent({action:"add",$ele:window,events:"resize",method:"onResize",throttle:this.updatePositionThrottle})}},{key:"removeResizeEventListeners",value:function(){this.addOrRemoveEvent({action:"remove",$ele:window,events:"resize",method:"onResize"})}},{key:"onAnyParentScroll",value:function(){this.popper.updatePosition()}},{key:"onResize",value:function(){this.popper.updatePosition()}},{key:"onDocumentClick",value:function(T){var P=T.target,k=P.closest(".pop-comp-ele"),D=P.closest(".pop-comp-wrapper");this.hideOnOuterClick&&k!==this.$ele&&D!==this.$popover&&this.hide()}},{key:"onDocumentKeyDown",value:function(T){var P=T.which||T.keyCode,k=p[P];k&&this[k](T)}},{key:"onEscPress",value:function(){this.hideOnOuterClick&&this.hide()}},{key:"onTriggerEleClick",value:function(){this.toggle()}},{key:"onTriggerEleMouseEnter",value:function(){this.show()}},{key:"onTriggerEleMouseLeave",value:function(){this.hide()}},{key:"setProps",value:function(T){T=this.setDefaultProps(T),this.setPropsFromElementAttr(T);var P=i.convertToBoolean;this.$ele=T.ele,this.target=T.target,this.position=T.position,this.margin=parseFloat(T.margin),this.offset=parseFloat(T.offset),this.enterDelay=parseFloat(T.enterDelay),this.exitDelay=parseFloat(T.exitDelay),this.showDuration=parseFloat(T.showDuration),this.hideDuration=parseFloat(T.hideDuration),this.transitionDistance=parseFloat(T.transitionDistance),this.updatePositionThrottle=parseFloat(T.updatePositionThrottle),this.zIndex=parseFloat(T.zIndex),this.hideOnOuterClick=P(T.hideOnOuterClick),this.showOnHover=P(T.showOnHover),this.hideArrowIcon=P(T.hideArrowIcon),this.disableManualAction=P(T.disableManualAction),this.disableUpdatePosition=P(T.disableUpdatePosition),this.beforeShowCallback=T.beforeShow,this.afterShowCallback=T.afterShow,this.beforeHideCallback=T.beforeHide,this.afterHideCallback=T.afterHide,this.events={},this.$popover=c.getElement(this.target)}},{key:"setDefaultProps",value:function(T){return Object.assign({position:"auto",margin:8,offset:5,enterDelay:0,exitDelay:0,showDuration:300,hideDuration:200,transitionDistance:10,updatePositionThrottle:100,zIndex:1,hideOnOuterClick:!0,showOnHover:!1,hideArrowIcon:!1,disableManualAction:!1,disableUpdatePosition:!1},T)}},{key:"setPropsFromElementAttr",value:function(T){var P=T.ele;for(var k in f){var D=P.getAttribute(k);D&&(T[f[k]]=D)}}},{key:"setElementProps",value:function(){var T=this.$ele;T.popComp=this,T.show=x.showMethod,T.hide=x.hideMethod,T.updatePosition=x.updatePositionMethod,c.addClass(this.$ele,"pop-comp-ele"),c.addClass(this.$popover,"pop-comp-wrapper")}},{key:"getOtherTriggerPopComp",value:function(){var T,P=this.$popover.popComp;return P&&P.$ele!==this.$ele&&(T=P),T}},{key:"initPopper",value:function(){var T={$popperEle:this.$popover,$triggerEle:this.$ele,$arrowEle:this.$arrowEle,position:this.position,margin:this.margin,offset:this.offset,enterDelay:this.enterDelay,exitDelay:this.exitDelay,showDuration:this.showDuration,hideDuration:this.hideDuration,transitionDistance:this.transitionDistance,zIndex:this.zIndex,afterShow:this.afterShow.bind(this),afterHide:this.afterHide.bind(this)};this.popper=new PopperComponent(T)}},{key:"beforeShow",value:function(){typeof this.beforeShowCallback=="function"&&this.beforeShowCallback(this)}},{key:"beforeHide",value:function(){typeof this.beforeHideCallback=="function"&&this.beforeHideCallback(this)}},{key:"show",value:function(){this.isShown()||(this.isShownForOtherTrigger()?this.showAfterOtherHide():(c.addClass(this.$popover,"pop-comp-disable-events"),this.$popover.popComp=this,this.beforeShow(),this.popper.show({resetPosition:!0}),c.addClass(this.$ele,"pop-comp-active")))}},{key:"hide",value:function(){this.isShown()&&(this.beforeHide(),this.popper.hide(),this.removeScrollEventListeners(),this.removeResizeEventListeners())}},{key:"toggle",value:function(T){T===void 0&&(T=!this.isShown()),T?this.show():this.hide()}},{key:"isShown",value:function(){return c.hasClass(this.$ele,"pop-comp-active")}},{key:"isShownForOtherTrigger",value:function(){var T=this.getOtherTriggerPopComp();return!!T&&T.isShown()}},{key:"showAfterOtherHide",value:function(){var T=this,P=this.getOtherTriggerPopComp();if(P){var k=P.exitDelay+P.hideDuration+100;setTimeout(function(){T.show()},k)}}},{key:"afterShow",value:function(){var T=this;this.showOnHover?setTimeout(function(){c.removeClass(T.$popover,"pop-comp-disable-events")},2e3):c.removeClass(this.$popover,"pop-comp-disable-events"),this.disableUpdatePosition||(this.addScrollEventListeners(),this.addResizeEventListeners()),typeof this.afterShowCallback=="function"&&this.afterShowCallback(this)}},{key:"afterHide",value:function(){c.removeClass(this.$ele,"pop-comp-active"),typeof this.afterHideCallback=="function"&&this.afterHideCallback(this)}},{key:"renderArrow",value:function(){if(!this.hideArrowIcon){var T=this.$popover.querySelector(".pop-comp-arrow");T||(this.$popover.insertAdjacentHTML("afterbegin",'<i class="pop-comp-arrow"></i>'),T=this.$popover.querySelector(".pop-comp-arrow")),this.$arrowEle=T}}},{key:"destroy",value:function(){this.removeEvents()}}])&&d(A.prototype,O),I&&d(A,I),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,O,I}();f=E.getAttrProps(),window.PopoverComponent=E}();const $oe="modulepreload",Woe=function(n){return"/build/"+n},Y2={}
211,Uoe=function(t,e,i){if(!e||e.length===0)return t();const s=document.getElementsByTagName("link");return Promise.all(e.map(r=>{if(r=Woe(r),r in Y2)return;Y2[r]=!0;const o=r.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!i)for(let u=s.length-1;u>=0;u--){const d=s[u];if(d.href===r&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${a}`))return;const c=document.createElement("link");if(c.rel=o?"stylesheet":$oe,o||(c.as="script",c.crossOrigin=""),c.href=r,document.head.appendChild(c),o)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t()).catch(r=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r})};var sb={};sb.d=(n,t)=>{for(var e in t)sb.o(t,e)&&!sb.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})};sb.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);var nt=globalThis.pdfjsLib={};sb.d(nt,{AbortException:()=>Vc,AnnotationEditorLayer:()=>zk,AnnotationEditorParamsType:()=>xt,AnnotationEditorType:()=>ut,AnnotationEditorUIManager:()=>fh,AnnotationLayer:()=>Vle,AnnotationMode:()=>Ll,ColorPicker:()=>ME,DOMSVGFactory:()=>mM,DrawLayer:()=>Uk,FeatureTest:()=>es,GlobalWorkerOptions:()=>Qa,ImageKind:()=>u0,InvalidPDFException:()=>RC,MissingPDFException:()=>Ob,OPS:()=>Dr,OutputScale:()=>FC,PDFDataRangeTransport:()=>kz,PDFDateString:()=>dM,PDFWorker:()=>Af,PasswordResponses:()=>qoe,PermissionFlag:()=>Yoe,PixelsPerInch:()=>Hc,RenderingCancelledException:()=>cM,TextLayer:()=>Db,TouchManager:()=>IE,UnexpectedResponseException:()=>AE,Util:()=>ze,VerbosityLevel:()=>IT,XfaLayer:()=>Pz,build:()=>vle,createValidAbsoluteUrl:()=>Zoe,fetchData:()=>DT,getDocument:()=>ule,getFilenameFromUrl:()=>aae,getPdfFilenameFromUrl:()=>lae,getXfaPageViewport:()=>cae,isDataScheme:()=>RT,isPdfFile:()=>uM,noContextMenu:()=>lo,normalizeUnicode:()=>sae,setLayerDimensions:()=>hh,shadow:()=>wt,stopEvent:()=>$s,version:()=>wle});const Ni=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),C3=[1,0,0,1,0,0],DC=[.001,0,0,.001,0,0],joe=1e7,Qx=1.35,Hs={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Ll={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Goe="pdfjs_internal_editor_",ut={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},xt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},Yoe={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ci={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},u0={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Gn={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},ap={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},IT={ERRORS:0,WARNINGS:1,INFOS:5},Dr={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},qoe={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let PT=IT.WARNINGS;function Koe(n){Number.isInteger(n)&&(PT=n)}function Xoe(){return PT}function MT(n){PT>=IT.INFOS&&console.log(`Info: ${n}`)}function ht(n){PT>=IT.WARNINGS&&console.log(`Warning: ${n}`)}function Xt(n){throw new Error(n)}function Hn(n,t){n||Xt(t)}function Joe(n){switch(n==null?void 0:n.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function Zoe(n,t=null,e=null){if(!n)return null;try{if(e&&typeof n=="string"){if(e.addDefaultProtocol&&n.startsWith("www.")){const s=n.match(/\./g);(s==null?void 0:s.length)>=2&&(n=`http://${n}`)}if(e.tryConvertEncoding)try{n=iae(n)}catch{}}const i=t?new URL(n,t):new URL(n);if(Joe(i))return i}catch{}return null}function wt(n,t,e,i=!1){return Object.defineProperty(n,t,{value:e,enumerable:!i,configurable:!0,writable:!1}),e}const Kc=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class q2 extends Kc{constructor(t,e){super(t,"PasswordException"),this.code=e}}class eA extends Kc{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class RC extends Kc{constructor(t){super(t,"InvalidPDFException")}}class Ob extends Kc{constructor(t){super(t,"MissingPDFException")}}class AE extends Kc{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class Qoe extends Kc{constructor(t){super(t,"FormatError")}}class Vc extends Kc{constructor(t){super(t,"AbortException")}}function k3(n){(typeof n!="object"||(n==null?void 0:n.length)===void 0)&&Xt("Invalid argument for bytesToString");const t=n.length,e=8192;if(t<e)return String.fromCharCode.apply(null,n);const i=[];for(let s=0;s<t;s+=e){const r=Math.min(s+e,t),o=n.subarray(s,r);i.push(String.fromCharCode.apply(null,o))}return i.join("")}
211function OT(n){typeof n!="string"&&Xt("Invalid argument for stringToBytes");const t=n.length,e=new Uint8Array(t);for(let i=0;i<t;++i)e[i]=n.charCodeAt(i)&255;return e}function eae(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function aM(n){const t=Object.create(null);for(const[e,i]of n)t[e]=i;return t}function tae(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function nae(){try{return new Function(""),!0}catch{return!1}}class es{static get isLittleEndian(){return wt(this,"isLittleEndian",tae())}static get isEvalSupported(){return wt(this,"isEvalSupported",nae())}static get isOffscreenCanvasSupported(){return wt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return wt(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){return typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.platform)=="string"?wt(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof(navigator==null?void 0:navigator.userAgent)=="string"&&navigator.userAgent.includes("Firefox")}):wt(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){var t,e;return wt(this,"isCSSRoundSupported",(e=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const tA=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));var Mf,d0,ew,LC;class ze{static makeHexColor(t,e,i){return`#${tA[t]}${tA[e]}${tA[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){const i=t[0]*e[0]+t[1]*e[2]+e[4],s=t[0]*e[1]+t[1]*e[3]+e[5];return[i,s]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2],s=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,r=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i;return[s,r]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),s=this.applyTransform(t.slice(2,4),e),r=this.applyTransform([t[0],t[3]],e),o=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],s[0],r[0],o[0]),Math.min(i[1],s[1],r[1],o[1]),Math.max(i[0],s[0],r[0],o[0]),Math.max(i[1],s[1],r[1],o[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],s=t[0]*e[1]+t[1]*e[3],r=t[2]*e[0]+t[3]*e[2],o=t[2]*e[1]+t[3]*e[3],a=(i+o)/2,l=Math.sqrt((i+o)**2-4*(i*o-r*s))/2,c=a+l||1,u=a-l||1;return[Math.sqrt(c),Math.sqrt(u)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>s)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>o?null:[i,r,s,o]}static bezierBoundingBox(t,e,i,s,r,o,a,l,c){return c?(c[0]=Math.min(c[0],t,a),c[1]=Math.min(c[1],e,l),c[2]=Math.max(c[2],t,a),c[3]=Math.max(c[3],e,l)):c=[Math.min(t,a),Math.min(e,l),Math.max(t,a),Math.max(e,l)],W(this,ew,LC).call(this,t,i,r,a,e,s,o,l,3*(-t+3*(i-r)+a),6*(t-2*i+r),3*(i-t),c),W(this,ew,LC).call(this,t,i,r,a,e,s,o,l,3*(-e+3*(s-o)+l),6*(e-2*s+o),3*(s-e),c),c}}Mf=new WeakSet,d0=function(t,e,i,s,r,o,a,l,c,u){if(c<=0||c>=1)return;const d=1-c,h=c*c,f=h*c,p=d*(d*(d*t+3*c*e)+3*h*i)+f*s,v=d*(d*(d*r+3*c*o)+3*h*a)+f*l;u[0]=Math.min(u[0],p),u[1]=Math.min(u[1],v),u[2]=Math.max(u[2],p),u[3]=Math.max(u[3],v)}
211,ew=new WeakSet,LC=function(t,e,i,s,r,o,a,l,c,u,d,h){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&W(this,Mf,d0).call(this,t,e,i,s,r,o,a,l,-d/u,h);return}const f=u**2-4*d*c;if(f<0)return;const p=Math.sqrt(f),v=2*c;W(this,Mf,d0).call(this,t,e,i,s,r,o,a,l,(-u+p)/v,h),W(this,Mf,d0).call(this,t,e,i,s,r,o,a,l,(-u-p)/v,h)},F(ze,Mf),F(ze,ew);function iae(n){return decodeURIComponent(escape(n))}let nA=null,K2=null;function sae(n){return nA||(nA=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,K2=new Map([["ï¬ ","Å¿t"]])),n.replaceAll(nA,(t,e,i)=>e?e.normalize("NFKC"):K2.get(i))}function rae(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),k3(n)}const lM="pdfjs_internal_id_";function oae(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(k3(n))}typeof Promise.try!="function"&&(Promise.try=function(n,...t){return new Promise(e=>{e(n(...t))})});const fa="http://www.w3.org/2000/svg",xu=class xu{};y(xu,"CSS",96),y(xu,"PDF",72),y(xu,"PDF_TO_CSS_UNITS",xu.CSS/xu.PDF);let Hc=xu;async function DT(n,t="text"){if(Ip(n,document.baseURI)){const e=await fetch(n);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,i)=>{const s=new XMLHttpRequest;s.open("GET",n,!0),s.responseType=t,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(s.response);return}e(s.responseText);return}i(new Error(s.statusText))}},s.send(null)})}class Cy{constructor({viewBox:t,userUnit:e,scale:i,rotation:s,offsetX:r=0,offsetY:o=0,dontFlip:a=!1}){this.viewBox=t,this.userUnit=e,this.scale=i,this.rotation=s,this.offsetX=r,this.offsetY=o,i*=e;const l=(t[2]+t[0])/2,c=(t[3]+t[1])/2;let u,d,h,f;switch(s%=360,s<0&&(s+=360),s){case 180:u=-1,d=0,h=0,f=1;break;case 90:u=0,d=1,h=1,f=0;break;case 270:u=0,d=-1,h=-1,f=0;break;case 0:u=1,d=0,h=0,f=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(h=-h,f=-f);let p,v,E,x;u===0?(p=Math.abs(c-t[1])*i+r,v=Math.abs(l-t[0])*i+o,E=(t[3]-t[1])*i,x=(t[2]-t[0])*i):(p=Math.abs(l-t[0])*i+r,v=Math.abs(c-t[1])*i+o,E=(t[2]-t[0])*i,x=(t[3]-t[1])*i),this.transform=[u*i,d*i,h*i,f*i,p-u*i*l-h*i*c,v-d*i*l-f*i*c],this.width=E,this.height=x}get rawDims(){const{userUnit:t,viewBox:e}=this,i=e.map(s=>s*t);return wt(this,"rawDims",{pageWidth:i[2]-i[0],pageHeight:i[3]-i[1],pageX:i[0],pageY:i[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:s=this.offsetY,dontFlip:r=!1}={}){return new Cy({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:r})}convertToViewportPoint(t,e){return ze.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=ze.applyTransform([t[0],t[1]],this.transform),i=ze.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return ze.applyInverseTransform([t,e],this.transform)}}class cM extends Kc{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function RT(n){const t=n.length;let e=0;for(;e<t&&n[e].trim()==="";)e++;return n.substring(e,e+5).toLowerCase()==="data:"}function uM(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function aae(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function lae(n,t="document.pdf"){if(typeof n!="string")return t;if(RT(n))return ht('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const e=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,s=e.exec(n);let r=i.exec(s[1])||i.exec(s[2])||i.exec(s[3]);if(r&&(r=r[0],r.includes("%")))try{r=i.exec(decodeURIComponent(r))[0]}catch{}return r||t}class X2{constructor(){y(this,"started",Object.create(null));y(this,"times",[])}time(t){t in this.started&&ht(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||ht(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:s,end:r}of this.times)t.push(`${i.padEnd(e)} ${r-s}ms 212`);return t.join("")}}function Ip(n,t){try{const{protocol:e}=t?new URL(n,t):new URL(n);return e==="http:"||e==="https:"}catch{return!1}}function lo(n){n.preventDefault()}function $s(n){n.preventDefault(),n.stopPropagation()}var tw;class dM{static toDateObject(t){if(!t||typeof t!="string")return null;g(this,tw)||V(this,tw,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=g(this,tw).exec(t);if(!e)return null;const i=parseInt(e[1],10);let s=parseInt(e[2],10);s=s>=1&&s<=12?s-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let o=parseInt(e[4],10);o=o>=0&&o<=23?o:0;let a=parseInt(e[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let u=parseInt(e[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(o+=u,a+=d):c==="+"&&(o-=u,a-=d),new Date(Date.UTC(i,s,r,o,a,l))}}tw=new WeakMap,F(dM,tw,void 0);function cae(n,{scale:t=1,rotation:e=0}){const{width:i,height:s}=n.attributes.style,r=[0,0,parseInt(i),parseInt(s)];return new Cy({viewBox:r,userUnit:1,scale:t,rotation:e})}function hM(n){if(n.startsWith("#")){const t=parseInt(n.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(t=>parseInt(t)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(ht(`Not a valid color format: "${n}"`),[0,0,0])}function uae(n){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const e of n.keys()){t.style.color=e;const i=window.getComputedStyle(t).color;n.set(e,hM(i))}t.remove()}function hn(n){const{a:t,b:e,c:i,d:s,e:r,f:o}=n.getTransform();
212return[t,e,i,s,r,o]}function wo(n){const{a:t,b:e,c:i,d:s,e:r,f:o}=n.getTransform().invertSelf();return[t,e,i,s,r,o]}function hh(n,t,e=!1,i=!0){if(t instanceof Cy){const{pageWidth:s,pageHeight:r}=t.rawDims,{style:o}=n,a=es.isCSSRoundSupported,l=`var(--scale-factor) * ${s}px`,c=`var(--scale-factor) * ${r}px`,u=a?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,d=a?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!e||t.rotation%180===0?(o.width=u,o.height=d):(o.width=d,o.height=u)}i&&n.setAttribute("data-main-rotation",t.rotation)}class FC{constructor(){const t=window.devicePixelRatio||1;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}}var Nl,Lu,Lr,Fu,nw,iw,o1,I3,a1,P3,l1,M3,Of,h0,c1,O3,sw,BC;const va=class va{constructor(t){F(this,a1);F(this,l1);F(this,Of);F(this,c1);F(this,sw);F(this,Nl,null);F(this,Lu,null);F(this,Lr,void 0);F(this,Fu,null);F(this,nw,null);V(this,Lr,t),g(va,iw)||V(va,iw,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"}))}render(){const t=V(this,Nl,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=g(this,Lr)._uiManager._signal;t.addEventListener("contextmenu",lo,{signal:e}),t.addEventListener("pointerdown",W(va,o1,I3),{signal:e});const i=V(this,Fu,document.createElement("div"));i.className="buttons",t.append(i);const s=g(this,Lr).toolbarPosition;if(s){const{style:r}=t,o=g(this,Lr)._uiManager.direction==="ltr"?1-s[0]:s[0];r.insetInlineEnd=`${100*o}%`,r.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return W(this,c1,O3).call(this),t}get div(){return g(this,Nl)}hide(){var t;g(this,Nl).classList.add("hidden"),(t=g(this,Lu))==null||t.hideDropdown()}show(){var t;g(this,Nl).classList.remove("hidden"),(t=g(this,nw))==null||t.shown()}async addAltText(t){const e=await t.render();W(this,Of,h0).call(this,e),g(this,Fu).prepend(e,g(this,sw,BC)),V(this,nw,t)}addColorPicker(t){V(this,Lu,t);const e=t.renderButton();W(this,Of,h0).call(this,e),g(this,Fu).prepend(e,g(this,sw,BC))}remove(){var t;g(this,Nl).remove(),(t=g(this,Lu))==null||t.destroy(),V(this,Lu,null)}};Nl=new WeakMap,Lu=new WeakMap,Lr=new WeakMap,Fu=new WeakMap,nw=new WeakMap,iw=new WeakMap,o1=new WeakSet,I3=function(t){t.stopPropagation()},a1=new WeakSet,P3=function(t){g(this,Lr)._focusEventsAllowed=!1,$s(t)},l1=new WeakSet,M3=function(t){g(this,Lr)._focusEventsAllowed=!0,$s(t)},Of=new WeakSet,h0=function(t){const e=g(this,Lr)._uiManager._signal;t.addEventListener("focusin",W(this,a1,P3).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",W(this,l1,M3).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",lo,{signal:e})},c1=new WeakSet,O3=function(){const{editorType:t,_uiManager:e}=g(this,Lr),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",g(va,iw)[t]),W(this,Of,h0).call(this,i),i.addEventListener("click",s=>{e.delete()},{signal:e._signal}),g(this,Fu).append(i)},sw=new WeakSet,BC=function(){const t=document.createElement("div");return t.className="divider",t},F(va,o1),F(va,iw,null);let NC=va;var rw,Nu,Bu,u1,D3,d1,R3,h1,L3;class dae{constructor(t){F(this,u1);F(this,d1);F(this,h1);F(this,rw,null);F(this,Nu,null);F(this,Bu,void 0);V(this,Bu,t)}show(t,e,i){const[s,r]=W(this,d1,R3).call(this,e,i),{style:o}=g(this,Nu)||V(this,Nu,W(this,u1,D3).call(this));t.append(g(this,Nu)),o.insetInlineEnd=`${100*s}%`,o.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){g(this,Nu).remove()}}rw=new WeakMap,Nu=new WeakMap,Bu=new WeakMap,u1=new WeakSet,D3=function(){const t=V(this,Nu,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",lo,{signal:g(this,Bu)._signal});
212const e=V(this,rw,document.createElement("div"));return e.className="buttons",t.append(e),W(this,h1,L3).call(this),t},d1=new WeakSet,R3=function(t,e){let i=0,s=0;for(const r of t){const o=r.y+r.height;if(o<i)continue;const a=r.x+(e?r.width:0);if(o>i){s=a,i=o;continue}e?a>s&&(s=a):a<s&&(s=a)}return[e?1-s:s,i]},h1=new WeakSet,L3=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=g(this,Bu)._signal;t.addEventListener("contextmenu",lo,{signal:i}),t.addEventListener("click",()=>{g(this,Bu).highlightSelection("floating_button")},{signal:i}),g(this,rw).append(t)};function CE(n,t,e){for(const i of e)t.addEventListener(i,n[i].bind(n))}var f1;class hae{constructor(){F(this,f1,0)}get id(){return`${Goe}${Gi(this,f1)._++}`}}f1=new WeakMap;var Df,ow,Pi,Rf,f0;const AO=class AO{constructor(){F(this,Rf);F(this,Df,rae());F(this,ow,0);F(this,Pi,null)}static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),s=new Image;s.src=t;const r=s.decode().then(()=>(i.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return wt(this,"_isSVGFittingCanvas",r)}async getFromFile(t){const{lastModified:e,name:i,size:s,type:r}=t;return W(this,Rf,f0).call(this,`${e}_${i}_${s}_${r}`,t)}async getFromUrl(t){return W(this,Rf,f0).call(this,t,t)}async getFromBlob(t,e){const i=await e;return W(this,Rf,f0).call(this,t,i)}async getFromId(t){g(this,Pi)||V(this,Pi,new Map);const e=g(this,Pi).get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:i}=e;return delete e.blobPromise,this.getFromBlob(e.id,i)}return this.getFromUrl(e.url)}getFromCanvas(t,e){g(this,Pi)||V(this,Pi,new Map);let i=g(this,Pi).get(t);if(i!=null&&i.bitmap)return i.refCounter+=1,i;const s=new OffscreenCanvas(e.width,e.height);return s.getContext("2d").drawImage(e,0,0),i={bitmap:s.transferToImageBitmap(),id:`image_${g(this,Df)}_${Gi(this,ow)._++}`,refCounter:1,isSvg:!1},g(this,Pi).set(t,i),g(this,Pi).set(i.id,i),i}getSvgUrl(t){const e=g(this,Pi).get(t);return e!=null&&e.isSvg?e.svgUrl:null}deleteId(t){var s;g(this,Pi)||V(this,Pi,new Map);const e=g(this,Pi).get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:i}=e;if(!e.url&&!e.file){const r=new OffscreenCanvas(i.width,i.height);r.getContext("bitmaprenderer").transferFromImageBitmap(i),e.blobPromise=r.convertToBlob()}(s=i.close)==null||s.call(i),e.bitmap=null}isValidId(t){return t.startsWith(`image_${g(this,Df)}_`)}};Df=new WeakMap,ow=new WeakMap,Pi=new WeakMap,Rf=new WeakSet,f0=async function(t,e){g(this,Pi)||V(this,Pi,new Map);let i=g(this,Pi).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${g(this,Df)}_${Gi(this,ow)._++}`,refCounter:0,isSvg:!1});let s;if(typeof e=="string"?(i.url=e,s=await DT(e,"blob")):e instanceof File?s=i.file=e:e instanceof Blob&&(s=e),s.type==="image/svg+xml"){const r=AO._isSVGFittingCanvas,o=new FileReader,a=new Image,l=new Promise((c,u)=>{a.onload=()=>{i.bitmap=a,i.isSvg=!0,c()},o.onload=async()=>{const d=i.svgUrl=o.result;a.src=await r?`${d}#svgView(preserveAspectRatio(none))`:d},a.onerror=o.onerror=u});o.readAsDataURL(s),await l}else i.bitmap=await createImageBitmap(s);i.refCounter=1}catch(s){ht(s),i=null}return g(this,Pi).set(t,i),i&&g(this,Pi).set(i.id,i),i};let VC=AO;var Cn,Bl,aw,wn;class fae{constructor(t=128){F(this,Cn,[]);F(this,Bl,!1);F(this,aw,void 0);F(this,wn,-1);V(this,aw,t)}add({cmd:t,undo:e,post:i,mustExec:s,type:r=NaN,overwriteIfSameType:o=!1,keepUndo:a=!1}){if(s&&t(),g(this,Bl))return;const l={cmd:t,undo:e,post:i,type:r};if(g(this,wn)===-1){g(this,Cn).length>0&&(g(this,Cn).length=0),V(this,wn,0),g(this,Cn).push(l);return}if(o&&g(this,Cn)[g(this,wn)].type===r){a&&(l.undo=g(this,Cn)[g(this,wn)].undo),g(this,Cn)[g(this,wn)]=l;return}const c=g(this,wn)+1;c===g(this,aw)?g(this,Cn).splice(0,1):(V(this,wn,c),c<g(this,Cn).length&&g(this,Cn).splice(c)),g(this,Cn).push(l)}
212undo(){if(g(this,wn)===-1)return;V(this,Bl,!0);const{undo:t,post:e}=g(this,Cn)[g(this,wn)];t(),e==null||e(),V(this,Bl,!1),V(this,wn,g(this,wn)-1)}redo(){if(g(this,wn)<g(this,Cn).length-1){V(this,wn,g(this,wn)+1),V(this,Bl,!0);const{cmd:t,post:e}=g(this,Cn)[g(this,wn)];t(),e==null||e(),V(this,Bl,!1)}}hasSomethingToUndo(){return g(this,wn)!==-1}hasSomethingToRedo(){return g(this,wn)<g(this,Cn).length-1}cleanType(t){if(g(this,wn)!==-1){for(let e=g(this,wn);e>=0;e--)if(g(this,Cn)[e].type!==t){g(this,Cn).splice(e+1,g(this,wn)-e),V(this,wn,e);return}g(this,Cn).length=0,V(this,wn,-1)}}destroy(){V(this,Cn,null)}}Cn=new WeakMap,Bl=new WeakMap,aw=new WeakMap,wn=new WeakMap;var g1,F3;class ky{constructor(t){F(this,g1);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=es.platform;for(const[i,s,r={}]of t)for(const o of i){const a=o.startsWith("mac+");e&&a?(this.callbacks.set(o.slice(4),{callback:s,options:r}),this.allKeys.add(o.split("+").at(-1))):!e&&!a&&(this.callbacks.set(o,{callback:s,options:r}),this.allKeys.add(o.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(W(this,g1,F3).call(this,e));if(!i)return;const{callback:s,options:{bubbles:r=!1,args:o=[],checker:a=null}}=i;a&&!a(t,e)||(s.bind(t,...o,e)(),r||$s(e))}}g1=new WeakSet,F3=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const m1=class m1{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return uae(t),wt(this,"_colors",t)}convert(t){const e=hM(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,s]of this._colors)if(s.every((r,o)=>r===e[o]))return m1._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?ze.makeHexColor(...e):t}};y(m1,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let HC=m1;var Lf,ks,Yn,pi,Ff,xa,Nf,dr,Vl,Vu,Bf,Hu,ko,Fr,zu,lw,cw,Vf,uw,Io,Hl,Hf,zl,Po,p1,$l,dw,Wl,$u,hw,fw,ti,Ht,Aa,Wu,gw,mw,Ul,Mo,Ca,pw,hr,zf,g0,bw,zC,b1,N3,w1,B3,$f,m0,v1,V3,y1,H3,_1,z3,ww,$C,E1,$3,vw,WC,yw,UC,S1,W3,bi,qi,Nr,ga,T1,U3,x1,j3,_w,jC,A1,G3,Uu,Pp,Ew,GC;const mf=class mf{constructor(t,e,i,s,r,o,a,l,c,u,d,h,f){F(this,zf);F(this,bw);F(this,b1);F(this,w1);F(this,$f);F(this,v1);F(this,y1);F(this,_1);F(this,ww);F(this,E1);F(this,vw);F(this,yw);F(this,S1);F(this,bi);F(this,Nr);F(this,T1);F(this,x1);F(this,_w);F(this,A1);F(this,Uu);F(this,Ew);F(this,Lf,new AbortController);F(this,ks,null);F(this,Yn,new Map);F(this,pi,new Map);F(this,Ff,null);F(this,xa,null);F(this,Nf,null);F(this,dr,new fae);F(this,Vl,null);F(this,Vu,null);F(this,Bf,0);F(this,Hu,new Set);F(this,ko,null);F(this,Fr,null);F(this,zu,new Set);y(this,"_editorUndoBar",null);F(this,lw,!1);F(this,cw,!1);F(this,Vf,!1);F(this,uw,null);F(this,Io,null);F(this,Hl,null);F(this,Hf,null);F(this,zl,!1);F(this,Po,null);F(this,p1,new hae);F(this,$l,!1);F(this,dw,!1);F(this,Wl,null);F(this,$u,null);F(this,hw,null);F(this,fw,null);F(this,ti,ut.NONE);F(this,Ht,new Set);F(this,Aa,null);F(this,Wu,null);F(this,gw,null);F(this,mw,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});F(this,Ul,[0,0]);F(this,Mo,null);F(this,Ca,null);F(this,pw,null);F(this,hr,null);const p=this._signal=g(this,Lf).signal;V(this,Ca,t),V(this,pw,e),V(this,Ff,i),this._eventBus=s,s._on("editingaction",this.onEditingAction.bind(this),{signal:p}),s._on("pagechanging",this.onPageChanging.bind(this),{signal:p}),s._on("scalechanging",this.onScaleChanging.bind(this),{signal:p}),s._on("rotationchanging",this.onRotationChanging.bind(this),{signal:p}),s._on("setpreference",this.onSetPreference.bind(this),{signal:p}),s._on("switchannotationeditorparams",v=>this.updateParams(v.type,v.value),{signal:p}),W(this,v1,V3).call(this),W(this,S1,W3).call(this),W(this,ww,$C).call(this),V(this,xa,r.annotationStorage),V(this,uw,r.filterFactory),V(this,Wu,o),V(this,Hf,a||null),V(this,lw,l),V(this,cw,c),V(this,Vf,u),V(this,fw,d||null),this.viewParameters={realScale:Hc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=h||null,this._supportsPinchToZoom=f!==!1}static get _keyboardManager(){const t=mf.prototype,e=o=>g(o,Ca).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&o.hasSomethingToControl(),i=(o,{target:a})=>{if(a instanceof HTMLInputElement){const{type:l}=a;return l!=="text"&&l!=="number"}return!0},s=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return wt(this,"_keyboardManager",new ky([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(o,{target:a})=>!(a instanceof HTMLButtonElement)&&g(o,Ca).contains(a)&&!o.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(o,{target:a})=>!(a instanceof HTMLButtonElement)&&g(o,Ca).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}]]))}destroy(){var t,e,i,s,r;(t=g(this,hr))==null||t.resolve(),V(this,hr,null),(e=g(this,Lf))==null||e.abort(),V(this,Lf,null),this._signal=null;for(const o of g(this,pi).values())o.destroy();g(this,pi).clear(),g(this,Yn).clear(),g(this,zu).clear(),V(this,ks,null),g(this,Ht).clear(),g(this,dr).destroy(),(i=g(this,Ff))==null||i.destroy(),(s=g(this,Po))==null||s.hide(),V(this,Po,null),g(this,Io)&&(clearTimeout(g(this,Io)),V(this,Io,null)),g(this,Mo)&&(clearTimeout(g(this,Mo)),V(this,Mo,null)),(r=this._editorUndoBar)==null||r.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return g(this,fw)}get useNewAltTextFlow(){return g(this,cw)}get useNewAltTextWhenAddingImage(){return g(this,Vf)}get hcmFilter(){return wt(this,"hcmFilter",g(this,Wu)?g(this,uw).addHCMFilter(g(this,Wu).foreground,g(this,Wu).background):"none")}get direction(){return wt(this,"direction",getComputedStyle(g(this,Ca)).direction)}get highlightColors(){return wt(this,"highlightColors",g(this,Hf)?new Map(g(this,Hf).split(",").map(t=>t.split("=").map(e=>e.trim()))):null)}get highlightColorNames(){return wt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),V(this,Vu,t)}setMainHighlightColorPicker(t){V(this,hw,t)}editAltText(t,e=!1){var i;(i=g(this,Ff))==null||i.editAltText(this,t,e)}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){switch(t){case"enableNewAltTextWhenAddingImage":V(this,Vf,e);break}}onPageChanging({pageNumber:t}){V(this,Bf,t-1)}focusMainContainer(){g(this,Ca).focus()}findParent(t,e){for(const i of g(this,pi).values()){const{x:s,y:r,width:o,height:a}=i.div.getBoundingClientRect();if(t>=s&&t<=s+o&&e>=r&&e<=r+a)return i}return null}disableUserSelect(t=!1){g(this,pw).classList.toggle("noUserSelect",t)}addShouldRescale(t){g(this,zu).add(t)}removeShouldRescale(t){g(this,zu).delete(t)}onScaleChanging({scale:t}){var e;this.commitOrRemove(),this.viewParameters.realScale=t*Hc.PDF_TO_CSS_UNITS;for(const i of g(this,zu))i.onScaleChanging();(e=g(this,Vu))==null||e.onScaleChanging()}
212onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}=e,a=e.toString(),c=W(this,zf,g0).call(this,e).closest(".textLayer"),u=this.getSelectionBoxes(c);if(!u)return;e.empty();const d=W(this,bw,zC).call(this,c),h=g(this,ti)===ut.NONE,f=()=>{d==null||d.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:u,anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o,text:a}),h&&this.showAllEditors("highlight",!0,!0)};if(h){this.switchToMode(ut.HIGHLIGHT,f);return}f()}addToAnnotationStorage(t){!t.isEmpty()&&g(this,xa)&&!g(this,xa).has(t.id)&&g(this,xa).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,g(this,zl)&&(V(this,zl,!1),W(this,$f,m0).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of g(this,Ht))if(e.div.contains(t)){V(this,$u,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!g(this,$u))return;const[t,e]=g(this,$u);V(this,$u,null),e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}addEditListeners(){W(this,ww,$C).call(this),W(this,vw,WC).call(this)}removeEditListeners(){W(this,E1,$3).call(this),W(this,yw,UC).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of g(this,Fr))if(i.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const i of g(this,Fr))if(i.isHandlingMimeForPasting(e.type)){i.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){var i;if(t.preventDefault(),(i=g(this,ks))==null||i.commitOrRemove(),!this.hasSelection)return;const e=[];for(const s of g(this,Ht)){const r=s.serialize(!0);r&&e.push(r)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const r of e.items)for(const o of g(this,Fr))if(o.isHandlingMimeForPasting(r.type)){o.paste(r,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(r){ht(`paste: "${r.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();const s=this.currentLayer;try{const r=[];for(const l of i){const c=await s.deserialize(l);if(!c)return;r.push(c)}const o=()=>{for(const l of r)W(this,_w,jC).call(this,l);W(this,Ew,GC).call(this,r)},a=()=>{for(const l of r)l.remove()};this.addCommands({cmd:o,undo:a,mustExec:!0})}catch(r){ht(`paste: "${r.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),g(this,ti)!==ut.NONE&&!this.isEditorHandlingKeyboard&&mf._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,g(this,zl)&&(V(this,zl,!1),W(this,$f,m0).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(t){t?(W(this,y1,H3).call(this),W(this,vw,WC).call(this),W(this,bi,qi).call(this,{isEditing:g(this,ti)!==ut.NONE,isEmpty:W(this,Uu,Pp).call(this),hasSomethingToUndo:g(this,dr).hasSomethingToUndo(),hasSomethingToRedo:g(this,dr).hasSomethingToRedo(),hasSelectedEditor:!1})):(W(this,_1,z3).call(this),W(this,yw,UC).call(this),W(this,bi,qi).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!g(this,Fr)){V(this,Fr,t);for(const e of g(this,Fr))W(this,Nr,ga).call(this,e.defaultPropertiesToUpdate)}}getId(){return g(this,p1).id}get currentLayer(){return g(this,pi).get(g(this,Bf))}getLayer(t){return g(this,pi).get(t)}get currentPageIndex(){return g(this,Bf)}addLayer(t){g(this,pi).set(t.pageIndex,t),g(this,$l)?t.enable():t.disable()}removeLayer(t){g(this,pi).delete(t.pageIndex)}async updateMode(t,e=null,i=!1){var s;if(g(this,ti)!==t&&!(g(this,hr)&&(await g(this,hr).promise,!g(this,hr)))){if(V(this,hr,Promise.withResolvers()),V(this,ti,t),t===ut.NONE){this.setEditingState(!1),W(this,x1,j3).
212call(this),(s=this._editorUndoBar)==null||s.hide(),g(this,hr).resolve();return}this.setEditingState(!0),await W(this,T1,U3).call(this),this.unselectAll();for(const r of g(this,pi).values())r.updateMode(t);if(!e){i&&this.addNewEditorFromKeyboard(),g(this,hr).resolve();return}for(const r of g(this,Yn).values())r.annotationElementId===e?(this.setSelected(r),r.enterInEditMode()):r.unselect();g(this,hr).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==g(this,ti)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if(g(this,Fr)){switch(t){case xt.CREATE:this.currentLayer.addNewEditor();return;case xt.HIGHLIGHT_DEFAULT_COLOR:(i=g(this,hw))==null||i.updateColor(e);break;case xt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(g(this,gw)||V(this,gw,new Map)).set(t,e),this.showAllEditors("highlight",e);break}for(const s of g(this,Ht))s.updateParams(t,e);for(const s of g(this,Fr))s.updateDefaultParams(t,e)}}showAllEditors(t,e,i=!1){var r;for(const o of g(this,Yn).values())o.editorType===t&&o.show(e);(((r=g(this,gw))==null?void 0:r.get(xt.HIGHLIGHT_SHOW_ALL))??!0)!==e&&W(this,Nr,ga).call(this,[[xt.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(g(this,dw)!==t){V(this,dw,t);for(const e of g(this,pi).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of g(this,Yn).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return g(this,Yn).get(t)}addEditor(t){g(this,Yn).set(t.id,t)}removeEditor(t){var e;t.div.contains(document.activeElement)&&(g(this,Io)&&clearTimeout(g(this,Io)),V(this,Io,setTimeout(()=>{this.focusMainContainer(),V(this,Io,null)},0))),g(this,Yn).delete(t.id),this.unselect(t),(!t.annotationElementId||!g(this,Hu).has(t.annotationElementId))&&((e=g(this,xa))==null||e.remove(t.id))}addDeletedAnnotationElement(t){g(this,Hu).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return g(this,Hu).has(t)}removeDeletedAnnotationElement(t){g(this,Hu).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){g(this,ks)!==t&&(V(this,ks,t),t&&W(this,Nr,ga).call(this,t.propertiesToUpdate))}updateUI(t){g(this,A1,G3)===t&&W(this,Nr,ga).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){W(this,Nr,ga).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(g(this,Ht).has(t)){g(this,Ht).delete(t),t.unselect(),W(this,bi,qi).call(this,{hasSelectedEditor:this.hasSelection});return}g(this,Ht).add(t),t.select(),W(this,Nr,ga).call(this,t.propertiesToUpdate),W(this,bi,qi).call(this,{hasSelectedEditor:!0})}setSelected(t){var e;(e=g(this,Vu))==null||e.commitOrRemove();for(const i of g(this,Ht))i!==t&&i.unselect();g(this,Ht).clear(),g(this,Ht).add(t),t.select(),W(this,Nr,ga).call(this,t.propertiesToUpdate),W(this,bi,qi).call(this,{hasSelectedEditor:!0})}isSelected(t){return g(this,Ht).has(t)}get firstSelectedEditor(){return g(this,Ht).values().next().value}unselect(t){t.unselect(),g(this,Ht).delete(t),W(this,bi,qi).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return g(this,Ht).size!==0}get isEnterHandled(){return g(this,Ht).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;g(this,dr).undo(),W(this,bi,qi).call(this,{hasSomethingToUndo:g(this,dr).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:W(this,Uu,Pp).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){g(this,dr).redo(),W(this,bi,qi).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:g(this,dr).hasSomethingToRedo(),isEmpty:W(this,Uu,Pp).call(this)})}addCommands(t){g(this,dr).add(t),W(this,bi,qi).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:W(this,Uu,Pp).call(this)})}cleanUndoStack(t){g(this,dr).cleanType(t)}delete(){var r;this.commitOrRemove();const t=(r=this.currentLayer)==null?void 0:r.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...g(this,Ht)],i=()=>{var o;(o=this._editorUndoBar)==null||o.show(s,e.length===1?e[0].editorType:e.length);for(const a of e)a.remove()},s=()=>{for(const o of e)W(this,_w,jC).call(this,o)};this.addCommands({cmd:i,undo:s,mustExec:!0})}commitOrRemove(){var t;(t=g(this,ks))==null||t.commitOrRemove()}hasSomethingToControl(){return g(this,ks)||this.hasSelection}selectAll(){for(const t of g(this,Ht))t.commit();W(this,Ew,GC).call(this,g(this,Yn).values())}unselectAll(){var t;
212if(!(g(this,ks)&&(g(this,ks).commitOrRemove(),g(this,ti)!==ut.NONE))&&!((t=g(this,Vu))!=null&&t.commitOrRemove())&&this.hasSelection){for(const e of g(this,Ht))e.unselect();g(this,Ht).clear(),W(this,bi,qi).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e,i=!1){if(i||this.commitOrRemove(),!this.hasSelection)return;g(this,Ul)[0]+=t,g(this,Ul)[1]+=e;const[s,r]=g(this,Ul),o=[...g(this,Ht)],a=1e3;g(this,Mo)&&clearTimeout(g(this,Mo)),V(this,Mo,setTimeout(()=>{V(this,Mo,null),g(this,Ul)[0]=g(this,Ul)[1]=0,this.addCommands({cmd:()=>{for(const l of o)g(this,Yn).has(l.id)&&l.translateInPage(s,r)},undo:()=>{for(const l of o)g(this,Yn).has(l.id)&&l.translateInPage(-s,-r)},mustExec:!1})},a));for(const l of o)l.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),V(this,ko,new Map);for(const t of g(this,Ht))g(this,ko).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!g(this,ko))return!1;this.disableUserSelect(!1);const t=g(this,ko);V(this,ko,null);let e=!1;for(const[{x:s,y:r,pageIndex:o},a]of t)a.newX=s,a.newY=r,a.newPageIndex=o,e||(e=s!==a.savedX||r!==a.savedY||o!==a.savedPageIndex);if(!e)return!1;const i=(s,r,o,a)=>
212{if(g(this,Yn).has(s.id)){const l=g(this,pi).get(a);l?s._setParentAndPosition(l,r,o):(s.pageIndex=a,s.x=r,s.y=o)}};return this.addCommands({cmd:()=>{for(const[s,{newX:r,newY:o,newPageIndex:a}]of t)i(s,r,o,a)},undo:()=>{for(const[s,{savedX:r,savedY:o,savedPageIndex:a}]of t)i(s,r,o,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(g(this,ko))for(const i of g(this,ko).keys())i.drag(t,e)}rebuild(t){if(t.parent===null){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||g(this,Ht).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return g(this,ks)===t}getActive(){return g(this,ks)}getMode(){return g(this,ti)}get imageManager(){return wt(this,"imageManager",new VC)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let c=0,u=e.rangeCount;c<u;c++)if(!t.contains(e.getRangeAt(c).commonAncestorContainer))return null;const{x:i,y:s,width:r,height:o}=t.getBoundingClientRect();let a;switch(t.getAttribute("data-main-rotation")){case"90":a=(c,u,d,h)=>({x:(u-s)/o,y:1-(c+d-i)/r,width:h/o,height:d/r});break;case"180":a=(c,u,d,h)=>({x:1-(c+d-i)/r,y:1-(u+h-s)/o,width:d/r,height:h/o});break;case"270":a=(c,u,d,h)=>({x:1-(u+h-s)/o,y:(c-i)/r,width:h/o,height:d/r});break;default:a=(c,u,d,h)=>({x:(c-i)/r,y:(u-s)/o,width:d/r,height:h/o});break}const l=[];for(let c=0,u=e.rangeCount;c<u;c++){const d=e.getRangeAt(c);if(!d.collapsed)for(const{x:h,y:f,width:p,height:v}of d.getClientRects())p===0||v===0||l.push(a(h,f,p,v))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:e}){(g(this,Nf)||V(this,Nf,new Map)).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){var e;(e=g(this,Nf))==null||e.delete(t)}renderAnnotationElement(t){var s;const e=(s=g(this,Nf))==null?void 0:s.get(t.data.id);if(!e)return;const i=g(this,xa).getRawValue(e);i&&(g(this,ti)===ut.NONE&&!i.hasBeenModified||i.renderAnnotationElement(t))}};Lf=new WeakMap,ks=new WeakMap,Yn=new WeakMap,pi=new WeakMap,Ff=new WeakMap,xa=new WeakMap,Nf=new WeakMap,dr=new WeakMap,Vl=new WeakMap,Vu=new WeakMap,Bf=new WeakMap,Hu=new WeakMap,ko=new WeakMap,Fr=new WeakMap,zu=new WeakMap,lw=new WeakMap,cw=new WeakMap,Vf=new WeakMap,uw=new WeakMap,Io=new WeakMap,Hl=new WeakMap,Hf=new WeakMap,zl=new WeakMap,Po=new WeakMap,p1=new WeakMap,$l=new WeakMap,dw=new WeakMap,Wl=new WeakMap,$u=new WeakMap,hw=new WeakMap,fw=new WeakMap,ti=new WeakMap,Ht=new WeakMap,Aa=new WeakMap,Wu=new WeakMap,gw=new WeakMap,mw=new WeakMap,Ul=new WeakMap,Mo=new WeakMap,Ca=new WeakMap,pw=new WeakMap,hr=new WeakMap,zf=new WeakSet,g0=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},bw=new WeakSet,zC=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of g(this,pi).values())if(i.hasTextLayer(t))return i;return null},b1=new WeakSet,N3=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const i=W(this,zf,g0).call(this,t).closest(".textLayer"),s=this.getSelectionBoxes(i);s&&(g(this,Po)||V(this,Po,new dae(this)),g(this,Po).show(i,s,this.direction==="ltr"))},w1=new WeakSet,B3=function(){var r,o,a;const t=document.getSelection();if(!t||t.isCollapsed){g(this,Aa)&&((r=g(this,Po))==null||r.hide(),V(this,Aa,null),W(this,bi,qi).call(this,{hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===g(this,Aa))return;const s=W(this,zf,g0).call(this,t).closest(".textLayer");if(!s){g(this,Aa)&&((o=g(this,Po))==null||o.hide(),V(this,Aa,null),W(this,bi,qi).call(this,{hasSelectedText:!1}));return}if((a=g(this,Po))==null||a.hide(),V(this,Aa,e),W(this,bi,qi).call(this,{hasSelectedText:!0}),!(g(this,ti)!==ut.HIGHLIGHT&&g(this,ti)!==ut.NONE)&&(g(this,ti)===ut.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),V(this,zl,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=g(this,ti)===ut.HIGHLIGHT?W(this,bw,zC).call(this,s):null;l==null||l.toggleDrawing();const c=new AbortController,u=this.combinedSignal(c),d=h=>{h.type==="pointerup"&&h.button!==0||(c.abort(),l==null||l.toggleDrawing(!0),h.type==="pointerup"&&W(this,$f,m0).call(this,"main_toolbar"))};window.addEventListener("pointerup",d,{signal:u}),window.addEventListener("blur",d,{signal:u})}},$f=new WeakSet,m0=function(t=""){g(this,ti)===ut.HIGHLIGHT?this.highlightSelection(t):g(this,lw)&&W(this,b1,N3).call(this)},v1=new WeakSet,V3=function(){document.addEventListener("selectionchange",W(this,w1,B3).bind(this),{signal:this._signal})},y1=new WeakSet,H3=function(){if(g(this,Hl))return;V(this,Hl,new AbortController);const t=this.combinedSignal(g(this,Hl));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},_1=new WeakSet,z3=function(){var t;(t=g(this,Hl))==null||t.abort(),V(this,Hl,null)},ww=new WeakSet,$C=function(){if(g(this,Wl))return;V(this,Wl,new AbortController);const t=this.combinedSignal(g(this,Wl));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},E1=new WeakSet,$3=function(){var t;(t=g(this,Wl))==null||t.abort(),V(this,Wl,null)},vw=new WeakSet,WC=function(){if(g(this,Vl))return;V(this,Vl,new AbortController);const t=this.combinedSignal(g(this,Vl));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},yw=new WeakSet,UC=function(){var t;(t=g(this,Vl))==null||t.abort(),V(this,Vl,null)},S1=new WeakSet,W3=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},bi=new WeakSet,qi=function(t){Object.entries(t).some(([i,s])=>g(this,mw)[i]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(g(this,mw),t)}),g(this,ti)===ut.HIGHLIGHT&&t.hasSelectedEditor===!1&&W(this,Nr,ga).call(this,[[xt.HIGHLIGHT_FREE,!0]]))},Nr=new WeakSet,ga=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},T1=new WeakSet,U3=async function(){if(!g(this,$l)){V(this,$l,!0);const t=[];for(const e of g(this,pi).values())t.push(e.enable());await Promise.all(t);for(const e of g(this,Yn).values())e.enable()}},x1=new WeakSet,j3=function(){if(this.unselectAll(),g(this,$l)){V(this,$l,!1);for(const t of g(this,pi).values())t.disable();for(const t of g(this,Yn).values())t.disable()}},_w=new WeakSet,jC=function(t){const e=g(this,pi).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},A1=new WeakSet,G3=function(){let t=null;for(t of g(this,Ht));return t},Uu=new WeakSet,Pp=function(){if(g(this,Yn).size===0)return!0;
212if(g(this,Yn).size===1)for(const t of g(this,Yn).values())return t.isEmpty();return!1},Ew=new WeakSet,GC=function(t){for(const e of g(this,Ht))e.unselect();g(this,Ht).clear();for(const e of t)e.isEmpty()||(g(this,Ht).add(e),e.select());W(this,bi,qi).call(this,{hasSelectedEditor:this.hasSelection})},y(mf,"TRANSLATE_SMALL",1),y(mf,"TRANSLATE_BIG",10);let fh=mf;var ni,Oo,Br,Wf,Do,Is,Uf,Ro,ds,ka,ju,Lo,jl,Gu,Mp,jf,p0;const Ki=class Ki{constructor(t){F(this,Gu);F(this,jf);F(this,ni,null);F(this,Oo,!1);F(this,Br,null);F(this,Wf,null);F(this,Do,null);F(this,Is,null);F(this,Uf,!1);F(this,Ro,null);F(this,ds,null);F(this,ka,null);F(this,ju,null);F(this,Lo,!1);V(this,ds,t),V(this,Lo,t._uiManager.useNewAltTextFlow),g(Ki,jl)||V(Ki,jl,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){Ki._l10n??(Ki._l10n=t)}async render(){const t=V(this,Br,document.createElement("button"));t.className="altText",t.tabIndex="0";const e=V(this,Wf,document.createElement("span"));t.append(e),g(this,Lo)?(t.classList.add("new"),t.setAttribute("data-l10n-id",g(Ki,jl).missing),e.setAttribute("data-l10n-id",g(Ki,jl)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const i=g(this,ds)._uiManager._signal;t.addEventListener("contextmenu",lo,{signal:i}),t.addEventListener("pointerdown",r=>r.stopPropagation(),{signal:i});const s=r=>{r.preventDefault(),g(this,ds)._uiManager.editAltText(g(this,ds)),g(this,Lo)&&g(this,ds)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:g(this,Gu,Mp)}})};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",r=>{r.target===t&&r.key==="Enter"&&(V(this,Uf,!0),s(r))},{signal:i}),await W(this,jf,p0).call(this),t}finish(){g(this,Br)&&(g(this,Br).focus({focusVisible:g(this,Uf)}),V(this,Uf,!1))}isEmpty(){return g(this,Lo)?g(this,ni)===null:!g(this,ni)&&!g(this,Oo)}hasData(){return g(this,Lo)?g(this,ni)!==null||!!g(this,ka):this.isEmpty()}get guessedText(){return g(this,ka)}async setGuessedText(t){g(this,ni)===null&&(V(this,ka,t),V(this,ju,await Ki._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),W(this,jf,p0).call(this))}toggleAltTextBadge(t=!1){var e;if(!g(this,Lo)||g(this,ni)){(e=g(this,Ro))==null||e.remove(),V(this,Ro,null);return}if(!g(this,Ro)){const i=V(this,Ro,document.createElement("div"));i.className="noAltTextBadge",g(this,ds).div.append(i)}g(this,Ro).classList.toggle("hidden",!t)}serialize(t){let e=g(this,ni);return!t&&g(this,ka)===e&&(e=g(this,ju)),{altText:e,decorative:g(this,Oo),guessedText:g(this,ka),textWithDisclaimer:g(this,ju)}}get data(){return{altText:g(this,ni),decorative:g(this,Oo)}}set data({altText:t,decorative:e,guessedText:i,textWithDisclaimer:s,cancel:r=!1}){i&&(V(this,ka,i),V(this,ju,s)),!(g(this,ni)===t&&g(this,Oo)===e)&&(r||(V(this,ni,t),V(this,Oo,e)),W(this,jf,p0).call(this))}toggle(t=!1){g(this,Br)&&(!t&&g(this,Is)&&(clearTimeout(g(this,Is)),V(this,Is,null)),g(this,Br).disabled=!t)}shown(){g(this,ds)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:g(this,Gu,Mp)}})}destroy(){var t,e;(t=g(this,Br))==null||t.remove(),V(this,Br,null),V(this,Wf,null),V(this,Do,null),(e=g(this,Ro))==null||e.remove(),V(this,Ro,null)}};ni=new WeakMap,Oo=new WeakMap,Br=new WeakMap,Wf=new WeakMap,Do=new WeakMap,Is=new WeakMap,Uf=new WeakMap,Ro=new WeakMap,ds=new WeakMap,ka=new WeakMap,ju=new WeakMap,Lo=new WeakMap,jl=new WeakMap,Gu=new WeakSet,Mp=function(){return g(this,ni)&&"added"||g(this,ni)===null&&this.guessedText&&"review"||"missing"},jf=new WeakSet,p0=async function(){var s,r,o;const t=g(this,Br);if(!t)return;if(g(this,Lo)){if(t.classList.toggle("done",!!g(this,ni)),t.setAttribute("data-l10n-id",g(Ki,jl)[g(this,Gu,Mp)]),(s=g(this,Wf))==null||s.setAttribute("data-l10n-id",g(Ki,jl)[`${g(this,Gu,Mp)}-label`]),!g(this,ni)){(r=g(this,Do))==null||r.remove();return}}else{if(!g(this,ni)&&!g(this,Oo)){t.classList.remove("done"),(o=g(this,Do))==null||o.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=g(this,Do);if(!e){V(this,Do,e=document.createElement("span")),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${g(this,ds).id}`;const a=100,l=g(this,ds)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(g(this,Is)),V(this,Is,null)},{once:!0}),t.addEventListener("mouseenter",()=>{V(this,Is,setTimeout(()=>{V(this,Is,null),g(this,Do).classList.add("show"),g(this,ds)._reportTelemetry({action:"alt_text_tooltip"})},a))},{signal:l}),t.addEventListener("mouseleave",()=>{var c;g(this,Is)&&(clearTimeout(g(this,Is)),V(this,Is,null)),(c=g(this,Do))==null||c.classList.remove("show")},{signal:l})}g(this,Oo)?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=g(this,ni)),e.parentNode||t.append(e);const i=g(this,ds).getImageForAltText();i==null||i.setAttribute("aria-describedby",e.id)},F(Ki,jl,null),y(Ki,"_l10n",null);let kE=Ki;var Sw,Yu,Tw,xw,Aw,Cw,kw,Gf,Ia,qu,Gl,C1,Y3,k1,q3,Iw,YC;const CO=class CO{constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:i=null,onPinchStart:s=null,onPinching:r=null,onPinchEnd:o=null,signal:a}){F(this,C1);F(this,k1);F(this,Iw);F(this,Sw,void 0);F(this,Yu,!1);F(this,Tw,null);F(this,xw,void 0);F(this,Aw,void 0);F(this,Cw,void 0);F(this,kw,void 0);F(this,Gf,void 0);F(this,Ia,null);F(this,qu,void 0);F(this,Gl,null);V(this,Sw,t),V(this,Tw,i),V(this,xw,e),V(this,Aw,s),V(this,Cw,r),V(this,kw,o),V(this,qu,new AbortController),V(this,Gf,AbortSignal.any([a,g(this,qu).signal])),t.addEventListener("touchstart",W(this,C1,Y3).bind(this),{passive:!1,signal:g(this,Gf)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return wt(this,"MIN_TOUCH_DISTANCE_TO_PINCH",35/(window.devicePixelRatio||1))}destroy(){var t;(t=g(this,qu))==null||t.abort(),V(this,qu,null)}};Sw=new WeakMap,Yu=new WeakMap,Tw=new WeakMap,xw=new WeakMap,Aw=new WeakMap,Cw=new WeakMap,kw=new WeakMap,Gf=new WeakMap,Ia=new WeakMap,qu=new WeakMap,Gl=new WeakMap,C1=new WeakSet,Y3=function(t){var s,r,o;
212if((s=g(this,xw))!=null&&s.call(this)||t.touches.length<2)return;if(!g(this,Gl)){V(this,Gl,new AbortController);const a=AbortSignal.any([g(this,Gf),g(this,Gl).signal]),l=g(this,Sw),c={signal:a,passive:!1};l.addEventListener("touchmove",W(this,k1,q3).bind(this),c),l.addEventListener("touchend",W(this,Iw,YC).bind(this),c),l.addEventListener("touchcancel",W(this,Iw,YC).bind(this),c),(r=g(this,Aw))==null||r.call(this)}if($s(t),t.touches.length!==2||(o=g(this,Tw))!=null&&o.call(this)){V(this,Ia,null);return}let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]),V(this,Ia,{touch0X:e.screenX,touch0Y:e.screenY,touch1X:i.screenX,touch1Y:i.screenY})},k1=new WeakSet,q3=function(t){var I;if(!g(this,Ia)||t.touches.length!==2)return;let[e,i]=t.touches;e.identifier>i.identifier&&([e,i]=[i,e]);const{screenX:s,screenY:r}=e,{screenX:o,screenY:a}=i,l=g(this,Ia),{touch0X:c,touch0Y:u,touch1X:d,touch1Y:h}=l,f=d-c,p=h-u,v=o-s,E=a-r,x=Math.hypot(v,E)||1,A=Math.hypot(f,p)||1;if(!g(this,Yu)&&Math.abs(A-x)<=CO.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=r,l.touch1X=o,l.touch1Y=a,t.preventDefault(),!g(this,Yu)){V(this,Yu,!0);return}const O=[(s+o)/2,(r+a)/2];(I=g(this,Cw))==null||I.call(this,O,A,x)},Iw=new WeakSet,YC=function(t){var e;g(this,Gl).abort(),V(this,Gl,null),(e=g(this,kw))==null||e.call(this),g(this,Ia)&&(t.preventDefault(),V(this,Ia,null),V(this,Yu,!1))};let IE=CO;var Ku,Vr,sn,Yf,Yl,Pw,Xu,wi,Ju,Pa,ql,Mw,Zu,Ps,Ow,Qu,Ma,Fo,qf,Kf,fr,ed,Dw,I1,Rw,qC,Lw,KC,Xf,b0,P1,K3,M1,X3,Fw,XC,Jf,w0,Nw,JC,O1,J3,D1,Z3,R1,Q3,Bw,ZC,L1,ez,Vw,QC,F1,tz,N1,nz,B1,iz,Hw,ek,td,Op;const mt=class mt{constructor(t){F(this,Rw);F(this,Xf);F(this,P1);F(this,M1);F(this,Fw);F(this,Jf);F(this,Nw);F(this,O1);F(this,D1);F(this,R1);F(this,Bw);F(this,L1);F(this,Vw);F(this,F1);F(this,N1);F(this,B1);F(this,Hw);F(this,td);F(this,Ku,null);F(this,Vr,null);F(this,sn,null);F(this,Yf,!1);F(this,Yl,null);F(this,Pw,"");F(this,Xu,!1);F(this,wi,null);F(this,Ju,null);F(this,Pa,null);F(this,ql,null);F(this,Mw,"");F(this,Zu,!1);F(this,Ps,null);F(this,Ow,!1);F(this,Qu,!1);F(this,Ma,!1);F(this,Fo,null);F(this,qf,0);F(this,Kf,0);F(this,fr,null);F(this,ed,null);y(this,"_editToolbar",null);y(this,"_initialOptions",Object.create(null));y(this,"_initialData",null);y(this,"_isVisible",!0);y(this,"_uiManager",null);y(this,"_focusEventsAllowed",!0);F(this,Dw,!1);F(this,I1,mt._zIndex++);this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:s,pageX:r,pageY:o}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,s],this.pageTranslation=[r,o];const[a,l]=this.parentDimensions;this.x=t.x/a,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=mt.prototype._resizeWithKeyboard,e=fh.TRANSLATE_SMALL,i=fh.TRANSLATE_BIG;return wt(this,"_resizerKeyboardManager",new ky([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],mt.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return wt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new gae({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(mt._l10n??(mt._l10n=t),mt._l10nResizer||(mt._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),mt._borderLineWidth!==-1)return;const i=getComputedStyle(document.documentElement);mt._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Xt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return g(this,Dw)}set _isDraggable(t){var e;V(this,Dw,t),(e=this.div)==null||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}
212setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=g(this,I1)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):W(this,td,Op).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(g(this,Zu)?V(this,Zu,!1):this.parent.setSelected(this))}focusout(t){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const e=t.relatedTarget;e!=null&&e.closest(`#${this.id}`)||(t.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,s){const[r,o]=this.parentDimensions;[i,s]=this.screenToPageTranslation(i,s),this.x=(t+i)/r,this.y=(e+s)/o,this.fixAndSetPosition()}translate(t,e){W(this,Rw,qC).call(this,this.parentDimensions,t,e)}translateInPage(t,e){g(this,Ps)||V(this,Ps,[this.x,this.y,this.width,this.height]),W(this,Rw,qC).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){g(this,Ps)||V(this,Ps,[this.x,this.y,this.width,this.height]);const{div:i,parentDimensions:[s,r]}=this;if(this.x+=t/s,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:d,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,d,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:o,y:a}=this;const[l,c]=this.getBaseTranslation();o+=l,a+=c;const{style:u}=i;u.left=`${(100*o).toFixed(2)}%`,u.top=`${(100*a).toFixed(2)}%`,this._onTranslating(o,a),i.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!g(this,Ps)&&(g(this,Ps)[0]!==this.x||g(this,Ps)[1]!==this.y)}get _hasBeenResized(){return!!g(this,Ps)&&(g(this,Ps)[2]!==this.width||g(this,Ps)[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=mt,s=i/t,r=i/e;switch(this.rotation){case 90:return[-s,r];case 180:return[s,r];case 270:return[s,-r];default:return[-s,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[i,s]}=this;let{x:r,y:o,width:a,height:l}=this;if(a*=i,l*=s,r*=i,o*=s,this._mustFixPosition)switch(t){case 0:r=Math.max(0,Math.min(i-a,r)),o=Math.max(0,Math.min(s-l,o));break;case 90:r=Math.max(0,Math.min(i-l,r)),o=Math.min(s,Math.max(a,o));break;case 180:r=Math.min(i,Math.max(a,r)),o=Math.min(s,Math.max(l,o));break;case 270:r=Math.min(i,Math.max(l,r)),o=Math.max(0,Math.min(s-a,o));break}this.x=r/=i,this.y=o/=s;const[c,u]=this.getBaseTranslation();r+=c,o+=u,e.left=`${(100*r).toFixed(2)}%`,e.top=`${(100*o).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,e){var i;return W(i=mt,Lw,KC).call(i,t,e,this.parentRotation)}pageTranslationToScreen(t,e){var i;return W(i=mt,Lw,KC).call(i,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this;return[e*t,i*t]}setDims(t,e){const[i,s]=this.parentDimensions,{style:r}=this.div;r.width=`${(100*t/i).toFixed(2)}%`,g(this,Xu)||(r.height=`${(100*e/s).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,s=i.endsWith("%"),r=!g(this,Xu)&&e.endsWith("%");if(s&&r)return;const[o,a]=this.parentDimensions;s||(t.width=`${(100*parseFloat(i)/o).toFixed(2)}%`),!g(this,Xu)&&!r&&(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=g(this,sn))==null||t.finish()}async addEditToolbar(){return this._editToolbar||g(this,Qu)?this._editToolbar:(this._editToolbar=new NC(this),this.div.append(this._editToolbar.render()),g(this,sn)&&await this._editToolbar.addAltText(g(this,sn)),this._editToolbar)}removeEditToolbar(){var t;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(t=g(this,sn))==null||t.destroy())}addContainer(t){var i;const e=(i=this._editToolbar)==null?void 0:i.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){g(this,sn)||(kE.initialize(mt._l10n),V(this,sn,new kE(this)),g(this,Ku)&&(g(this,sn).data=g(this,Ku),V(this,Ku,null)),await this.addEditToolbar())}get altTextData(){var t;return(t=g(this,sn))==null?void 0:t.data}set altTextData(t){g(this,sn)&&(g(this,sn).data=t)}get guessedAltText(){var t;return(t=g(this,sn))==null?void 0:t.guessedText}async setGuessedAltText(t){var e;await((e=g(this,sn))==null?void 0:e.setGuessedText(t))}serializeAltText(t){var e;return(e=g(this,sn))==null?void 0:e.serialize(t)}hasAltText(){return!!g(this,sn)&&!g(this,sn).isEmpty()}hasAltTextData(){var t;return((t=g(this,sn))==null?void 0:t.hasData())??!1}render(){var r;this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=g(this,Yf)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),W(this,Vw,QC).call(this);const[t,e]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);const[i,s]=this.getInitialTranslation();return this.translate(i,s),CE(this,this.div,["pointerdown"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(g(this,ed)||V(this,ed,new IE({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:W(this,O1,J3).bind(this),onPinching:W(this,D1,Z3).bind(this),onPinchEnd:W(this,R1,Q3).bind(this),signal:this._uiManager._signal}))),(r=this._uiManager._editorUndoBar)==null||r.hide(),this.div}pointerdown(t){const{isMac:e}=es.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}
212if(V(this,Zu,!0),this._isDraggable){W(this,L1,ez).call(this,t);return}W(this,Bw,ZC).call(this,t)}get isSelected(){return this._uiManager.isSelected(this)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){g(this,Fo)&&clearTimeout(g(this,Fo)),V(this,Fo,setTimeout(()=>{var t;V(this,Fo,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,i=this.rotation){const s=this.parentScale,[r,o]=this.pageDimensions,[a,l]=this.pageTranslation,c=t/s,u=e/s,d=this.x*r,h=this.y*o,f=this.width*r,p=this.height*o;switch(i){case 0:return[d+c+a,o-h-u-p+l,d+c+f+a,o-h-u+l];case 90:return[d+u+a,o-h+c+l,d+u+p+a,o-h+c+f+l];case 180:return[d-c-f+a,o-h+u+l,d-c+a,o-h+u+p+l];case 270:return[d-u-p+a,o-h-c-f+l,d-u+a,o-h-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,s,r,o]=t,a=r-i,l=o-s;switch(this.rotation){case 0:return[i,e-o,a,l];case 90:return[i,e-s,l,a];case 180:return[r,e-s,a,l];case 270:return[r,e-o,l,a];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){V(this,Qu,!0)}disableEditMode(){V(this,Qu,!1)}isInEditMode(){return g(this,Qu)}shouldGetKeyboardEvents(){return g(this,Ma)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:i,right:s}=this.getClientDimensions(),{innerHeight:r,innerWidth:o}=window;return e<o&&s>0&&t<r&&i>0}rebuild(){W(this,Vw,QC).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((t=this._initialData)==null?void 0:t.popupRef)||""}}serialize(t=!1,e=null){Xt("An editor must be serializable")}static async deserialize(t,e,i){const s=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});s.rotation=t.rotation,V(s,Ku,t.accessibilityData);const[r,o]=s.pageDimensions,[a,l,c,u]=s.getRectInCurrentCoords(t.rect,o);return s.x=a/r,s.y=l/o,s.width=c/r,s.height=u/o,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,e;if((t=g(this,ql))==null||t.abort(),V(this,ql,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),g(this,Fo)&&(clearTimeout(g(this,Fo)),V(this,Fo,null)),W(this,td,Op).call(this),this.removeEditToolbar(),g(this,fr)){for(const i of g(this,fr).values())clearTimeout(i);V(this,fr,null)}this.parent=null,(e=g(this,ed))==null||e.destroy(),V(this,ed,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(W(this,P1,K3).call(this),g(this,wi).classList.remove("hidden"),CE(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),V(this,Pa,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=g(this,wi).children;if(!g(this,Vr)){V(this,Vr,Array.from(e));const o=W(this,F1,tz).bind(this),a=W(this,N1,nz).bind(this),l=this._uiManager._signal;for(const c of g(this,Vr)){const u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",o,{signal:l}),c.addEventListener("blur",a,{signal:l}),c.addEventListener("focus",W(this,B1,iz).bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",mt._l10nResizer[u])}}const i=g(this,Vr)[0];let s=0;for(const o of e){if(o===i)break;s++}const r=(360-this.rotation+this.parentRotation)%360/90*(g(this,Vr).length/4);if(r!==s){if(r<s)for(let a=0;a<s-r;a++)g(this,wi).append(g(this,wi).firstChild);else if(r>s)for(let a=0;a<r-s;a++)g(this,wi).firstChild.before(g(this,wi).lastChild);let o=0;for(const a of e){const c=g(this,Vr)[o++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",mt._l10nResizer[c])}}W(this,Hw,ek).call(this,0),V(this,Ma,!0),g(this,wi).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){g(this,Ma)&&W(this,Nw,JC).call(this,g(this,Mw),{deltaX:t,deltaY:e,fromKeyboard:!0})}_stopResizingWithKeyboard(){W(this,td,Op).call(this),this.div.focus()}select(){var t,e,i;if(this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var s,r;(s=this.div)!=null&&s.classList.contains("selectedEditor")&&((r=this._editToolbar)==null||r.show())});return}(e=this._editToolbar)==null||e.show(),(i=g(this,sn))==null||i.toggleAltTextBadge(!1)}unselect(){var t,e,i,s,r;(t=g(this,wi))==null||t.classList.add("hidden"),(e=this.div)==null||e.classList.remove("selectedEditor"),(i=this.div)!=null&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(s=this._editToolbar)==null||s.hide(),(r=g(this,sn))==null||r.toggleAltTextBadge(!0)}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return g(this,Ow)}set isEditing(t){V(this,Ow,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){V(this,Xu,!0);const i=t/e,{style:s}=this.div;s.aspectRatio=i,s.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){g(this,fr)||V(this,fr,new Map);const{action:i}=t;let s=g(this,fr).get(i);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(t),g(this,fr).delete(i),g(this,fr).size===0&&V(this,fr,null)},mt._telemetryTimeout),g(this,fr).set(i,s);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}
212show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),V(this,Yf,!1)}disable(){this.div&&(this.div.tabIndex=-1),V(this,Yf,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){const i=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),i.before(e)}return e}resetAnnotationElement(t){const{firstChild:e}=t.container;(e==null?void 0:e.nodeName)==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}};Ku=new WeakMap,Vr=new WeakMap,sn=new WeakMap,Yf=new WeakMap,Yl=new WeakMap,Pw=new WeakMap,Xu=new WeakMap,wi=new WeakMap,Ju=new WeakMap,Pa=new WeakMap,ql=new WeakMap,Mw=new WeakMap,Zu=new WeakMap,Ps=new WeakMap,Ow=new WeakMap,Qu=new WeakMap,Ma=new WeakMap,Fo=new WeakMap,qf=new WeakMap,Kf=new WeakMap,fr=new WeakMap,ed=new WeakMap,Dw=new WeakMap,I1=new WeakMap,Rw=new WeakSet,qC=function([t,e],i,s){[i,s]=this.screenToPageTranslation(i,s),this.x+=i/t,this.y+=s/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Lw=new WeakSet,KC=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},Xf=new WeakSet,b0=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},P1=new WeakSet,K3=function(){if(g(this,wi))return;V(this,wi,document.createElement("div")),g(this,wi).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const s=document.createElement("div");g(this,wi).append(s),s.classList.add("resizer",i),s.setAttribute("data-resizer-name",i),s.addEventListener("pointerdown",W(this,M1,X3).bind(this,i),{signal:e}),s.addEventListener("contextmenu",lo,{signal:e}),s.tabIndex=-1}this.div.prepend(g(this,wi))},M1=new WeakSet,X3=function(t,e){var u;e.preventDefault();const{isMac:i}=es.platform;if(e.button!==0||e.ctrlKey&&i)return;(u=g(this,sn))==null||u.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,V(this,Ju,[e.screenX,e.screenY]);const r=new AbortController,o=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",W(this,Nw,JC).bind(this,t),{passive:!0,capture:!0,signal:o}),window.addEventListener("touchmove",$s,{passive:!1,signal:o}),window.addEventListener("contextmenu",lo,{signal:o}),V(this,Pa,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const a=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const c=()=>{var d;r.abort(),this.parent.togglePointerEvents(!0),(d=g(this,sn))==null||d.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=a,this.div.style.cursor=l,W(this,Jf,w0).call(this)};window.addEventListener("pointerup",c,{signal:o}),window.addEventListener("blur",c,{signal:o})},Fw=new WeakSet,XC=function(t,e,i,s){this.width=i,this.height=s,this.x=t,this.y=e;const[r,o]=this.parentDimensions;this.setDims(r*i,o*s),this.fixAndSetPosition(),this._onResized()},Jf=new WeakSet,w0=function(){if(!g(this,Pa))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:s}=g(this,Pa);V(this,Pa,null);const r=this.x,o=this.y,a=this.width,l=this.height;r===t&&o===e&&a===i&&l===s||this.addCommands({cmd:W(this,Fw,XC).bind(this,r,o,a,l),undo:W(this,Fw,XC).bind(this,t,e,i,s),mustExec:!0})},Nw=new WeakSet,JC=function(t,e){const[i,s]=this.parentDimensions,r=this.x,o=this.y,a=this.width,l=this.height,c=mt.MIN_SIZE/i,u=mt.MIN_SIZE/s,d=W(this,Xf,b0).call(this,this.rotation),h=(_,C)=>[d[0]*_+d[2]*C,d[1]*_+d[3]*C],f=W(this,Xf,b0).call(this,360-this.rotation),p=(_,C)=>[f[0]*_+f[2]*C,f[1]*_+f[3]*C];let v,E,x=!1,A=!1;switch(t){case"topLeft":x=!0,v=(_,C)=>[0,0],E=(_,C)=>[_,C];break;case"topMiddle":v=(_,C)=>[_/2,0],E=(_,C)=>[_/2,C];break;case"topRight":x=!0,v=(_,C)=>[_,0],E=(_,C)=>[0,C];break;case"middleRight":A=!0,v=(_,C)=>[_,C/2],E=(_,C)=>[0,C/2];break;case"bottomRight":x=!0,v=(_,C)=>[_,C],E=(_,C)=>[0,0];break;case"bottomMiddle":v=(_,C)=>[_/2,C],E=(_,C)=>[_/2,0];break;case"bottomLeft":x=!0,v=(_,C)=>[0,C],E=(_,C)=>[_,0];break;case"middleLeft":A=!0,v=(_,C)=>[0,C/2],E=(_,C)=>[_,C/2];break}const O=v(a,l),I=E(a,l);let T=h(...I);const P=mt._round(r+T[0]),k=mt._round(o+T[1]);let D=1,U=1,Y,K;if(e.fromKeyboard)({deltaX:Y,deltaY:K}=e);else{const{screenX:_,screenY:C}=e,[B,$]=g(this,Ju);[Y,K]=this.screenToPageTranslation(_-B,C-$),g(this,Ju)[0]=_,g(this,Ju)[1]=C}if([Y,K]=p(Y/i,K/s),x){const _=Math.hypot(a,l);D=U=Math.max(Math.min(Math.hypot(I[0]-O[0]-Y,I[1]-O[1]-K)/_,1/a,1/l),c/a,u/l)}else A?D=Math.max(c,Math.min(1,Math.abs(I[0]-O[0]-Y)))/a:U=Math.max(u,Math.min(1,Math.abs(I[1]-O[1]-K)))/l;const j=mt._round(a*D),L=mt._round(l*U);T=h(...E(j,L));const N=P-T[0],m=k-T[1];g(this,Ps)||V(this,Ps,[this.x,this.y,this.width,this.height]),this.width=j,this.height=L,this.x=N,this.y=m,this.setDims(i*j,s*L),this.fixAndSetPosition(),this._onResizing()},O1=new WeakSet,J3=function(){var t;V(this,Pa,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=g(this,sn))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)}
212,D1=new WeakSet,Z3=function(t,e,i){let r=.7*(i/e)+1-.7;if(r===1)return;const o=W(this,Xf,b0).call(this,this.rotation),a=(P,k)=>[o[0]*P+o[2]*k,o[1]*P+o[3]*k],[l,c]=this.parentDimensions,u=this.x,d=this.y,h=this.width,f=this.height,p=mt.MIN_SIZE/l,v=mt.MIN_SIZE/c;r=Math.max(Math.min(r,1/h,1/f),p/h,v/f);const E=mt._round(h*r),x=mt._round(f*r);if(E===h&&x===f)return;g(this,Ps)||V(this,Ps,[u,d,h,f]);const A=a(h/2,f/2),O=mt._round(u+A[0]),I=mt._round(d+A[1]),T=a(E/2,x/2);this.x=O-T[0],this.y=I-T[1],this.width=E,this.height=x,this.setDims(l*E,c*x),this.fixAndSetPosition(),this._onResizing()},R1=new WeakSet,Q3=function(){var t;(t=g(this,sn))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),W(this,Jf,w0).call(this)},Bw=new WeakSet,ZC=function(t){const{isMac:e}=es.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},L1=new WeakSet,ez=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const s=new AbortController,r=this._uiManager.combinedSignal(s),o={capture:!0,passive:!1,signal:r},a=c=>{s.abort(),V(this,Yl,null),V(this,Zu,!1),this._uiManager.endDragSession()||W(this,Bw,ZC).call(this,c),i&&this._onStopDragging()};e&&(V(this,qf,t.clientX),V(this,Kf,t.clientY),V(this,Yl,t.pointerId),V(this,Pw,t.pointerType),window.addEventListener("pointermove",c=>{i||(i=!0,this._onStartDragging());const{clientX:u,clientY:d,pointerId:h}=c;if(h!==g(this,Yl)){$s(c);return}const[f,p]=this.screenToPageTranslation(u-g(this,qf),d-g(this,Kf));V(this,qf,u),V(this,Kf,d),this._uiManager.dragSelectedEditors(f,p)},o),window.addEventListener("touchmove",$s,o),window.addEventListener("pointerdown",c=>{c.pointerType===g(this,Pw)&&(g(this,ed)||c.isPrimary)&&a(c),$s(c)},o));const l=c=>{if(!g(this,Yl)||g(this,Yl)===c.pointerId){a(c);return}$s(c)};window.addEventListener("pointerup",l,{signal:r}),window.addEventListener("blur",l,{signal:r})},Vw=new WeakSet,QC=function(){if(g(this,ql)||!this.div)return;V(this,ql,new AbortController);const t=this._uiManager.combinedSignal(g(this,ql));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},F1=new WeakSet,tz=function(t){mt._resizerKeyboardManager.exec(this,t)},N1=new WeakSet,nz=function(t){var e;g(this,Ma)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==g(this,wi)&&W(this,td,Op).call(this)},B1=new WeakSet,iz=function(t){V(this,Mw,g(this,Ma)?t:"")},Hw=new WeakSet,ek=function(t){if(g(this,Vr))for(const e of g(this,Vr))e.tabIndex=t},td=new WeakSet,Op=function(){V(this,Ma,!1),W(this,Hw,ek).call(this,-1),W(this,Jf,w0).call(this)},F(mt,Lw),y(mt,"_l10n",null),y(mt,"_l10nResizer",null),y(mt,"_borderLineWidth",-1),y(mt,"_colorManager",new HC),y(mt,"_zIndex",1),y(mt,"_telemetryTimeout",1e3);let yn=mt;class gae extends yn{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const J2=3285377520,lr=4294901760,vo=65535;class sz{constructor(t){this.h1=t?t&4294967295:J2,this.h2=t?t&4294967295:J2}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let v=0,E=t.length;v<E;v++){const x=t.charCodeAt(v);x<=255?e[i++]=x:(e[i++]=x>>>8,e[i++]=x&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const s=i>>2,r=i-s*4,o=new Uint32Array(e.buffer,0,s);let a=0,l=0,c=this.h1,u=this.h2;const d=3432918353,h=461845907,f=d&vo,p=h&vo;for(let v=0;v<s;v++)v&1?(a=o[v],a=a*d&lr|a*f&vo,a=a<<15|a>>>17,a=a*h&lr|a*p&vo,c^=a,c=c<<13|c>>>19,c=c*5+3864292196):(l=o[v],l=l*d&lr|l*f&vo,l=l<<15|l>>>17,l=l*h&lr|l*p&vo,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(a=0,r){case 3:a^=e[s*4+2]<<16;case 2:a^=e[s*4+1]<<8;case 1:a^=e[s*4],a=a*d&lr|a*f&vo,a=a<<15|a>>>17,a=a*h&lr|a*p&vo,s&1?c^=a:u^=a}this.h1=c,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&lr|t*36045&vo,e=e*4283543511&lr|((e<<16|t>>>16)*2950163797&lr)>>>16,t^=e>>>1,t=t*444984403&lr|t*60499&vo,e=e*3301882366&lr|((e<<16|t>>>16)*3120437893&lr)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const tk=Object.freeze({map:null,hash:"",transfer:void 0});var nd,id,ii,V1,rz;class fM{constructor(){F(this,V1);F(this,nd,!1);F(this,id,null);F(this,ii,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=g(this,ii).get(t);return i===void 0?e:Object.assign(e,i)}getRawValue(t){return g(this,ii).get(t)}remove(t){if(g(this,ii).delete(t),g(this,ii).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const e of g(this,ii).values())if(e instanceof yn)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=g(this,ii).get(t);let s=!1;if(i!==void 0)for(const[r,o]of Object.entries(e))i[r]!==o&&(s=!0,i[r]=o);else s=!0,g(this,ii).set(t,e);s&&W(this,V1,rz).call(this),e instanceof yn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type)}has(t){return g(this,ii).has(t)}getAll(){return g(this,ii).size>0?aM(g(this,ii)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return g(this,ii).size}resetModified(){g(this,nd)&&(V(this,nd,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new oz(this)}get serializable(){if(g(this,ii).size===0)return tk;const t=new Map,e=new sz,i=[],s=Object.create(null);let r=!1;for(const[o,a]of g(this,ii)){const l=a instanceof yn?a.serialize(!1,s):a;l&&(t.set(o,l),e.update(`${o}:${JSON.stringify(l)}`),r||(r=!!l.bitmap))}if(r)for(const o of t.values())o.bitmap&&i.push(o.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:tk}get editorStats(){let t=null;const e=new Map;for(const i of g(this,ii).values()){if(!(i instanceof yn))continue;const s=i.telemetryFinalData;if(!s)continue;const{type:r}=s;e.has(r)||e.set(r,Object.getPrototypeOf(i).constructor),t||(t=Object.create(null));const o=t[r]||(t[r]=new Map);for(const[a,l]of Object.entries(s)){if(a==="type")continue;let c=o.get(a);c||(c=new Map,o.set(a,c));const u=c.get(l)??0;c.set(l,u+1)}}for(const[i,s]of e)t[i]=s.computeTelemetryFinalData(t[i]);return t}resetModifiedIds(){V(this,id,null)}get modifiedIds(){if(g(this,id))return g(this,id);const t=[];for(const e of g(this,ii).values())!(e instanceof yn)||!e.annotationElementId||!e.serialize()||t.pu
212sh(e.annotationElementId);return V(this,id,{ids:new Set(t),hash:t.join(",")})}}nd=new WeakMap,id=new WeakMap,ii=new WeakMap,V1=new WeakSet,rz=function(){g(this,nd)||(V(this,nd,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var zw;class oz extends fM{constructor(e){super();F(this,zw,void 0);const{map:i,hash:s,transfer:r}=e.serializable,o=structuredClone(i,r?{transfer:r}:null);V(this,zw,{map:o,hash:s,transfer:r})}get print(){Xt("Should not call PrintAnnotationStorage.print")}get serializable(){return g(this,zw)}get modifiedIds(){return wt(this,"modifiedIds",{ids:new Set,hash:""})}}zw=new WeakMap;var Zf;class mae{constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){F(this,Zf,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),g(this,Zf).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,_inspectFont:e}){if(!(!t||g(this,Zf).has(t.loadedName))){if(Hn(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:s,style:r}=t,o=new FontFace(i,s,r);this.addNativeFontFace(o);try{await o.load(),g(this,Zf).add(i),e==null||e(t)}catch{ht(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Xt("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const i=t.createNativeFontFace();if(i){this.addNativeFontFace(i);try{await i.loaded}catch(s){throw ht(`Failed to load font '${i.family}': '${s}'.`),t.disableFontFace=!0,s}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(i=>{const s=this._queueLoadingCallback(i);this._prepareFontLoadEvent(t,s)})}}get isFontLoadingAPISupported(){var e;const t=!!((e=this._document)!=null&&e.fonts);return wt(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(Ni||typeof navigator<"u"&&typeof(navigator==null?void 0:navigator.userAgent)=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),wt(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function e(){for(Hn(!s.done,"completeRequest() cannot be called twice."),s.done=!0;i.length>0&&i[0].done;){const r=i.shift();setTimeout(r.callback,0)}}const{loadingRequests:i}=this,s={done:!1,complete:e,callback:t};return i.push(s),s}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return wt(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function i(I,T){return I.charCodeAt(T)<<24|I.charCodeAt(T+1)<<16|I.charCodeAt(T+2)<<8|I.charCodeAt(T+3)&255}function s(I,T,P,k){const D=I.substring(0,T),U=I.substring(T+P);return D+k+U}let r,o;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let c=0;function u(I,T){if(++c>30){ht("Load test font never loaded."),T();return}if(l.font="30px "+I,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){T();return}setTimeout(u.bind(null,I,T))}const d=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=s(h,976,d.length,d);const p=16,v=1482184792;let E=i(h,p);for(r=0,o=d.length-3;r<o;r+=4)E=E-v+i(d,r)|0;r<d.length&&(E=E-v+i(d+"XXX",r)|0),h=s(h,p,4,eae(E));const x=`url(data:font/opentype;base64,${btoa(h)});`,A=`@font-face {font-family:"${d}";src:${x}}`;this.insertRule(A);const O=this._document.createElement("div");O.style.visibility="hidden",O.style.width=O.style.height="10px",O.style.position="absolute",O.style.top=O.style.left="0px";for(const I of[t.loadedName,d]){const T=this._document.createElement("span");T.textContent="Hi",T.style.fontFamily=I,O.append(T)}this._document.body.append(O),u(d,()=>{O.remove(),e.complete()})}}Zf=new WeakMap;class pae{constructor(t,{disableFontFace:e=!1,fontExtraProperties:i=!1,inspectFont:s=null}){this.compiledGlyphs=Object.create(null);for(const r in t)this[r]=t[r];this.disableFontFace=e===!0,this.fontExtraProperties=i===!0,this._inspectFont=s}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return(e=this._inspectFont)==null||e.call(this,this),t}createFontFaceRule(){var i;if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${oae(this.data)});`;let e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${t}}`}return(i=this._inspectFont)==null||i.call(this,this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const i=this.loadedName+"_path_"+e;let s;try{s=t.get(i)}catch(o){ht(`getPathGenerator - ignoring character: "${o}".`)}const r=new Path2D(s||"");return this.fontExtraProperties||t.delete(i),this.compiledGlyphs[e]=r}}const S_={DATA:1,ERROR:2},Vn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Z2(){}function ls(n){if(n instanceof Vc||n instanceof RC||n instanceof Ob||n instanceof q2||n instanceof AE||n instanceof eA)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||Xt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Vc(n.message);case"InvalidPDFException":return new RC(n.message);case"MissingPDFException":return new Ob(n.message);case"PasswordException":return new q2(n.message,n.code);case"UnexpectedResponseException":return new AE(n.message,n.status);case"UnknownErrorException":return new eA(n.message,n.details)}return new eA(n.message,n.toString())}var Qf,H1,az,z1,lz,$1,cz,eg,v0;class Dp{constructor(t,e,i){F(this,H1);F(this,z1);F(this,$1);F(this,eg);F(this,Qf,new AbortController);this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",W(this,H1,az).bind(this),{signal:g(this,Qf).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}
212sendWithPromise(t,e,i){const s=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[s]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:e},i)}catch(o){r.reject(o)}return r.promise}sendWithStream(t,e,i,s){const r=this.streamId++,o=this.sourceName,a=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{const u=Promise.withResolvers();return this.streamControllers[r]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:o,targetName:a,action:t,streamId:r,data:e,desiredSize:c.desiredSize},s),u.promise},pull:c=>{const u=Promise.withResolvers();return this.streamControllers[r].pullCall=u,l.postMessage({sourceName:o,targetName:a,stream:Vn.PULL,streamId:r,desiredSize:c.desiredSize}),u.promise},cancel:c=>{Hn(c instanceof Error,"cancel must have a valid reason");const u=Promise.withResolvers();return this.streamControllers[r].cancelCall=u,this.streamControllers[r].isClosed=!0,l.postMessage({sourceName:o,targetName:a,stream:Vn.CANCEL,streamId:r,reason:ls(c)}),u.promise}},i)}destroy(){var t;(t=g(this,Qf))==null||t.abort(),V(this,Qf,null)}}Qf=new WeakMap,H1=new WeakSet,az=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){W(this,$1,cz).call(this,t);return}if(t.callback){const i=t.callbackId,s=this.callbackCapabilities[i];if(!s)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===S_.DATA)s.resolve(t.data);else if(t.callback===S_.ERROR)s.reject(ls(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,s=t.sourceName,r=this.comObj;Promise.try(e,t.data).then(function(o){r.postMessage({sourceName:i,targetName:s,callback:S_.DATA,callbackId:t.callbackId,data:o})},function(o){r.postMessage({sourceName:i,targetName:s,callback:S_.ERROR,callbackId:t.callbackId,reason:ls(o)})});return}if(t.streamId){W(this,z1,lz).call(this,t);return}e(t.data)},z1=new WeakSet,lz=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,r=this.comObj,o=this,a=this.actionHandler[t.action],l={enqueue(c,u=1,d){if(this.isCancelled)return;const h=this.desiredSize;this.desiredSize-=u,h>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:i,targetName:s,stream:Vn.ENQUEUE,streamId:e,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:s,stream:Vn.CLOSE,streamId:e}),delete o.streamSinks[e])},error(c){Hn(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,r.postMessage({sourceName:i,targetName:s,stream:Vn.ERROR,streamId:e,reason:ls(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[e]=l,Promise.try(a,t.data,l).then(function(){r.postMessage({sourceName:i,targetName:s,stream:Vn.START_COMPLETE,streamId:e,success:!0})},function(c){r.postMessage({sourceName:i,targetName:s,stream:Vn.START_COMPLETE,streamId:e,reason:ls(c)})})},$1=new WeakSet,cz=function(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,r=this.comObj,o=this.streamControllers[e],a=this.streamSinks[e];switch(t.stream){case Vn.START_COMPLETE:t.success?o.startCall.resolve():o.startCall.reject(ls(t.reason));break;case Vn.PULL_COMPLETE:t.success?o.pullCall.resolve():o.pullCall.reject(ls(t.reason));break;case Vn.PULL:if(!a){r.postMessage({sourceName:i,targetName:s,stream:Vn.PULL_COMPLETE,streamId:e,success:!0});break}a.desiredSize<=0&&t.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=t.desiredSize,Promise.try(a.onPull||Z2).then(function(){r.postMessage({sourceName:i,targetName:s,stream:Vn.PULL_COMPLETE,streamId:e,success:!0})},function(c){r.postMessage({sourceName:i,targetName:s,stream:Vn.PULL_COMPLETE,streamId:e,reason:ls(c)})});break;case Vn.ENQUEUE:if(Hn(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(t.chunk);break;case Vn.CLOSE:if(Hn(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),W(this,eg,v0).call(this,o,e);break;case Vn.ERROR:Hn(o,"error should have stream controller"),o.controller.error(ls(t.reason)),W(this,eg,v0).call(this,o,e);break;case Vn.CANCEL_COMPLETE:t.success?o.cancelCall.resolve():o.cancelCall.reject(ls(t.reason)),W(this,eg,v0).call(this,o,e);break;case Vn.CANCEL:if(!a)break;const l=ls(t.reason);Promise.try(a.onCancel||Z2,l).then(function(){r.postMessage({sourceName:i,targetName:s,stream:Vn.CANCEL_COMPLETE,streamId:e,success:!0})},function(c){r.postMessage({sourceName:i,targetName:s,stream:Vn.CANCEL_COMPLETE,streamId:e,reason:ls(c)})}),a.sinkCapability.reject(l),a.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},eg=new WeakSet,v0=async function(t,e){var i,s,r;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(s=t.pullCall)==null?void 0:s.promise,(r=t.cancelCall)==null?void 0:r.promise]),delete this.streamControllers[e]};var $w;class uz{constructor({enableHWA:t=!1}){F(this,$w,!1);V(this,$w,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!g(this,$w)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Xt("Abstract method `_createCanvas` called.")}}$w=new WeakMap;class bae extends uz{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}class dz{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(i=>({cMapData:i,isCompressed:this.isCompressed})).catch(i=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){Xt("Abstract method `_fetch` called.")}}class hz extends dz{async _fetch(t){const e=await DT(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):OT(e)}}class fz{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,s,r){return"none"}destroy(t=!1){}}var sd,tg,Oa,Da,Mi,rd,od,si,ki,ad,Rp,Kl,Kh,ng,y0,Xl,Xh,W1,gz,Ww,nk,Jl,Jh,ld,Lp,cd,Fp,Uw,ik,ud,Np;class wae extends fz{constructor({docId:e,ownerDocument:i=globalThis.document}){super();F(this,si);F(this,ad);F(this,Kl);F(this,ng);F(this,Xl);F(this,W1);F(this,Ww);F(this,Jl);F(this,ld);F(this,cd);F(this,Uw);F(this,ud);F(this,sd,void 0);F(this,tg,void 0);F(this,Oa,void 0);F(this,Da,void 0);F(this,Mi,void 0);F(this,rd,void 0);F(this,od,0);V(this,Da,e),V(this,Mi,i)}addFilter(e){if(!e)return"none";let i=g(this,si,ki).get(e);if(i)return i;const[s,r,o]=W(this,ng,y0).call(this,e),a=e.length===1?s:`${s}${r}${o}`;if(i=g(this,si,ki).get(a),i)return g(this,si,ki).set(e,i),i;const l=`g_${g(this,Da)}_transfer_map_${Gi(this,od)._++}`,c=W(this,Xl,Xh).call(this,l);g(this,si,ki).set(e,c),g(this,si,ki).set(a,c);const u=W(this,Jl,Jh).call(this,l);return W(this,cd,Fp).call(this,s,r,o,u),c}addHCMFilter(e,i){var p;const s=`${e}-${i}`,r="base";let o=g(this,ad,Rp).get(r);if((o==null?void 0:o.key)===s||(o?((p=o.filter)==null||p.remove(),o.key=s,o.url="none",o.filter=null):(o={key:s,url:"none",filter:null},g(this,ad,Rp).set(r,o)),!e||!i))return o.url;const a=W(this,ud,Np).call(this,e);e=ze.makeHexColor(...a);const l=W(this,ud,Np).call(this,i);if(i=ze.makeHexColor(...l),g(this,Kl,Kh).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return o.url;const c=new Array(256);for(let v=0;v<=255;v++){const E=v/255;c[v]=E<=.03928?E/12.92:((E+.055)/1.055)**2.4}const u=c.join(","),d=`g_${g(this,Da)}_hcm_filter`,h=o.filter=W(this,Jl,Jh).call(this,d);W(this,cd,Fp).call(this,u,u,u,h),W(this,Ww,nk).call(this,h);const f=(v,E)=>{const x=a[v]/255,A=l[v]/255,O=new Array(E+1);for(let I=0;I<=E;I++)O[I]=x+I/E*(A-x);return O.join(",")};return W(this,cd,Fp).call(this,f(0,5),f(1,5),f(2,5),h),o.url=W(this,Xl,Xh).call(this,d),o.url}addAlphaFilter(e){let i=g(this,si,ki).get(e);if(i)return i;const[s]=W(this,ng,y0).call(this,[e]),r=`alpha_${s}`;if(i=g(this,si,ki).get(r),i)return g(this,si,ki).set(e,i),i;const o=`g_${g(this,Da)}_alpha_map_${Gi(this,od)._++}`,a=W(this,Xl,Xh).call(this,o);g(this,si,ki).set(e,a),g(this,si,ki).set(r,a);const l=W(this,Jl,Jh).call(this,o);return W(this,Uw,ik).call(this,s,l),a}addLuminosityFilter(e){let i=g(this,si,ki).get(e||"luminosity");if(i)return i;let s,r;if(e?([s]=W(this,ng,y0).call(this,[e]),r=`luminosity_${s}`):r="luminosity",i=g(this,si,ki).get(r),i)return g(this,si,ki).set(e,i),i;const o=`g_${g(this,Da)}_luminosity_map_${Gi(this,od)._++}`,a=W(this,Xl,Xh).call(this,o);g(this,si,ki).set(e,a),g(this,si,ki).set(r,a);const l=W(this,Jl,Jh).call(this,o);return W(this,W1,gz).call(this,l),e&&W(this,Uw,ik).call(this,s,l),a}addHighlightHCMFilter(e,i,s,r,o){var A;const a=`${i}-${s}-${r}-${o}`;let l=g(this,ad,Rp).get(e);if((l==null?void 0:l.key)===a||(l?((A=l.filter)==null||A.remove(),l.key=a,l.url="none",l.filter=null):(l={key:a,url:"none",filter:null},g(this,ad,Rp).set(e,l)),!i||!s))return l.url;const[c,u]=[i,s].map(W(this,ud,Np).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),h=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[f,p]=[r,o].map(W(this,ud,Np).bind(this));h<d&&([d,h,f,p]=[h,d,p,f]),g(this,Kl,Kh).style.color="";const v=(O,I,T)=>{const P=new Array(256),k=(h-d)/T,D=O/255,U=(I-O)/(255*T);let Y=0;for(let K=0;K<=T;K++){const j=Math.round(d+K*k),L=D+K*U;for(let N=Y;N<=j;N++)P[N]=L;Y=j+1}for(let K=Y;K<256;K++)P[K]=P[Y-1];return P.join(",")},E=`g_${g(this,Da)}_hcm_${e}_filter`,x=l.filter=W(this,Jl,Jh).call(this,E);return W(this,Ww,nk).call(this,x),W(this,cd,Fp).call(this,v(f[0],p[0],5),v(f[1],p[1],5),v(f[2],p[2],5),x),l.url=W(this,Xl,Xh).call(this,E),l.url}destroy(e=!1){var i,s,r,o;e&&((i=g(this,rd))!=null&&i.size)||((s=g(this,Oa))==null||s.parentNode.parentNode.remove(),V(this,Oa,null),(r=g(this,tg))==null||r.clear(),V(this,tg,null),(o=g(this,rd))==null||o.clear(),V(this,rd,null),V(this,od,0))}}sd=new WeakMap,tg=new WeakMap,Oa=new WeakMap,Da=new WeakMap,Mi=new WeakMap,rd=new WeakMap,od=new WeakMap,si=new WeakSet,ki=function(){return g(this,tg)||V(this,tg,new Map)},ad=new WeakSet,Rp=function(){return g(this,rd)||V(this,rd,new Map)},Kl=new WeakSet,Kh=function(){if(!g(this,Oa)){const e=g(this,Mi).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const s=g(this,Mi).createElementNS(fa,"svg");s.setAttribute("width",0),s.setAttribute("height",0),V(this,Oa,g(this,Mi).createElementNS(fa,"def
212s")),e.append(s),s.append(g(this,Oa)),g(this,Mi).body.append(e)}return g(this,Oa)},ng=new WeakSet,y0=function(e){if(e.length===1){const c=e[0],u=new Array(256);for(let h=0;h<256;h++)u[h]=c[h]/255;const d=u.join(",");return[d,d,d]}const[i,s,r]=e,o=new Array(256),a=new Array(256),l=new Array(256);for(let c=0;c<256;c++)o[c]=i[c]/255,a[c]=s[c]/255,l[c]=r[c]/255;return[o.join(","),a.join(","),l.join(",")]},Xl=new WeakSet,Xh=function(e){if(g(this,sd)===void 0){V(this,sd,"");const i=g(this,Mi).URL;i!==g(this,Mi).baseURI&&(RT(i)?ht('#createUrl: ignore "data:"-URL for performance reasons.'):V(this,sd,i.split("#",1)[0]))}return`url(${g(this,sd)}#${e})`},W1=new WeakSet,gz=function(e){const i=g(this,Mi).createElementNS(fa,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(i)},Ww=new WeakSet,nk=function(e){const i=g(this,Mi).createElementNS(fa,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(i)},Jl=new WeakSet,Jh=function(e){const i=g(this,Mi).createElementNS(fa,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",e),g(this,Kl,Kh).append(i),i},ld=new WeakSet,Lp=function(e,i,s){const r=g(this,Mi).createElementNS(fa,i);r.setAttribute("type","discrete"),r.setAttribute("tableValues",s),e.append(r)},cd=new WeakSet,Fp=function(e,i,s,r){const o=g(this,Mi).createElementNS(fa,"feComponentTransfer");r.append(o),W(this,ld,Lp).call(this,o,"feFuncR",e),W(this,ld,Lp).call(this,o,"feFuncG",i),W(this,ld,Lp).call(this,o,"feFuncB",s)},Uw=new WeakSet,ik=function(e,i){const s=g(this,Mi).createElementNS(fa,"feComponentTransfer");i.append(s),W(this,ld,Lp).call(this,s,"feFuncA",e)},ud=new WeakSet,Np=function(e){return g(this,Kl,Kh).style.color=e,hM(getComputedStyle(g(this,Kl,Kh)).getPropertyValue("color"))};class mz{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(i=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){Xt("Abstract method `_fetch` called.")}}class pz extends mz{async _fetch(t){const e=await DT(t,"arraybuffer");return new Uint8Array(e)}}Ni&&ht("Please use the `legacy` build in Node.js environments.");async function bz(n){const e=await process.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(e)}class vae extends fz{}class yae extends uz{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,e)}}class _ae extends dz{async _fetch(t){return bz(t)}}class Eae extends mz{async _fetch(t){return bz(t)}}const Li={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function sk(n,t){if(!t)return;const e=t[2]-t[0],i=t[3]-t[1],s=new Path2D;s.rect(t[0],t[1],e,i),n.clip(s)}class gM{getPattern(){Xt("Abstract method `getPattern` called.")}}class Sae extends gM{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;this._type==="axial"?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,s){let r;if(s===Li.STROKE||s===Li.FILL){const o=e.current.getClippedPathBoundingBox(s,hn(t))||[0,0,0,0],a=Math.ceil(o[2]-o[0])||1,l=Math.ceil(o[3]-o[1])||1,c=e.cachedCanvases.getCanvas("pattern",a,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-o[0],-o[1]),i=ze.transform(i,[1,0,0,1,o[0],o[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),sk(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),r=t.createPattern(c.canvas,"no-repeat");const d=new DOMMatrix(i);r.setTransform(d)}else sk(t,this._bbox),r=this._createGradient(t);return r}}function iA(n,t,e,i,s,r,o,a){const l=t.coords,c=t.colors,u=n.data,d=n.width*4;let h;l[e+1]>l[i+1]&&(h=e,e=i,i=h,h=r,r=o,o=h),l[i+1]>l[s+1]&&(h=i,i=s,s=h,h=o,o=a,a=h),l[e+1]>l[i+1]&&(h=e,e=i,i=h,h=r,r=o,o=h);const f=(l[e]+t.offsetX)*t.scaleX,p=(l[e+1]+t.offsetY)*t.scaleY,v=(l[i]+t.offsetX)*t.scaleX,E=(l[i+1]+t.offsetY)*t.scaleY,x=(l[s]+t.offsetX)*t.scaleX,A=(l[s+1]+t.offsetY)*t.scaleY;if(p>=A)return;
212const O=c[r],I=c[r+1],T=c[r+2],P=c[o],k=c[o+1],D=c[o+2],U=c[a],Y=c[a+1],K=c[a+2],j=Math.round(p),L=Math.round(A);let N,m,_,C,B,$,X,Z;for(let ie=j;ie<=L;ie++){if(ie<E){const ye=ie<p?0:(p-ie)/(p-E);N=f-(f-v)*ye,m=O-(O-P)*ye,_=I-(I-k)*ye,C=T-(T-D)*ye}else{let ye;ie>A?ye=1:E===A?ye=0:ye=(E-ie)/(E-A),N=v-(v-x)*ye,m=P-(P-U)*ye,_=k-(k-Y)*ye,C=D-(D-K)*ye}let fe;ie<p?fe=0:ie>A?fe=1:fe=(p-ie)/(p-A),B=f-(f-x)*fe,$=O-(O-U)*fe,X=I-(I-Y)*fe,Z=T-(T-K)*fe;const ae=Math.round(Math.min(N,B)),ge=Math.round(Math.max(N,B));let he=d*ie+ae*4;for(let ye=ae;ye<=ge;ye++)fe=(N-ye)/(N-B),fe<0?fe=0:fe>1&&(fe=1),u[he++]=m-(m-$)*fe|0,u[he++]=_-(_-X)*fe|0,u[he++]=C-(C-Z)*fe|0,u[he++]=255}}function Tae(n,t,e){const i=t.coords,s=t.colors;let r,o;switch(t.type){case"lattice":const a=t.verticesPerRow,l=Math.floor(i.length/a)-1,c=a-1;for(r=0;r<l;r++){let u=r*a;for(let d=0;d<c;d++,u++)iA(n,e,i[u],i[u+1],i[u+a],s[u],s[u+1],s[u+a]),iA(n,e,i[u+a+1],i[u+1],i[u+a],s[u+a+1],s[u+1],s[u+a])}break;case"triangles":for(r=0,o=i.length;r<o;r+=3)iA(n,e,i[r],i[r+1],i[r+2],s[r],s[r+1],s[r+2]);break;default:throw new Error("illegal figure")}}class xae extends gM{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const a=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-a,u=Math.ceil(this._bounds[3])-l,d=Math.min(Math.ceil(Math.abs(c*t[0]*1.1)),3e3),h=Math.min(Math.ceil(Math.abs(u*t[1]*1.1)),3e3),f=c/d,p=u/h,v={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-l,scaleX:1/f,scaleY:1/p},E=d+2*2,x=h+2*2,A=i.getCanvas("mesh",E,x),O=A.context,I=O.createImageData(d,h);if(e){const P=I.data;for(let k=0,D=P.length;k<D;k+=4)P[k]=e[0],P[k+1]=e[1],P[k+2]=e[2],P[k+3]=255}for(const P of this._figures)Tae(I,P,v);return O.putImageData(I,2,2),{canvas:A.canvas,offsetX:a-2*f,offsetY:l-2*p,scaleX:f,scaleY:p}}getPattern(t,e,i,s){sk(t,this._bbox);let r;if(s===Li.SHADING)r=ze.singularValueDecompose2dScale(hn(t));else if(r=ze.singularValueDecompose2dScale(e.baseTransform),this.matrix){const a=ze.singularValueDecompose2dScale(this.matrix);r=[r[0]*a[0],r[1]*a[1]]}const o=this._createMeshCanvas(r,s===Li.SHADING?null:this._background,e.cachedCanvases);return s!==Li.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(o.offsetX,o.offsetY),t.scale(o.scaleX,o.scaleY),t.createPattern(o.canvas,"no-repeat")}}class Aae extends gM{getPattern(){return"hotpink"}}function Cae(n){switch(n[0]){case"RadialAxial":return new Sae(n);case"Mesh":return new xae(n);case"Dummy":return new Aae}throw new Error(`Unknown IR type: ${n[0]}`)}const Q2={COLORED:1,UNCOLORED:2},U1=class U1{constructor(t,e,i,s,r){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=s,this.baseTransform=r}createPatternCanvas(t){const{bbox:e,operatorList:i,paintType:s,tilingType:r,color:o,canvasGraphicsFactory:a}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),MT("TilingType: "+r);const u=e[0],d=e[1],h=e[2],f=e[3],p=h-u,v=f-d,E=ze.singularValueDecompose2dScale(this.matrix),x=ze.singularValueDecompose2dScale(this.baseTransform),A=E[0]*x[0],O=E[1]*x[1];let I=p,T=v,P=!1,k=!1;const D=Math.ceil(l*A),U=Math.ceil(c*O),Y=Math.ceil(p*A),K=Math.ceil(v*O);D>=Y?I=l:P=!0,U>=K?T=c:k=!0;const j=this.getSizeAndScale(I,this.ctx.canvas.width,A),L=this.getSizeAndScale(T,this.ctx.canvas.height,O),N=t.cachedCanvases.getCanvas("pattern",j.size,L.size),m=N.context,_=a.createCanvasGraphics(m);if(_.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(_,s,o),m.translate(-j.scale*u,-L.scale*d),_.transform(j.scale,0,0,L.scale,0,0),m.save(),this.clipBbox(_,u,d,h,f),_.baseTransform=hn(_.ctx),_.executeOperatorList(i),_.endDrawing(),m.restore(),P||k){const C=N.canvas;P&&(I=l),k&&(T=c);const B=this.getSizeAndScale(I,this.ctx.canvas.width,A),$=this.getSizeAndScale(T,this.ctx.canvas.height,O),X=B.size,Z=$.size,ie=t.cachedCanvases.getCanvas("pattern-workaround",X,Z),fe=ie.context,ae=P?Math.floor(p/l):0,ge=k?Math.floor(v/c):0;for(let he=0;he<=ae;he++)for(let ye=0;ye<=ge;ye++)fe.drawImage(C,X*he,Z*ye,X,Z,0,0,X,Z);return{canvas:ie.canvas,scaleX:B.scale,scaleY:$.scale,offsetX:u,offsetY:d}}return{canvas:N.canvas,scaleX:j.scale,scaleY:L.scale,offsetX:u,offsetY:d}}getSizeAndScale(t,e,i){const s=Math.max(U1.MAX_PATTERN_SIZE,e);let r=Math.ceil(t*i);return r>=s?r=s:i=r/t,{scale:i,size:r}}clipBbox(t,e,i,s,r){const o=s-e,a=r-i;t.ctx.rect(e,i,o,a),t.current.updateRectMinMax(hn(t.ctx),[e,i,s,r]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const s=t.ctx,r=t.current;switch(e){case Q2.COLORED:const o=this.ctx;s.fillStyle=o.fillStyle,s.strokeStyle=o.strokeStyle,r.fillColor=o.fillStyle,r.strokeColor=o.strokeStyle;break;case Q2.UNCOLORED:const a=ze.makeHexColor(i[0],i[1],i[2]);s.fillStyle=a,s.strokeStyle=a,r.fillColor=a,r.strokeColor=a;break;default:throw new Qoe(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,s){let r=i;s!==Li.SHADING&&(r=ze.transform(r,e.baseTransform),this.matrix&&(r=ze.transform(r,this.matrix
212)));const o=this.createPatternCanvas(e);let a=new DOMMatrix(r);a=a.translate(o.offsetX,o.offsetY),a=a.scale(1/o.scaleX,1/o.scaleY);const l=t.createPattern(o.canvas,"repeat");return l.setTransform(a),l}};y(U1,"MAX_PATTERN_SIZE",3e3);let rk=U1;function kae({src:n,srcPos:t=0,dest:e,width:i,height:s,nonBlackColor:r=4294967295,inverseDecode:o=!1}){const a=es.isLittleEndian?4278190080:255,[l,c]=o?[r,a]:[a,r],u=i>>3,d=i&7,h=n.length;e=new Uint32Array(e.buffer);let f=0;for(let p=0;p<s;p++){for(const E=t+u;t<E;t++){const x=t<h?n[t]:255;e[f++]=x&128?c:l,e[f++]=x&64?c:l,e[f++]=x&32?c:l,e[f++]=x&16?c:l,e[f++]=x&8?c:l,e[f++]=x&4?c:l,e[f++]=x&2?c:l,e[f++]=x&1?c:l}if(d===0)continue;const v=t<h?n[t++]:255;for(let E=0;E<d;E++)e[f++]=v&1<<7-E?c:l}return{srcPos:t,destPos:f}}const eL=16,tL=100,Iae=15,nL=10,iL=1e3,ms=16;function Pae(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){t.save(),this.__originalSave()},n.restore=function(){t.restore(),this.__originalRestore()},n.translate=function(i,s){t.translate(i,s),this.__originalTranslate(i,s)},n.scale=function(i,s){t.scale(i,s),this.__originalScale(i,s)},n.transform=function(i,s,r,o,a,l){t.transform(i,s,r,o,a,l),this.__originalTransform(i,s,r,o,a,l)},n.setTransform=function(i,s,r,o,a,l){t.setTransform(i,s,r,o,a,l),this.__originalSetTransform(i,s,r,o,a,l)},n.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},n.rotate=function(i){t.rotate(i),this.__originalRotate(i)},n.clip=function(i){t.clip(i),this.__originalClip(i)},n.moveTo=function(e,i){t.moveTo(e,i),this.__originalMoveTo(e,i)},n.lineTo=function(e,i){t.lineTo(e,i),this.__originalLineTo(e,i)},n.bezierCurveTo=function(e,i,s,r,o,a){t.bezierCurveTo(e,i,s,r,o,a),this.__originalBezierCurveTo(e,i,s,r,o,a)},n.rect=function(e,i,s,r){t.rect(e,i,s,r),this.__originalRect(e,i,s,r)},n.closePath=function(){t.closePath(),this.__originalClosePath()},n.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class Mae{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let s;return this.cache[t]!==void 0?(s=this.cache[t],this.canvasFactory.reset(s,e,i)):(s=this.canvasFactory.create(e,i),this.cache[t]=s),s}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function T_(n,t,e,i,s,r,o,a,l,c){const[u,d,h,f,p,v]=hn(n);if(d===0&&h===0){const A=o*u+p,O=Math.round(A),I=a*f+v,T=Math.round(I),P=(o+l)*u+p,k=Math.abs(Math.round(P)-O)||1,D=(a+c)*f+v,U=Math.abs(Math.round(D)-T)||1;return n.setTransform(Math.sign(u),0,0,Math.sign(f),O,T),n.drawImage(t,e,i,s,r,0,0,k,U),n.setTransform(u,d,h,f,p,v),[k,U]}if(u===0&&f===0){const A=a*h+p,O=Math.round(A),I=o*d+v,T=Math.round(I),P=(a+c)*h+p,k=Math.abs(Math.round(P)-O)||1,D=(o+l)*d+v,U=Math.abs(Math.round(D)-T)||1;return n.setTransform(0,Math.sign(d),Math.sign(h),0,O,T),n.drawImage(t,e,i,s,r,0,0,U,k),n.setTransform(u,d,h,f,p,v),[U,k]}n.drawImage(t,e,i,s,r,o,a,l,c);const E=Math.hypot(u,d),x=Math.hypot(h,f);return[E*l,x*c]}function Oae(n){const{width:t,height:e}=n;if(t>iL||e>iL)return null;const i=1e3,s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=t+1;let o=new Uint8Array(r*(e+1)),a,l,c;const u=t+7&-8;let d=new Uint8Array(u*e),h=0;for(const x of n.data){let A=128;for(;A>0;)d[h++]=x&A?0:255,A>>=1}let f=0;for(h=0,d[h]!==0&&(o[0]=1,++f),l=1;l<t;l++)d[h]!==d[h+1]&&(o[l]=d[h]?2:1,++f),h++;for(d[h]!==0&&(o[l]=2,++f),a=1;a<e;a++){h=a*u,c=a*r,d[h-u]!==d[h]&&(o[c]=d[h]?1:8,++f);let x=(d[h]?4:0)+(d[h-u]?8:0);for(l=1;l<t;l++)x=(x>>2)+(d[h+1]?4:0)+(d[h-u+1]?8:0),s[x]&&(o[c+l]=s[x],++f),h++;if(d[h-u]!==d[h]&&(o[c+l]=d[h]?2:4,++f),f>i)return null}for(h=u*(e-1),c=a*r,d[h]!==0&&(o[c]=8,++f),l=1;l<t;l++)d[h]!==d[h+1]&&(o[c+l]=d[h]?4:8,++f),h++;if(d[h]!==0&&(o[c+l]=4,++f),f>i)return null;const p=new Int32Array([0,r,-1,0,-r,0,0,0,1]),v=new Path2D;for(a=0;f&&a<=e;a++){let x=a*r;const A=x+t;for(;x<A&&!o[x];)x++;if(x===A)continue;v.moveTo(x%r,a);const O=x;let I=o[x];do{const T=p[I];do x+=T;
212while(!o[x]);const P=o[x];P!==5&&P!==10?(I=P,o[x]=0):(I=P&51*I>>4,o[x]&=I>>2|I<<2),v.lineTo(x%r,x/r|0),o[x]||--f}while(O!==x);--a}return d=null,o=null,function(x){x.save(),x.scale(1/t,-1/e),x.translate(0,-e),x.fill(v),x.beginPath(),x.restore()}}class sL{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=C3,this.textMatrixScale=1,this.fontMatrix=DC,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=Ci.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.patternStroke=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=ze.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=ze.applyTransform(e,t),s=ze.applyTransform(e.slice(2),t),r=ze.applyTransform([e[0],e[3]],t),o=ze.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],s[0],r[0],o[0]),this.minY=Math.min(this.minY,i[1],s[1],r[1],o[1]),this.maxX=Math.max(this.maxX,i[0],s[0],r[0],o[0]),this.maxY=Math.max(this.maxY,i[1],s[1],r[1],o[1])}updateScalingPathMinMax(t,e){ze.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,s,r,o,a,l,c,u){const d=ze.bezierBoundingBox(e,i,s,r,o,a,l,c,u);u||this.updateRectMinMax(t,d)}getPathBoundingBox(t=Li.FILL,e=null){const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===Li.STROKE){e||Xt("Stroke bounding box must include transform.");const s=ze.singularValueDecompose2dScale(e),r=s[0]*this.lineWidth/2,o=s[1]*this.lineWidth/2;i[0]-=r,i[1]-=o,i[2]+=r,i[3]+=o}return i}updateClipFromPath(){const t=ze.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(t=Li.FILL,e=null){return ze.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function rL(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}const e=t.height,i=t.width,s=e%ms,r=(e-s)/ms,o=s===0?r:r+1,a=n.createImageData(i,ms);let l=0,c;const u=t.data,d=a.data;let h,f,p,v;if(t.kind===u0.GRAYSCALE_1BPP){const E=u.byteLength,x=new Uint32Array(d.buffer,0,d.byteLength>>2),A=x.length,O=i+7>>3,I=4294967295,T=es.isLittleEndian?4278190080:255;for(h=0;h<o;h++){for(p=h<r?ms:s,c=0,f=0;f<p;f++){const P=E-l;let k=0;const D=P>O?i:P*8-7,U=D&-8;let Y=0,K=0;for(;k<U;k+=8)K=u[l++],x[c++]=K&128?I:T,x[c++]=K&64?I:T,x[c++]=K&32?I:T,x[c++]=K&16?I:T,x[c++]=K&8?I:T,x[c++]=K&4?I:T,x[c++]=K&2?I:T,x[c++]=K&1?I:T;for(;k<D;k++)Y===0&&(K=u[l++],Y=128),x[c++]=K&Y?I:T,Y>>=1}for(;c<A;)x[c++]=0;n.putImageData(a,0,h*ms)}}else if(t.kind===u0.RGBA_32BPP){for(f=0,v=i*ms*4,h=0;h<r;h++)d.set(u.subarray(l,l+v)),l+=v,n.putImageData(a,0,f),f+=ms;h<o&&(v=i*s*4,d.set(u.subarray(l,l+v)),n.putImageData(a,0,f))}else if(t.kind===u0.RGB_24BPP)for(p=ms,v=i*p,h=0;h<o;h++){for(h>=r&&(p=s,v=i*p),c=0,f=v;f--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;n.putImageData(a,0,h*ms)}else throw new Error(`bad image kind: ${t.kind}`)}function oL(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}const e=t.height,i=t.width,s=e%ms,r=(e-s)/ms,o=s===0?r:r+1,a=n.createImageData(i,ms);let l=0;const c=t.data,u=a.data;for(let d=0;d<o;d++){const h=d<r?ms:s;({srcPos:l}=kae({src:c,srcPos:l,dest:u,width:i,height:h,nonBlackColor:0})),n.putImageData(a,0,d*ms)}}function lp(n,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const i of e)n[i]!==void 0&&(t[i]=n[i]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function x_(n){if(n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.set
212LineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0),!Ni){const{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}}function aL(n,t){if(t)return!0;const e=ze.singularValueDecompose2dScale(n);e[0]=Math.fround(e[0]),e[1]=Math.fround(e[1]);const i=Math.fround((globalThis.devicePixelRatio||1)*Hc.PDF_TO_CSS_UNITS);return e[0]<=i&&e[1]<=i}const Dae=["butt","round","square"],Rae=["miter","round","bevel"],Lae={},lL={};var jw,ok,Gw,ak,Yw,lk;const kO=class kO{constructor(t,e,i,s,r,{optionalContentConfig:o,markedContentStack:a=null},l,c){F(this,jw);F(this,Gw);F(this,Yw);this.ctx=t,this.current=new sL(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=s,this.filterFactory=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=o,this.cachedCanvases=new Mae(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,e=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing({transform:t,viewport:e,transparency:i=!1,background:s=null}){const r=this.ctx.canvas.width,o=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,r,o),this.ctx.fillStyle=a,i){const l=this.cachedCanvases.getCanvas("transparent",r,o);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...hn(this.compositeCtx))}this.ctx.save(),x_(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=hn(this.ctx)}executeOperatorList(t,e,i,s){const r=t.argsArray,o=t.fnArray;let a=e||0;const l=r.length;if(l===a)return a;const c=l-a>nL&&typeof i=="function",u=c?Date.now()+Iae:0;let d=0;const h=this.commonObjs,f=this.objs;let p;for(;;){if(s!==void 0&&a===s.nextBreakPoint)return s.breakIt(a,i),a;if(p=o[a],p!==Dr.dependency)this[p].apply(this,r[a]);else for(const v of r[a]){const E=v.startsWith("g_")?h:f;if(!E.has(v))return E.get(v,i),a}if(a++,a===l)return a;
212if(c&&++d>nL){if(Date.now()>u)return i(),a;d=0}}}endDrawing(){W(this,jw,ok).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),W(this,Gw,ak).call(this)}_scaleImage(t,e){const i=t.width??t.displayWidth,s=t.height??t.displayHeight;let r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),a=i,l=s,c="prescale1",u,d;for(;r>2&&a>1||o>2&&l>1;){let h=a,f=l;r>2&&a>1&&(h=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),r/=a/h),o>2&&l>1&&(f=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,o/=l/f),u=this.cachedCanvases.getCanvas(c,h,f),d=u.context,d.clearRect(0,0,h,f),d.drawImage(t,0,0,a,l,0,0,h,f),t=u.canvas,a=h,l=f,c=c==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:a,paintHeight:l}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:s}=t,r=this.current.fillColor,o=this.current.patternFill,a=hn(e);let l,c,u,d;if((t.bitmap||t.data)&&t.count>1){const D=t.bitmap||t.data.buffer;c=JSON.stringify(o?a:[a.slice(0,4),r]),l=this._cachedBitmapsMap.get(D),l||(l=new Map,this._cachedBitmapsMap.set(D,l));const U=l.get(c);if(U&&!o){const Y=Math.round(Math.min(a[0],a[2])+a[4]),K=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:U,offsetX:Y,offsetY:K}}u=U}u||(d=this.cachedCanvases.getCanvas("maskCanvas",i,s),oL(d.context,t));let h=ze.transform(a,[1/i,0,0,-1/s,0,0]);h=ze.transform(h,[1,0,0,1,0,-s]);const[f,p,v,E]=ze.getAxialAlignedBoundingBox([0,0,i,s],h),x=Math.round(v-f)||1,A=Math.round(E-p)||1,O=this.cachedCanvases.getCanvas("fillCanvas",x,A),I=O.context,T=f,P=p;I.translate(-T,-P),I.transform(...h),u||(u=this._scaleImage(d.canvas,wo(I)),u=u.img,l&&o&&l.set(c,u)),I.imageSmoothingEnabled=aL(hn(I),t.interpolate),T_(I,u,0,0,u.width,u.height,0,0,i,s),I.globalCompositeOperation="source-in";const k=ze.transform(wo(I),[1,0,0,1,-T,-P]);return I.fillStyle=o?r.getPattern(e,this,k,Li.FILL):r,I.fillRect(0,0,i,s),l&&!o&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,O.canvas)),{canvas:O.canvas,offsetX:Math.round(T),offsetY:Math.round(P)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Dae[t]}setLineJoin(t){this.ctx.lineJoin=Rae[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,s=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=s.context;const r=this.ctx;r.setTransform(...hn(this.suspendedCtx)),lp(this.suspendedCtx,r),Pae(r,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),lp(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore(
212)}composeSMask(t,e,i,s){const r=s[0],o=s[1],a=s[2]-r,l=s[3]-o;a===0||l===0||(this.genericComposeSMask(e.context,i,a,l,e.subtype,e.backdrop,e.transferMap,r,o,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,s,r,o,a,l,c,u,d){let h=t.canvas,f=l-u,p=c-d;if(o){const E=ze.makeHexColor(...o);if(f<0||p<0||f+i>h.width||p+s>h.height){const x=this.cachedCanvases.getCanvas("maskExtension",i,s),A=x.context;A.drawImage(h,-f,-p),A.globalCompositeOperation="destination-atop",A.fillStyle=E,A.fillRect(0,0,i,s),A.globalCompositeOperation="source-over",h=x.canvas,f=p=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const x=new Path2D;x.rect(f,p,i,s),t.clip(x),t.globalCompositeOperation="destination-atop",t.fillStyle=E,t.fillRect(f,p,i,s),t.restore()}}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),r==="Alpha"&&a?e.filter=this.filterFactory.addAlphaFilter(a):r==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(a));const v=new Path2D;v.rect(l,c,i,s),e.clip(v),e.globalCompositeOperation="destination-in",e.drawImage(h,f,p,i,s,l,c,i,s),e.restore()}save(){this.inSMaskMode?(lp(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),lp(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,s,r,o){this.ctx.transform(t,e,i,s,r,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const s=this.ctx,r=this.current;let o=r.x,a=r.y,l,c;const u=hn(s),d=u[0]===0&&u[3]===0||u[1]===0&&u[2]===0,h=d?i.slice(0):null;for(let f=0,p=0,v=t.length;f<v;f++)switch(t[f]|0){case Dr.rectangle:o=e[p++],a=e[p++];const E=e[p++],x=e[p++],A=o+E,O=a+x;s.moveTo(o,a),E===0||x===0?s.lineTo(A,O):(s.lineTo(A,a),s.lineTo(A,O),s.lineTo(o,O)),d||r.updateRectMinMax(u,[o,a,A,O]),s.closePath();break;case Dr.moveTo:o=e[p++],a=e[p++],s.moveTo(o,a),d||r.updatePathMinMax(u,o,a);break;case Dr.lineTo:o=e[p++],a=e[p++],s.lineTo(o,a),d||r.updatePathMinMax(u,o,a);break;case Dr.curveTo:l=o,c=a,o=e[p+4],a=e[p+5],s.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],o,a),r.updateCurvePathMinMax(u,l,c,e[p],e[p+1],e[p+2],e[p+3],o,a,h),p+=6;break;case Dr.curveTo2:l=o,c=a,s.bezierCurveTo(o,a,e[p],e[p+1],e[p+2],e[p+3]),r.updateCurvePathMinMax(u,l,c,o,a,e[p],e[p+1],e[p+2],e[p+3],h),o=e[p+2],a=e[p+3],p+=4;break;case Dr.curveTo3:l=o,c=a,o=e[p+2],a=e[p+3],s.bezierCurveTo(e[p],e[p+1],o,a,o,a),r.updateCurvePathMinMax(u,l,c,e[p],e[p+1],o,a,o,a,h),p+=4;break;case Dr.closePath:s.closePath();break}d&&r.updateScalingPathMinMax(u,h),r.setCurrentPoint(o,a)}closePath(){this.ctx.closePath()}stroke(t=!0){const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof i=="object"&&(i!=null&&i.getPattern)?(e.save(),e.strokeStyle=i.getPattern(e,this,wo(e),Li.STROKE),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t=!0){const e=this.ctx,i=this.current.fillColor,s=this.current.patternFill;let r=!1;s&&(e.save(),e.fillStyle=i.getPattern(e,this,wo(e),Li.FILL),r=!0);const o=this.current.getClippedPathBoundingBox();this.contentVisible&&o!==null&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),r&&e.restore(),t&&this.consumePath(o)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Lae}eoClip(){this.pendingClip=lL}beginText(){this.current.textMatrix=C3,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(t===void 0){e.beginPath();return}const i=new Path2D,s=e.getTransform().invertSelf();for(const{transform:r,x:o,y:a,fontSize:l,path:c}of t)i.addPath(c,new DOMMatrix(r).preMultiplySelf(s).translate(o,a).scale(l,-l));e.clip(i),e.beginPath(),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var u;const i=this.commonObjs.get(t),s=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(s.fontMatrix=i.fontMatrix||DC,(s.fontMatrix[0]===0||s.fontMatrix[3]===0)&&ht("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;const r=i.loadedName||"sans-serif",o=((u=i.systemFontInfo)==null?void 0:u.css)||`"${r}", ${i.fallbackName}`;let a="normal";i.black?a="900":i.bold&&(a="bold");const l=i.italic?"italic":"normal";let c=e;e<eL?c=eL:e>tL&&(c=tL),this.current.fontSizeScale=e/c,this.ctx.font=`${l} ${a} ${c}px ${o}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}
212setTextMatrix(t,e,i,s,r,o){this.current.textMatrix=[t,e,i,s,r,o],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,s,r){const o=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,u=a.fontSize/a.fontSizeScale,d=c&Ci.FILL_STROKE_MASK,h=!!(c&Ci.ADD_TO_PATH_FLAG),f=a.patternFill&&!l.missingFile,p=a.patternStroke&&!l.missingFile;let v;if((l.disableFontFace||h||f||p)&&(v=l.getPathGenerator(this.commonObjs,t)),l.disableFontFace||f||p){if(o.save(),o.translate(e,i),o.scale(u,-u),d===Ci.FILL||d===Ci.FILL_STROKE)if(s){const E=o.getTransform();o.setTransform(...s),o.fill(W(this,Yw,lk).call(this,v,E,s))}else o.fill(v);if(d===Ci.STROKE||d===Ci.FILL_STROKE)if(r){const E=o.getTransform();o.setTransform(...r),o.stroke(W(this,Yw,lk).call(this,v,E,r))}else o.lineWidth/=u,o.stroke(v);o.restore()}else(d===Ci.FILL||d===Ci.FILL_STROKE)&&o.fillText(t,e,i),(d===Ci.STROKE||d===Ci.FILL_STROKE)&&o.strokeText(t,e,i);h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:hn(o),x:e,y:i,fontSize:u,path:v})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let s=3;s<e.length;s+=4)if(e[s]>0&&e[s]<255){i=!0;break}return wt(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const s=e.fontSize;if(s===0)return;const r=this.ctx,o=e.fontSizeScale,a=e.charSpacing,l=e.wordSpacing,c=e.fontDirection,u=e.textHScale*c,d=t.length,h=i.vertical,f=h?1:-1,p=i.defaultVMetrics,v=s*e.fontMatrix[0],E=e.textRenderingMode===Ci.FILL&&!i.disableFontFace&&!e.patternFill;r.save(),r.transform(...e.textMatrix),r.translate(e.x,e.y+e.textRise),c>0?r.scale(u,-1):r.scale(u,1);let x,A;if(e.patternFill){r.save();const k=e.fillColor.getPattern(r,this,wo(r),Li.FILL);x=hn(r),r.restore(),r.fillStyle=k}if(e.patternStroke){r.save();const k=e.strokeColor.getPattern(r,this,wo(r),Li.STROKE);A=hn(r),r.restore(),r.strokeStyle=k}let O=e.lineWidth;const I=e.textMatrixScale;if(I===0||O===0){const k=e.textRenderingMode&Ci.FILL_STROKE_MASK;(k===Ci.STROKE||k===Ci.FILL_STROKE)&&(O=this.getSinglePixelWidth())}else O/=I;if(o!==1&&(r.scale(o,o),O/=o),r.lineWidth=O,i.isInvalidPDFjsFont){const k=[];let D=0;for(const U of t)k.push(U.unicode),D+=U.width;r.fillText(k.join(""),0,0),e.x+=D*v*u,r.restore(),this.compose();return}let T=0,P;for(P=0;P<d;++P){const k=t[P];if(typeof k=="number"){T+=f*k*s/1e3;continue}let D=!1;const U=(k.isSpace?l:0)+a,Y=k.fontChar,K=k.accent;let j,L,N=k.width;if(h){const _=k.vmetric||p,C=-(k.vmetric?_[1]:N*.5)*v,B=_[2]*v;N=_?-_[0]:N,j=C/o,L=(T+B)/o}else j=T/o,L=0;if(i.remeasure&&N>0){const _=r.measureText(Y).width*1e3/s*o;if(N<_&&this.isFontSubpixelAAEnabled){const C=N/_;D=!0,r.save(),r.scale(C,1),j/=C}else N!==_&&(j+=(N-_)/2e3*s/o)}if(this.contentVisible&&(k.isInFont||i.missingFile)){if(E&&!K)r.fillText(Y,j,L);else if(this.paintChar(Y,j,L,x,A),K){const _=j+s*K.offset.x/o,C=L-s*K.offset.y/o;this.paintChar(K.fontChar,_,C,x,A)}}const m=h?N*v-U*c:N*v+U*c;T+=m,D&&r.restore()}h?e.y-=T:e.x+=T*u,r.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,s=i.font,r=i.fontSize,o=i.fontDirection,a=s.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,u=i.textHScale*o,d=i.fontMatrix||DC,h=t.length,f=i.textRenderingMode===Ci.INVISIBLE;let p,v,E,x;if(!(f||r===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(u,o),p=0;p<h;++p){if(v=t[p],typeof v=="number"){x=a*v*r/1e3,this.ctx.translate(x,0),i.x+=x*u;continue}const A=(v.isSpace?c:0)+l,O=s.charProcOperatorList[v.operatorListId];if(!O){ht(`Type3 character "${v.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=v,this.save(),e.scale(r,r),e.transform(...d),this.executeOperatorList(O),this.restore()),E=ze.applyTransform([v.width,0],d)[0]*r+A,e.translate(E,0),i.x+=E*u}
212e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,s,r,o){this.ctx.rect(i,s,r-i,o-s),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if(t[0]==="TilingPattern"){const i=t[1],s=this.baseTransform||hn(this.ctx),r={createCanvasGraphics:o=>new kO(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new rk(t,i,this.ctx,r,s)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){this.ctx.strokeStyle=this.current.strokeColor=ze.makeHexColor(t,e,i),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e,i){this.ctx.fillStyle=this.current.fillColor=ze.makeHexColor(t,e,i),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=Cae(this.getObject(t)),this.cachedPatterns.set(t,i)),e&&(i.matrix=e),i}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,wo(e),Li.SHADING);const s=wo(e);if(s){const{width:r,height:o}=e.canvas,[a,l,c,u]=ze.getAxialAlignedBoundingBox([0,0,r,o],s);this.ctx.fillRect(a,l,c-a,u-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Xt("Should not call beginInlineImage")}beginImageData(){Xt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=hn(this.ctx),e)){const i=e[2]-e[0],s=e[3]-e[1];this.ctx.rect(e[0],e[1],i,s),this.current.updateRectMinMax(hn(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;
212t.isolated||MT("TODO: Support non-isolated groups."),t.knockout&&ht("Knockout groups not supported.");const i=hn(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let s=ze.getAxialAlignedBoundingBox(t.bbox,hn(e));const r=[0,0,e.canvas.width,e.canvas.height];s=ze.intersect(s,r)||[0,0,0,0];const o=Math.floor(s[0]),a=Math.floor(s[1]),l=Math.max(Math.ceil(s[2])-o,1),c=Math.max(Math.ceil(s[3])-a,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;t.smask&&(u+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(u,l,c),h=d.context;h.translate(-o,-a),h.transform(...i),t.smask?this.smaskStack.push({canvas:d.canvas,context:h,offsetX:o,offsetY:a,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(o,a),e.save()),lp(e,h),this.ctx=h,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const s=hn(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...s);const r=ze.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],s);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(t,e,i,s,r){if(W(this,jw,ok).call(this),x_(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const o=e[2]-e[0],a=e[3]-e[1];if(r&&this.annotationCanvasMap){i=i.slice(),i[4]-=e[0],i[5]-=e[1],e=e.slice(),e[0]=e[1]=0,e[2]=o,e[3]=a;const[l,c]=ze.singularValueDecompose2dScale(hn(this.ctx)),{viewportScale:u}=this,d=Math.ceil(o*this.outputScaleX*u),h=Math.ceil(a*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:f,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,a*c),x_(this.ctx)}else x_(this.ctx),this.endPath(),this.ctx.rect(e[0],e[1],o,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new sL(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),W(this,Gw,ak).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;t=this.getObject(t.data,t),t.count=e;const i=this.ctx,s=this.processingType3;if(s&&(s.compiled===void 0&&(s.compiled=Oae(t)),s.compiled)){s.compiled(i);return}const r=this._createMaskCanvas(t),o=r.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,r.offsetX,r.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,i=0,s=0,r,o){if(!this.contentVisible)return;t=this.getObject(t.data,t);const a=this.ctx;a.save();const l=hn(a);a.transform(e,i,s,r,0,0);const c=this._createMaskCanvas(t);a.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,d=o.length;u<d;u+=2){const h=ze.transform(l,[e,i,s,r,o[u],o[u+1]]),[f,p]=ze.applyTransform([0,0],h);a.drawImage(c.canvas,f,p)}a.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,s=this.current.patternFill;for(const r of t){const{data:o,width:a,height:l,transform:c}=r,u=this.cachedCanvases.getCanvas("maskCanvas",a,l),d=u.context;d.save();const h=this.getObject(o,r);oL(d,h),d.globalCompositeOperation="source-in",d.fillStyle=s?i.getPattern(d,this,wo(e),Li.FILL):i,d.fillRect(0,0,a,l),d.restore(),e.save(),e.transform(...c),e.scale(1,-1),T_(e,u.canvas,0,0,a,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);if(!e){ht("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e)}paintImageXObjectRepeat(t,e,i,s){if(!this.contentVisible)return;const r=this.getObject(t);if(!r){ht("Dependent image isn't ready yet");return}const o=r.width,a=r.height,l=[];for(let c=0,u=s.length;c<u;c+=2)l.push({transform:[e,0,0,i,s[c],s[c+1]],x:0,y:0,w:o,h:a});this.paintInlineImageXObjectGroup(r,l)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:e,width:i,height:s}=t,r=this.cachedCanvases.getCanvas("inlineImage",i,s),o=r.context;return o.filter=this.current.transferMaps,o.drawImage(e,0,0),o.filter="none",r.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,s=this.ctx;if(this.save(),!Ni){const{filter:a}=s;a!=="none"&&a!==""&&(s.filter="none")}s.scale(1/e,-1/i);let r;if(t.bitmap)r=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)r=t;else{const l=this.cachedCanvases.getCanvas("inlineImage",e,i).context;rL(l,t),r=this.applyTransferMapsToCanvas(l)}const o=this._scaleImage(r,wo(s));s.imageSmoothingEnabled=aL(hn(s),t.interpolate),T_(s,o.img,0,0,o.paintWidth,o.paintHeight,0,-i,e,i),this.compose(),this.restore(
212)}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let s;if(t.bitmap)s=t.bitmap;else{const r=t.width,o=t.height,l=this.cachedCanvases.getCanvas("inlineImage",r,o).context;rL(l,t),s=this.applyTransferMapsToCanvas(l)}for(const r of e)i.save(),i.transform(...r.transform),i.scale(1,-1),T_(i,s,r.x,r.y,r.w,r.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===lL?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=hn(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),s=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,s)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:i,c:s,d:r}=this.ctx.getTransform();let o,a;if(i===0&&s===0){const l=Math.abs(e),c=Math.abs(r);if(l===c)if(t===0)o=a=1/l;else{const u=l*t;o=a=u<1?1/u:1}else if(t===0)o=1/l,a=1/c;else{const u=l*t,d=c*t;o=u<1?1/u:1,a=d<1?1/d:1}}else{const l=Math.abs(e*r-i*s),c=Math.hypot(e,i),u=Math.hypot(s,r);if(t===0)o=u/l,a=c/l;else{const d=t*l;o=u>d?u/d:1,a=c>d?c/d:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[s,r]=this.getScaleForStroking();if(e.lineWidth=i||1,s===1&&r===1){e.stroke();return}const o=e.getLineDash();if(t&&e.save(),e.scale(s,r),o.length>0){const a=Math.max(s,r);e.setLineDash(o.map(l=>l/a)),e.lineDashOffset/=a}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};jw=new WeakSet,ok=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},Gw=new WeakSet,ak=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},Yw=new WeakSet,lk=function(t,e,i){const s=new Path2D;return s.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),s};let xf=kO;for(const n in Dr)xf.prototype[n]!==void 0&&(xf.prototype[Dr[n]]=xf.prototype[n]);var qw,Kw;class Qa{static get workerPort(){return g(this,qw)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");V(this,qw,t)}static get workerSrc(){return g(this,Kw)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");V(this,Kw,t)}}qw=new WeakMap,Kw=new WeakMap,F(Qa,qw,null),F(Qa,Kw,"");var dd,Xw;class Fae{constructor({parsedData:t,rawData:e}){F(this,dd,void 0);F(this,Xw,void 0);V(this,dd,t),V(this,Xw,e)}getRaw(){return g(this,Xw)}get(t){return g(this,dd).get(t)??null}getAll(){return aM(g(this,dd))}has(t){return g(this,dd).has(t)}}dd=new WeakMap,Xw=new WeakMap;const Zh=Symbol("INTERNAL");var Jw,Zw,Qw,ig;class Nae{constructor(t,{name:e,intent:i,usage:s,rbGroups:r}){F(this,Jw,!1);F(this,Zw,!1);F(this,Qw,!1);F(this,ig,!0);V(this,Jw,!!(t&Hs.DISPLAY)),V(this,Zw,!!(t&Hs.PRINT)),this.name=e,this.intent=i,this.usage=s,this.rbGroups=r}get visible(){if(g(this,Qw))return g(this,ig);if(!g(this,ig))return!1;const{print:t,view:e}=this.usage;return g(this,Jw)?(e==null?void 0:e.viewState)!=="OFF":g(this,Zw)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,e,i=!1){t!==Zh&&Xt("Internal method `_setVisible` called."),V(this,Qw,i),V(this,ig,e)}}Jw=new WeakMap,Zw=new WeakMap,Qw=new WeakMap,ig=new WeakMap;var Zl,zt,sg,rg,ev,ck;class Bae{constructor(t,e=Hs.DISPLAY){F(this,ev);F(this,Zl,null);F(this,zt,new Map);F(this,sg,null);F(this,rg,null);if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,V(this,rg,t.order);for(const i of t.groups)g(this,zt).set(i.id,new Nae(e,i));if(t.baseState==="OFF")for(const i of g(this,zt).values())i._setVisible(Zh,!1);for(const i of t.on)g(this,zt).get(i)._setVisible(Zh,!0);for(const i of t.off)g(this,zt).get(i)._setVisible(Zh,!1);V(this,sg,this.getHash())}}isVisible(t){if(g(this,zt).size===0)return!0;
212if(!t)return MT("Optional content group not defined."),!0;if(t.type==="OCG")return g(this,zt).has(t.id)?g(this,zt).get(t.id).visible:(ht(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return W(this,ev,ck).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!g(this,zt).has(e))return ht(`Optional content group not found: ${e}`),!0;if(g(this,zt).get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!g(this,zt).has(e))return ht(`Optional content group not found: ${e}`),!0;if(!g(this,zt).get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!g(this,zt).has(e))return ht(`Optional content group not found: ${e}`),!0;if(!g(this,zt).get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!g(this,zt).has(e))return ht(`Optional content group not found: ${e}`),!0;if(g(this,zt).get(e).visible)return!1}return!0}return ht(`Unknown optional content policy ${t.policy}.`),!0}return ht(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,i=!0){var r;const s=g(this,zt).get(t);if(!s){ht(`Optional content group not found: ${t}`);return}if(i&&e&&s.rbGroups.length)for(const o of s.rbGroups)for(const a of o)a!==t&&((r=g(this,zt).get(a))==null||r._setVisible(Zh,!1,!0));s._setVisible(Zh,!!e,!0),V(this,Zl,null)}setOCGState({state:t,preserveRB:e}){let i;for(const s of t){switch(s){case"ON":case"OFF":case"Toggle":i=s;continue}const r=g(this,zt).get(s);if(r)switch(i){case"ON":this.setVisibility(s,!0,e);break;case"OFF":this.setVisibility(s,!1,e);break;case"Toggle":this.setVisibility(s,!r.visible,e);break}}V(this,Zl,null)}get hasInitialVisibility(){return g(this,sg)===null||this.getHash()===g(this,sg)}getOrder(){return g(this,zt).size?g(this,rg)?g(this,rg).slice():[...g(this,zt).keys()]:null}getGroups(){return g(this,zt).size>0?aM(g(this,zt)):null}getGroup(t){return g(this,zt).get(t)||null}getHash(){if(g(this,Zl)!==null)return g(this,Zl);const t=new sz;for(const[e,i]of g(this,zt))t.update(`${e}:${i.visible}`);return V(this,Zl,t.hexdigest())}}Zl=new WeakMap,zt=new WeakMap,sg=new WeakMap,rg=new WeakMap,ev=new WeakSet,ck=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let s=1;s<e;s++){const r=t[s];let o;if(Array.isArray(r))o=W(this,ev,ck).call(this,r);else if(g(this,zt).has(r))o=g(this,zt).get(r).visible;else return ht(`Optional content group not found: ${r}`),!0;switch(i){case"And":if(!o)return!1;break;case"Or":if(o)return!0;break;case"Not":return!o;default:return!0}}return i==="And"};class Vae{constructor(t,{disableRange:e=!1,disableStream:i=!1}){Hn(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:r,progressiveDone:o,contentDispositionFilename:a}=t;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=a,(r==null?void 0:r.length)>0){const l=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!i,this._isRangeSupported=!e,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),t.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),t.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const i=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const s=this._rangeReaders.some(function(r){return r._begin!==t?!1:(r._enqueue(i),!0)});Hn(s,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var e,i,s,r;t.total===void 0?(i=(e=this._rangeReaders[0])==null?void 0:e.onProgress)==null||i.call(e,{loaded:t.loaded}):(r=(s=this._fullRequestReader)==null?void 0:s.onProgress)==null||r.call(s,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Hn(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Hae(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new zae(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class Hae{constructor(t,e,i=!1,s=null){this._stream=t,this._done=i||!1,this._filename=uM(s)?s:null,this._queuedChunks=e||[],this._loaded=0;for(const r of this._queuedChunks)this._loaded+=r.byteLength;
212this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class zae{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function $ae(n){let t=!0,e=i("filename\\*","i").exec(n);if(e){e=e[1];let u=a(e);return u=unescape(u),u=l(u),u=c(u),r(u)}if(e=o(n),e){const u=c(e);return r(u)}if(e=i("filename","i").exec(n),e){e=e[1];let u=a(e);return u=c(u),r(u)}function i(u,d){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function s(u,d){if(u){if(!/^[\x00-\xFF]+$/.test(d))return d;try{const h=new TextDecoder(u,{fatal:!0}),f=OT(d);d=h.decode(f),t=!1}catch{}}return d}function r(u){return t&&/[\x80-\xff]/.test(u)&&(u=s("utf-8",u),t&&(u=s("iso-8859-1",u))),u}function o(u){const d=[];let h;const f=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(h=f.exec(u))!==null;){let[,v,E,x]=h;if(v=parseInt(v,10),v in d){if(v===0)break;continue}d[v]=[E,x]}const p=[];for(let v=0;v<d.length&&v in d;++v){let[E,x]=d[v];x=a(x),E&&(x=unescape(x),v===0&&(x=l(x))),p.push(x)}return p.join("")}function a(u){if(u.startsWith('"')){const d=u.slice(1).split('\\"');for(let h=0;h<d.length;++h){const f=d[h].indexOf('"');f!==-1&&(d[h]=d[h].slice(0,f),d.length=h+1),d[h]=d[h].replaceAll(/\\(.)/g,"$1")}u=d.join('"')}return u}function l(u){const d=u.indexOf("'");if(d===-1)return u;const h=u.slice(0,d),p=u.slice(d+1).replace(/^[^']*'/,"");return s(h,p)}function c(u){return!u.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(u)?u:u.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(d,h,f,p){if(f==="q"||f==="Q")return p=p.replaceAll("_"," "),p=p.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,E){return String.fromCharCode(parseInt(E,16))}),s(h,p);try{p=atob(p)}catch{}return s(h,p)})}return""}function wz(n,t){const e=new Headers;if(!n||!t||typeof t!="object")return e;for(const i in t){const s=t[i];s!==void 0&&e.append(i,s)}return e}function LT(n){try{return new URL(n).origin}catch{}return null}function vz({responseHeaders:n,isHttp:t,rangeChunkSize:e,disableRange:i}){const s={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(n.get("Content-Length"),10);return!Number.isInteger(r)||(s.suggestedLength=r,r<=2*e)||i||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(s.allowRangeRequests=!0),s}function yz(n){const t=n.get("Content-Disposition");if(t){let e=$ae(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(uM(e))return e}return null}function FT(n,t){return n===404||n===0&&t.startsWith("file:")?new Ob('Missing PDF "'+t+'".'):new AE(`Unexpected server response
212(${n}) while retrieving PDF "${t}".`,n)}function _z(n){return n===200||n===206}function Ez(n,t,e){return{method:"GET",headers:n,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Sz(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(ht(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}class cL{constructor(t){y(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=wz(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return Hn(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Wae(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Uae(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Wae{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const i=new Headers(t.headers),s=e.url;fetch(s,Ez(i,this._withCredentials,this._abortController)).then(r=>{if(t._responseOrigin=LT(r.url),!_z(r.status))throw FT(r.status,s);this._reader=r.body.getReader(),this._headersCapability.resolve();const o=r.headers,{allowRangeRequests:a,suggestedLength:l}=vz({responseHeaders:o,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=yz(o),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Vc("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Sz(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}class Uae{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController;const r=new Headers(t.headers);r.append("Range",`bytes=${e}-${i-1}`);const o=s.url;fetch(o,Ez(r,this._withCredentials,this._abortController)).then(a=>{const l=LT(a.url);if(l!==t._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);if(!_z(a.status))throw FT(a.status,o);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:Sz(t),done:!1})}cancel(t){var e;(e=this._reader)==null||e.cancel(t),this._abortController.abort()}}const sA=200,rA=206;function jae(n){const t=n.response;return typeof t!="string"?t:OT(t).buffer}class Gae{constructor({url:t,httpHeaders:e,withCredentials:i}){y(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=wz(this.isHttp,e),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,s=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[r,o]of this.headers)e.setRequestHeader(r,o);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),s.expectedStatus=rA):s.expectedStatus=sA,e.responseType="arraybuffer",Hn(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),s.onHeadersReceived=t.onHeadersReceived,s.onDone=t.onDone,s.onError=t.onError,s.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var s;const i=this.pendingRequests[t];i&&((s=i.onProgress)==null||s.call(i,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const s=i.xhr;if(s.readyState>
212=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),s.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],s.status===0&&this.isHttp){i.onError(s.status);return}const r=s.status||sA;if(!(r===sA&&i.expectedStatus===rA)&&r!==i.expectedStatus){i.onError(s.status);return}const a=jae(s);if(r===rA){const l=s.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);c?i.onDone({begin:parseInt(c[1],10),chunk:a}):(ht('Missing or invalid "Content-Range" header.'),i.onError(0))}else a?i.onDone({begin:0,chunk:a}):i.onError(s.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class Yae{constructor(t){this._source=t,this._manager=new Gae(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return Hn(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new qae(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new Kae(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class qae{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=LT(e.responseURL);const i=e.getAllResponseHeaders(),s=new Headers(i?i.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[l,...c]=a.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:o}=vz({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=yz(s),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=FT(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;(e=this.onProgress)==null||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest
212(this._fullRequestId),this._fullRequestReader=null}}class Kae{constructor(t,e,i){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:i,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var e;const t=LT((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=FT(t,this._url));for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(e=this.onProgress)==null||e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Xae=/^[a-z][a-z0-9\-+.]+:/i;function Jae(n){if(Xae.test(n))return new URL(n);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}class Zae{constructor(t){this.source=t,this.url=Jae(t.url),Hn(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return Hn(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Qae(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new ele(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;(e=this._fullRequestReader)==null||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Qae{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const i=process.getBuiltinModule("fs");i.promises.lstat(this._url).then(s=>{this._contentLength=s.size,this._setReadableStream(i.createReadStream(this._url)),this._headersCapability.resolve()},s=>{s.code==="ENOENT"&&(s=new Ob(`Missing PDF "${this._url}".`)),this._storedError=s,this._headersCapability.reject(s)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Vc("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class ele{constructor(t,e,i){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const s=t.source;this._isStreamingSupported=!s.disableStream;const r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:e,end:i-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var i;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(i=this.onProgress)==null||i.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const tle=1e5,as=30,nle=.8;var A5,Ql,hs,tv,nv,hd,Ra,iv,sv,fd,og,ag,ec,lg,rv,cg,gd,ov,av,md,pd,lv,tc,ug,j1,Tz,G1,xz,cv,uk,dg,_0,uv,dk,Y1,Az,q1,Cz;const _n=class _n{constructor({textContentSource:t,container:e,viewport:i}){F(this,j1);F(this,G1);F(this,cv);F(this,Ql,Promise.withResolvers());F(this,hs,null);F(this,tv,!1);F(this,nv,!!((A5=globalThis.FontInspector)!=null&&A5.enabled));F(this,hd,null);F(this,Ra,null);F(this,iv,0);F(this,sv,0);F(this,fd,null);F(this,og,null);F(this,ag,0);F(this,ec,0);F(this,lg,Object.create(null));F(this,rv,[]);F(this,cg,null);F(this,gd,[]);F(this,ov,new WeakMap);F(this,av,null);var l;if(t instanceof ReadableStream)V(this,cg,t);else if(typeof t=="object")V(this,cg,new ReadableStream({start(c){c.enqueue(t),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');V(this,hs,V(this,og,e)),V(this,ec,i.scale*(globalThis.devicePixelRatio||1)),V(this,ag,i.rotation),V(this,Ra,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:r,pageX:o,pageY:a}=i.rawDims;V(this,av,[1,0,0,-1,-o,a+r]),V(this,sv,s),V(this,iv,r),W(l=_n,Y1,Az).call(l),hh(e,i),g(this,Ql).promise.finally(()=>{g(_n,ug).delete(this),V(this,Ra,null),V(this,lg,null)}
212).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=es.platform;return wt(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{g(this,fd).read().then(({value:e,done:i})=>{if(i){g(this,Ql).resolve();return}g(this,hd)??V(this,hd,e.lang),Object.assign(g(this,lg),e.styles),W(this,j1,Tz).call(this,e.items),t()},g(this,Ql).reject)};return V(this,fd,g(this,cg).getReader()),g(_n,ug).add(this),t(),g(this,Ql).promise}update({viewport:t,onBefore:e=null}){var r;const i=t.scale*(globalThis.devicePixelRatio||1),s=t.rotation;if(s!==g(this,ag)&&(e==null||e(),V(this,ag,s),hh(g(this,og),{rotation:s})),i!==g(this,ec)){e==null||e(),V(this,ec,i);const o={div:null,properties:null,ctx:W(r=_n,dg,_0).call(r,g(this,hd))};for(const a of g(this,gd))o.properties=g(this,ov).get(a),o.div=a,W(this,cv,uk).call(this,o)}}cancel(){var e;const t=new Vc("TextLayer task cancelled.");(e=g(this,fd))==null||e.cancel(t).catch(()=>{}),V(this,fd,null),g(this,Ql).reject(t)}get textDivs(){return g(this,gd)}get textContentItemsStr(){return g(this,rv)}static cleanup(){if(!(g(this,ug).size>0)){g(this,md).clear();for(const{canvas:t}of g(this,pd).values())t.remove();g(this,pd).clear()}}};Ql=new WeakMap,hs=new WeakMap,tv=new WeakMap,nv=new WeakMap,hd=new WeakMap,Ra=new WeakMap,iv=new WeakMap,sv=new WeakMap,fd=new WeakMap,og=new WeakMap,ag=new WeakMap,ec=new WeakMap,lg=new WeakMap,rv=new WeakMap,cg=new WeakMap,gd=new WeakMap,ov=new WeakMap,av=new WeakMap,md=new WeakMap,pd=new WeakMap,lv=new WeakMap,tc=new WeakMap,ug=new WeakMap,j1=new WeakSet,Tz=function(t){var s,r;if(g(this,tv))return;(r=g(this,Ra)).ctx??(r.ctx=W(s=_n,dg,_0).call(s,g(this,hd)));const e=g(this,gd),i=g(this,rv);for(const o of t){if(e.length>tle){ht("Ignoring additional textDivs for performance reasons."),V(this,tv,!0);return}if(o.str===void 0){if(o.type==="beginMarkedContentProps"||o.type==="beginMarkedContent"){const a=g(this,hs);V(this,hs,document.createElement("span")),g(this,hs).classList.add("markedContent"),o.id!==null&&g(this,hs).setAttribute("id",`${o.id}`),a.append(g(this,hs))}else o.type==="endMarkedContent"&&V(this,hs,g(this,hs).parentNode);continue}i.push(o.str),W(this,G1,xz).call(this,o)}},G1=new WeakSet,xz=function(t){var v;const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};g(this,gd).push(e);const s=ze.transform(g(this,av),t.transform);let r=Math.atan2(s[1],s[0]);const o=g(this,lg)[t.fontName];o.vertical&&(r+=Math.PI/2);let a=g(this,nv)&&o.fontSubstitution||o.fontFamily;a=_n.fontFamilyMap.get(a)||a;const l=Math.hypot(s[2],s[3]),c=l*W(v=_n,q1,Cz).call(v,a,g(this,hd));let u,d;r===0?(u=s[4],d=s[5]-c):(u=s[4]+c*Math.sin(r),d=s[5]-c*Math.cos(r));const h="calc(var(--scale-factor)*",f=e.style;g(this,hs)===g(this,og)?(f.left=`${(100*u/g(this,sv)).toFixed(2)}%`,f.top=`${(100*d/g(this,iv)).toFixed(2)}%`):(f.left=`${h}${u.toFixed(2)}px)`,f.top=`${h}${d.toFixed(2)}px)`),f.fontSize=`${h}${(g(_n,tc)*l).toFixed(2)}px)`,f.fontFamily=a,i.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,g(this,nv)&&(e.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),r!==0&&(i.angle=r*(180/Math.PI));let p=!1;if(t.str.length>1)p=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const E=Math.abs(t.transform[0]),x=Math.abs(t.transform[3]);E!==x&&Math.max(E,x)/Math.min(E,x)>1.5&&(p=!0)}if(p&&(i.canvasWidth=o.vertical?t.height:t.width),g(this,ov).set(e,i),g(this,Ra).div=e,g(this,Ra).properties=i,W(this,cv,uk).call(this,g(this,Ra)),i.hasText&&g(this,hs).append(e),i.hasEOL){const E=document.createElement("br");E.setAttribute("role","presentation"),g(this,hs).append(E)}},cv=new WeakSet,uk=function(t){var a;const{div:e,properties:i,ctx:s}=t,{style:r}=e;let o="";if(g(_n,tc)>1&&(o=`scale(${1/g(_n,tc)})`),i.canvasWidth!==0&&i.hasText){const{fontFamily:l}=r,{canvasWidth:c,fontSize:u}=i;W(a=_n,uv,dk).call(a,s,u*g(this,ec),l);const{width:d}=s.measureText(e.textContent);d>0&&(o=`scaleX(${c*g(this,ec)/d}) ${o}`)}i.angle!==0&&(o=`rotate(${i.angle}deg) ${o}`),o.length>0&&(r.transform=o)},dg=new WeakSet,_0=function(t=null){let e=g(this,pd).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),g(this,pd).set(t,e),g(this,lv).set(e,{size:0,family:""})}return e}
212,uv=new WeakSet,dk=function(t,e,i){const s=g(this,lv).get(t);e===s.size&&i===s.family||(t.font=`${e}px ${i}`,s.size=e,s.family=i)},Y1=new WeakSet,Az=function(){if(g(this,tc)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),V(this,tc,t.getBoundingClientRect().height),t.remove()},q1=new WeakSet,Cz=function(t,e){const i=g(this,md).get(t);if(i)return i;const s=W(this,dg,_0).call(this,e);s.canvas.width=s.canvas.height=as,W(this,uv,dk).call(this,s,as,t);const r=s.measureText("");let o=r.fontBoundingBoxAscent,a=Math.abs(r.fontBoundingBoxDescent);if(o){const u=o/(o+a);return g(this,md).set(t,u),s.canvas.width=s.canvas.height=0,u}s.strokeStyle="red",s.clearRect(0,0,as,as),s.strokeText("g",0,0);let l=s.getImageData(0,0,as,as).data;a=0;for(let u=l.length-1-3;u>=0;u-=4)if(l[u]>0){a=Math.ceil(u/4/as);break}s.clearRect(0,0,as,as),s.strokeText("A",0,as),l=s.getImageData(0,0,as,as).data,o=0;for(let u=0,d=l.length;u<d;u+=4)if(l[u]>0){o=as-Math.floor(u/4/as);break}s.canvas.width=s.canvas.height=0;const c=o?o/(o+a):nle;return g(this,md).set(t,c),c},F(_n,dg),F(_n,uv),F(_n,Y1),F(_n,q1),F(_n,md,new Map),F(_n,pd,new Map),F(_n,lv,new WeakMap),F(_n,tc,null),F(_n,ug,new Set);let Db=_n;class Rb{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};function s(r){var l;if(!r)return;let o=null;const a=r.name;if(a==="#text")o=r.value;else if(Rb.shouldBuildText(a))(l=r==null?void 0:r.attributes)!=null&&l.textContent?o=r.attributes.textContent:r.value&&(o=r.value);else return;if(o!==null&&e.push({str:o}),!!r.children)for(const c of r.children)s(c)}return s(t),i}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const ile=65536,sle=100,rle=5e3,ole=Ni?yae:bae,ale=Ni?_ae:hz,lle=Ni?vae:wae,cle=Ni?Eae:pz;function ule(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});const t=new hk,{docId:e}=t,i=n.url?dle(n.url):null,s=n.data?hle(n.data):null,r=n.httpHeaders||null,o=n.withCredentials===!0,a=n.password??null,l=n.range instanceof kz?n.range:null,c=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:ile;let u=n.worker instanceof Af?n.worker:null;const d=n.verbosity,h=typeof n.docBaseUrl=="string"&&!RT(n.docBaseUrl)?n.docBaseUrl:null,f=typeof n.cMapUrl=="string"?n.cMapUrl:null,p=n.cMapPacked!==!1,v=n.CMapReaderFactory||ale,E=typeof n.standardFontDataUrl=="string"?n.standardFontDataUrl:null,x=n.StandardFontDataFactory||cle,A=n.stopAtErrors!==!0,O=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,I=n.isEvalSupported!==!1,T=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!Ni,P=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!Ni&&(es.platform.isFirefox||!globalThis.chrome),k=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,D=typeof n.disableFontFace=="boolean"?n.disableFontFace:Ni,U=n.fontExtraProperties===!0,Y=n.enableXfa===!0,K=n.ownerDocument||globalThis.document,j=n.disableRange===!0,L=n.disableStream===!0,N=n.disableAutoFetch===!0,m=n.pdfBug===!0,_=n.CanvasFactory||ole,C=n.FilterFactory||lle,B=n.enableHWA===!0,$=l?l.length:n.length??NaN,X=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!Ni&&!D,Z=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:v===hz&&x===pz&&f&&E&&Ip(f,document.baseURI)&&Ip(E,document.baseURI),ie=null;Koe(d);const fe={canvasFactory:new _({ownerDocument:K,enableHWA:B}),filterFactory:new C({docId:e,ownerDocument:K}),cMapReaderFactory:Z?null:new v({baseUrl:f,isCompressed:p}),standardFontDataFactory:Z?null:new x({baseUrl:E})};if(!u){const he={verbosity:d,port:Qa.workerPort};u=he.port?Af.fromPort(he):new Af(he),t._worker=u}const ae={docId:e,apiVersion:"4.10.38",data:s,password:a,disableAutoFetch:N,rangeChunkSize:c,length:$,docBaseUrl:h,enableXfa:Y,evaluatorOptions:{maxImageSize:O,disableFontFace:D,ignoreErrors:A,isEvalSupported:I,isOffscreenCanvasSupported:T,isImageDecoderSupported:P,canvasMaxAreaInBytes:k,fontExtraProperties:U,useSystemFonts:X,cMapUrl:Z?f:null,standardFontDataUrl:Z?E:null}},ge={disableFontFace:D,fontExtraProperties:U,ownerDocument:K,pdfBug:m,styleElement:ie,loadingParams:{disableAutoFetch:N,enableXfa:Y}};return u.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");
212const he=u.messageHandler.sendWithPromise("GetDocRequest",ae,s?[s.buffer]:null);let ye;if(l)ye=new Vae(l,{disableRange:j,disableStream:L});else if(!s){if(!i)throw new Error("getDocument - no `url` parameter provided.");let et;if(Ni)if(Ip(i)){if(typeof fetch>"u"||typeof Response>"u"||!("body"in Response.prototype))throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");et=cL}else et=Zae;else et=Ip(i)?cL:Yae;ye=new et({url:i,length:$,httpHeaders:r,withCredentials:o,rangeChunkSize:c,disableRange:j,disableStream:L})}return he.then(et=>{if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const _e=new Dp(e,et,u.port),gt=new ple(_e,t,ye,ge,fe);t._transport=gt,_e.send("Ready",null)})}).catch(t._capability.reject),t}function dle(n){if(n instanceof URL)return n.href;try{return new URL(n,window.location).href}catch{if(Ni&&typeof n=="string")return n}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function hle(n){if(Ni&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return OT(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n==null?void 0:n.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function uL(n){return typeof n=="object"&&Number.isInteger(n==null?void 0:n.num)&&n.num>=0&&Number.isInteger(n==null?void 0:n.gen)&&n.gen>=0}var K1;const X1=class X1{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Gi(X1,K1)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var t,e,i,s;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((e=this._transport)==null?void 0:e.destroy())}catch(r){throw(i=this._worker)!=null&&i.port&&delete this._worker._pendingDestroy,r}this._transport=null,(s=this._worker)==null||s.destroy(),this._worker=null}};K1=new WeakMap,F(X1,K1,0);let hk=X1;class kz{constructor(t,e,i=!1,s=null){this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(const i of this._progressListeners)i(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(const e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){Xt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class fle{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return wt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}
212=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var nc,La,ic,Qh,hg,E0;class gle{constructor(t,e,i,s=!1){F(this,ic);F(this,hg);F(this,nc,null);F(this,La,!1);this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=s?new X2:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new Iz,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:s=0,dontFlip:r=!1}={}){return new Cy({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:r})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return wt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,viewport:e,intent:i="display",annotationMode:s=Ll.ENABLE,transform:r=null,background:o=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:d=!1}){var I,T;(I=this._stats)==null||I.time("Overall");const h=this._transport.getRenderingIntent(i,s,u,d),{renderingIntent:f,cacheKey:p}=h;V(this,La,!1),W(this,hg,E0).call(this),a||(a=this._transport.getOptionalContentConfig(f));let v=this._intentStates.get(p);v||(v=Object.create(null),this._intentStates.set(p,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const E=!!(f&Hs.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(T=this._stats)==null||T.time("Page Request"),this._pumpOperatorList(h));const x=P=>{var k;v.renderTasks.delete(A),(this._maybeCleanupAfterRender||E)&&V(this,La,!0),W(this,ic,Qh).call(this,!E),P?(A.capability.reject(P),this._abortOperatorList({intentState:v,reason:P instanceof Error?P:new Error(P)})):A.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(k=globalThis.Stats)!=null&&k.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},A=new gk({callback:x,params:{canvasContext:t,viewport:e,transform:r,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!E,pdfBug:this._pdfBug,pageColors:c});(v.renderTasks||(v.renderTasks=new Set)).add(A);const O=A.task;return Promise.all([v.displayReadyCapability.promise,a]).then(([P,k])=>{var D;if(this.destroyed){x();return}if((D=this._stats)==null||D.time("Rendering"),!(k.renderingIntent&f))throw new Error("Mu
212st use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");A.initializeGraphics({transparency:P,optionalContentConfig:k}),A.operatorListChanged()}).catch(x),O}getOperatorList({intent:t="display",annotationMode:e=Ll.ENABLE,printAnnotationStorage:i=null,isEditing:s=!1}={}){var c;function r(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(l))}const o=this._transport.getRenderingIntent(t,e,i,s,!0);let a=this._intentStates.get(o.cacheKey);a||(a=Object.create(null),this._intentStates.set(o.cacheKey,a));let l;return a.opListReadCapability||(l=Object.create(null),l.operatorListChanged=r,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(l),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(c=this._stats)==null||c.time("Page Request"),this._pumpOperatorList(o)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(s){return s.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Rb.textContent(i));const e=this.streamTextContent(t);return new Promise(function(i,s){function r(){o.read().then(function({value:l,done:c}){if(c){i(a);return}a.lang??(a.lang=l.lang),Object.assign(a.styles,l.styles),a.items.push(...l.items),r()},s)}const o=e.getReader(),a={items:[],styles:Object.create(null),lang:null};r()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),V(this,La,!1),W(this,hg,E0).call(this),Promise.all(t)}cleanup(t=!1){V(this,La,!0);const e=W(this,ic,Qh).call(this,!1);return t&&e&&this._stats&&(this._stats=new X2),e}_startRenderPage(t,e){var s,r;const i=this._intentStates.get(e);i&&((s=this._stats)==null||s.timeEnd("Page Request"),(r=i.displayReadyCapability)==null||r.resolve(t))}_renderPageChunk(t,e){for(let i=0,s=t.length;i<s;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&W(this,ic,Qh).call(this,!0)}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:i,modifiedIds:s}){const{map:r,transfer:o}=i,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r,modifiedIds:s},o).getReader(),c=this._intentStates.get(e);c.streamReader=l;const u=()=>{l.read().then(({value:d,done:h})=>{if(h){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),u())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(const h of c.renderTasks)h.operatorListChanged();W(this,ic,Qh).call(this,!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};u()}_abortOperatorList({intentState:t,reason:e,force:i=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!i){if(t.renderTasks.size>0)return;if(e instanceof cM){let s=sle;e.extraDelay>0&&e.extraDelay<1e3&&(s+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},s);return}}if(t.streamReader.cancel(new Vc(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[s,r]of this._intentStates)if(r===t){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}nc=new WeakMap,La=new WeakMap,ic=new WeakSet,Qh=function(t=!1){if(W(this,hg,E0).call(this),!g(this,La)||this.destroyed)return!1;if(t)return V(this,nc,setTimeout(()=>{V(this,nc,null),W(this,ic,Qh).call(this,!1)},rle)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),V(this,La,!1),!0},hg=new WeakSet,E0=function(){g(this,nc)&&(clearTimeout(g(this,nc)),V(this,nc,null))};var Fa,J1;class mle{constructor(){F(this,Fa,new Map);F(this,J1,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};g(this,J1).then(()=>{for(const[s]of g(this,Fa))s.call(this,i)})}addEventListener(t,e,i=null){let s=null;if((i==null?void 0:i.signal)instanceof AbortSignal){const{signal:r}=i;if(r.aborted){ht("LoopbackPort - cannot use an `aborted` signal.");return}const o=()=>this.removeEventListener(t,e);s=()=>r.removeEventListener("abort",o),r.addEventListener("abort",o)}g(this,Fa).set(e,s)}removeEventListener(t,e){const i=g(this,Fa).get(e);i==null||i(),g(this,Fa).delete(e)}terminate(){for(const[,t]of g(this,Fa))t==null||t();g(this,Fa).clear()}}Fa=new WeakMap,J1=new WeakMap;var Z1,bd,wd,fg,S0,gg,T0;const dn=class dn{constructor({name:t=null,port:e=null,verbosity:i=Xoe()}={}){F(this,fg);var s;if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){if((s=g(dn,wd))!=null&&s.has(e))throw new Error("Cannot use more than one PDFWorker per port.");
212(g(dn,wd)||V(dn,wd,new WeakMap)).set(e,this),this._initializeFromPort(e);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new Dp("main","worker",t),this._messageHandler.on("ready",function(){}),W(this,fg,S0).call(this)}_initialize(){if(g(dn,bd)||g(dn,gg,T0)){this._setupFakeWorker();return}let{workerSrc:t}=dn;try{dn._isSameOrigin(window.location.href,t)||(t=dn._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Dp("main","worker",e),s=()=>{r.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=new AbortController;e.addEventListener("error",()=>{this._webWorker||s()},{signal:r.signal}),i.on("test",a=>{if(r.abort(),this.destroyed||!a){s();return}this._messageHandler=i,this._port=e,this._webWorker=e,W(this,fg,S0).call(this)}),i.on("ready",a=>{if(r.abort(),this.destroyed){s();return}try{o()}catch{this._setupFakeWorker()}});const o=()=>{const a=new Uint8Array;i.send("test",a,[a.buffer])};o();return}catch{MT("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){g(dn,bd)||(ht("Setting up fake worker."),V(dn,bd,!0)),dn._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new mle;this._port=e;const i=`fake${Gi(dn,Z1)._++}`,s=new Dp(i+"_worker",i,e);t.setup(s,e),this._messageHandler=new Dp(i,i+"_worker",e),W(this,fg,S0).call(this)}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){var t,e,i;this.destroyed=!0,(t=this._webWorker)==null||t.terminate(),this._webWorker=null,(e=g(dn,wd))==null||e.delete(this._port),this._port=null,(i=this._messageHandler)==null||i.destroy(),this._messageHandler=null}static fromPort(t){var i;if(!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const e=(i=g(this,wd))==null?void 0:i.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new dn(t)}static get workerSrc(){if(Qa.workerSrc)return Qa.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return wt(this,"_setupFakeWorkerGlobal",(async()=>g(this,gg,T0)?g(this,gg,T0):(await Uoe(()=>import(this.workerSrc),[])).WorkerMessageHandler)())}};Z1=new WeakMap,bd=new WeakMap,wd=new WeakMap,fg=new WeakSet,S0=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},gg=new WeakSet,T0=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},F(dn,gg),F(dn,Z1,0),F(dn,bd,!1),F(dn,wd,void 0),Ni&&(V(dn,bd,!0),Qa.workerSrc||(Qa.workerSrc="./pdf.worker.mjs")),dn._isSameOrigin=(t,e)=>{let i;try{if(i=new URL(t),!i.origin||i.origin==="null")return!1}catch{return!1}const s=new URL(e,i);return i.origin===s.origin},dn._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};let Af=dn;var Na,No,mg,pg,Ba,vd,Bp;class ple{constructor(t,e,i,s,r){F(this,vd);F(this,Na,new Map);F(this,No,new Map);F(this,mg,new Map);F(this,pg,new Map);F(this,Ba,null);this.messageHandler=t,this.loadingTask=e,this.commonObjs=new Iz,this.fontLoader=new mae({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return wt(this,"annotationStorage",new fM)}
212getRenderingIntent(t,e=Ll.ENABLE,i=null,s=!1,r=!1){let o=Hs.DISPLAY,a=tk;switch(t){case"any":o=Hs.ANY;break;case"display":break;case"print":o=Hs.PRINT;break;default:ht(`getRenderingIntent - invalid intent: ${t}`)}const l=o&Hs.PRINT&&i instanceof oz?i:this.annotationStorage;switch(e){case Ll.DISABLE:o+=Hs.ANNOTATIONS_DISABLE;break;case Ll.ENABLE:break;case Ll.ENABLE_FORMS:o+=Hs.ANNOTATIONS_FORMS;break;case Ll.ENABLE_STORAGE:o+=Hs.ANNOTATIONS_STORAGE,a=l.serializable;break;default:ht(`getRenderingIntent - invalid annotationMode: ${e}`)}s&&(o+=Hs.IS_EDITING),r&&(o+=Hs.OPLIST);const{ids:c,hash:u}=l.modifiedIds,d=[o,a.hash,u];return{renderingIntent:o,cacheKey:d.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){var i;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(i=g(this,Ba))==null||i.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const s of g(this,No).values())t.push(s._destroy());g(this,No).clear(),g(this,mg).clear(),g(this,pg).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{var s,r;this.commonObjs.clear(),this.fontLoader.clear(),g(this,Na).clear(),this.filterFactory.destroy(),Db.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new Vc("Worker was terminated.")),(r=this.messageHandler)==null||r.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(i,s)=>{Hn(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},s.onPull=()=>{this._fullReader.read().then(function({value:r,done:o}){if(o){s.close();return}Hn(r instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{s.error(r)})},s.onCancel=r=>{this._fullReader.cancel(r),s.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("ReaderHeadersReady",async i=>{var a;await this._fullReader.headersReady;const{isStreamingSupported:s,isRangeSupported:r,contentLength:o}=this._fullReader;return(!s||!r)&&(this._lastProgress&&((a=e.onProgress)==null||a.call(e,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=e.onProgress)==null||c.call(e,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:s,isRangeSupported:r,contentLength:o}}),t.on("GetRangeReader",(i,s)=>{Hn(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(i.begin,i.end);if(!r){s.close();return}s.onPull=()=>{r.read().then(function({value:o,done:a}){if(a){s.close();return}Hn(o instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{s.error(o)})},s.onCancel=o=>{r.cancel(o),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),t.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new fle(i,this))}),t.on("DocException",i=>{e._capability.reject(ls(i))}),t.on("PasswordRequest",i=>{V(this,Ba,Promise.withResolvers());try{if(!e.onPassword)throw ls(i);const s=r=>{r instanceof Error?g(this,Ba).reject(r):g(this,Ba).resolve({password:r})};e.onPassword(s,i.code)}catch(s){g(this,Ba).reject(s)}return g(this,Ba).promise}),t.on("DataLoaded",i=>{var s;(s=e.onProgress)==null||s.call(e,{loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),t.on("StartRenderPage",i=>{if(this.destroyed)return;g(this,No).get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),t.on("commonobj",([i,s,r])=>{var o;if(this.destroyed||this.commonObjs.has(i))return null;switch(s){case"Font":const{disableFontFace:a,fontExtraProperties:l,pdfBug:c}=this._params;if("error"in r){const f=r.error;ht(`Error during font loading: ${f}`),this.commonObjs.resolve(i,f);break}const u=c&&((o=globalThis.FontInspector)!=null&&o.enabled)?(f,p)=>globalThis.FontInspector.fontAdded(f,p):null,d=new pae(r,{disableFontFace:a,fontExtraProperties:l,inspectFont:u});this.fontLoader.bind(d).catch(()=>
212t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!l&&d.data&&(d.data=null),this.commonObjs.resolve(i,d)});break;case"CopyLocalImage":const{imageRef:h}=r;Hn(h,"The imageRef must be defined.");for(const f of g(this,No).values())for(const[,p]of f.objs)if((p==null?void 0:p.ref)===h)return p.dataLen?(this.commonObjs.resolve(i,structuredClone(p)),p.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,r);break;default:throw new Error(`Got unknown common object type ${s}`)}return null}),t.on("obj",([i,s,r,o])=>{var l;if(this.destroyed)return;const a=g(this,No).get(s);if(!a.objs.has(i)){if(a._intentStates.size===0){(l=o==null?void 0:o.bitmap)==null||l.close();return}switch(r){case"Image":a.objs.resolve(i,o),(o==null?void 0:o.dataLen)>joe&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(i,o);break;default:throw new Error(`Got unknown object type ${r}`)}}}),t.on("DocProgress",i=>{var s;this.destroyed||(s=e.onProgress)==null||s.call(e,{loaded:i.loaded,total:i.total})}),t.on("FetchBuiltInCMap",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(i)}),t.on("FetchStandardFontData",async i=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(i)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var i;this.annotationStorage.size<=0&&ht("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((i=this._fullReader)==null?void 0:i.filename)??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=g(this,mg).get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&g(this,pg).set(r.refStr,t);const o=new gle(e,r,this,this._params.pdfBug);return g(this,No).set(e,o),o});return g(this,mg).set(e,s),s}getPageIndex(t){return uL(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return W(this,vd,Bp).call(this,"GetFieldObjects")}hasJSActions(){return W(this,vd,Bp).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return W(this,vd,Bp).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return W(this,vd,Bp).call(this,"GetOptionalContentConfig").then(e=>new Bae(e,t))}
212getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=g(this,Na).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then(s=>{var r,o;return{info:s[0],metadata:s[1]?new Fae(s[1]):null,contentDispositionFilename:((r=this._fullReader)==null?void 0:r.filename)??null,contentLength:((o=this._fullReader)==null?void 0:o.contentLength)??null}});return g(this,Na).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of g(this,No).values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),g(this,Na).clear(),this.filterFactory.destroy(!0),Db.cleanup()}}cachedPageNumber(t){if(!uL(t))return null;const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return g(this,pg).get(e)??null}}Na=new WeakMap,No=new WeakMap,mg=new WeakMap,pg=new WeakMap,Ba=new WeakMap,vd=new WeakSet,Bp=function(t,e=null){const i=g(this,Na).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return g(this,Na).set(t,s),s};const cp=Symbol("INITIAL_DATA");var Ms,dv,fk;class Iz{constructor(){F(this,dv);F(this,Ms,Object.create(null))}get(t,e=null){if(e){const s=W(this,dv,fk).call(this,t);return s.promise.then(()=>e(s.data)),null}const i=g(this,Ms)[t];if(!i||i.data===cp)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=g(this,Ms)[t];return!!e&&e.data!==cp}delete(t){const e=g(this,Ms)[t];return!e||e.data===cp?!1:(delete g(this,Ms)[t],!0)}resolve(t,e=null){const i=W(this,dv,fk).call(this,t);i.data=e,i.resolve()}clear(){var t;for(const e in g(this,Ms)){const{data:i}=g(this,Ms)[e];(t=i==null?void 0:i.bitmap)==null||t.close()}V(this,Ms,Object.create(null))}*[Symbol.iterator](){for(const t in g(this,Ms)){const{data:e}=g(this,Ms)[t];e!==cp&&(yield[t,e])}}}Ms=new WeakMap,dv=new WeakSet,fk=function(t){var e;return(e=g(this,Ms))[t]||(e[t]={...Promise.withResolvers(),data:cp})};var sc;class ble{constructor(t){F(this,sc,null);V(this,sc,t),this.onContinue=null}get promise(){return g(this,sc).capability.promise}cancel(t=0){g(this,sc).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=g(this,sc).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=g(this,sc);return t.form||t.canvas&&(e==null?void 0:e.size)>0}}sc=new WeakMap;var rc,yd;const Au=class Au{constructor({callback:t,params:e,objs:i,commonObjs:s,annotationCanvasMap:r,operatorList:o,pageIndex:a,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:h=null}){F(this,rc,null);this.callback=t,this.params=e,this.objs=i,this.commonObjs=s,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new ble(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){var a,l;if(this.cancelled)return;if(this._canvas){if(g(Au,yd).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");g(Au,yd).add(this._canvas)}this._pdfBug&&((a=globalThis.StepperManager)!=null&&a.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:i,viewport:s,transform:r,background:o}=this.params;this.gfx=new xf(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:s,transparency:t,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,(l=this.graphicsReadyCallback)==null||l.call(this)}cancel(t=null,e=0){var i;this.running=!1,this.cancelled=!0,(i=this.gfx)==null||i.endDrawing(),g(this,rc)&&(window.cancelAnimationFrame(g(this,rc)
212),V(this,rc,null)),g(Au,yd).delete(this._canvas),this.callback(t||new cM(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){var t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.stepper)==null||t.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?V(this,rc,window.requestAnimationFrame(()=>{V(this,rc,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),g(Au,yd).delete(this._canvas),this.callback())))}};rc=new WeakMap,yd=new WeakMap,F(Au,yd,new WeakSet);let gk=Au;const wle="4.10.38",vle="f9bea397f";function dL(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function up(n){return Math.max(0,Math.min(255,255*n))}class hL{static CMYK_G([t,e,i,s]){return["G",1-Math.min(1,.3*t+.59*i+.11*e+s)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=up(t),[t,t,t]}static G_HTML([t]){const e=dL(t);return`#${e}${e}${e}`}static RGB_G([t,e,i]){return["G",.3*t+.59*e+.11*i]}static RGB_rgb(t){return t.map(up)}static RGB_HTML(t){return`#${t.map(dL).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,i,s]){return["RGB",1-Math.min(1,t+s),1-Math.min(1,i+s),1-Math.min(1,e+s)]}static CMYK_rgb([t,e,i,s]){return[up(1-Math.min(1,t+s)),up(1-Math.min(1,i+s)),up(1-Math.min(1,e+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,i]){const s=1-t,r=1-e,o=1-i,a=Math.min(s,r,o);return["CMYK",s,r,o,a]}}class yle{create(t,e,i=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),i||(s.setAttribute("width",`${t}px`),s.setAttribute("height",`${e}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${t} ${e}`),s}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Xt("Abstract method `_createSVG` called.")}}class mM extends yle{_createSVG(t){return document.createElementNS(fa,t)}}class Pz{static setupStorage(t,e,i,s,r){const o=s.getValue(e,{value:null});switch(i.name){case"textarea":if(o.value!==null&&(t.textContent=o.value),r==="print")break;t.addEventListener("input",a=>{s.setValue(e,{value:a.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(o.value===i.attributes.xfaOn?t.setAttribute("checked",!0):o.value===i.attributes.xfaOff&&t.removeAttribute("checked"),r==="print")break;t.addEventListener("change",a=>{s.setValue(e,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(o.value!==null&&t.setAttribute("value",o.value),r==="print")break;t.addEventListener("input",a=>{s.setValue(e,{value:a.target.value})})}break;case"select":if(o.value!==null){t.setAttribute("value",o.value);for(const a of i.children)a.attributes.value===o.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}t.addEventListener("input",a=>{const l=a.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;s.setValue(e,{value:c})});break}}static setAttributes({html:t,element:e,storage:i=null,intent:s,linkService:r}){const{attributes:o}=e,a=t instanceof HTMLAnchorElement;o.type==="radio"&&(o.name=`${o.name}-${s}`);for(const[l,c]of Object.entries(o))if(c!=null)switch(l){case"class":c.length&&t.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!a||l!=="href"&&l!=="newWindow")&&t.setAttribute(l,c)}a&&r.addLinkAttributes(t,o.href,o.newWindow),i&&o.dataId&&this.setupStorage(t,o.dataId,e,i)}static render(t){var d,h;const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,r=t.intent||"display",o=document.createElement(s.name);s.attributes&&this.setAttributes({html:o,element:s,intent:r,linkService:i});const a=r!=="richText",l=t.div;if(l.append(o),t.viewport){const f=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=f}a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(s.children.length===0){if(s.value){const f=document.createTextNode(s.value);o.append(f),a&&Rb.shouldBuildText(s.name)&&c.push(f)}return{textDivs:c}}const u=[[s,-1,o]];for(;u.length>0;){const[f,p,v]=u.at(-1);if(p+1===f.children.length){u.pop();continue}const E=f.children[++u.at(-1)[1]];if(E===null)continue;const{name:x}=E;if(x==="#text"){const O=document.createTextNode(E.value);c.push(O),v.append(O);continue}const A=(d=E==null?void 0:E.attributes)!=null&&d.xmlns?document.createElementNS(E.attributes.xmlns,x):document.createElement(x);if(v.append(A),E.attributes&&this.setAttributes({html:A,element:E,storage:e,intent:r,linkService:i}),((h=E.children)==null?void 0:h.length)>0)u.push([E,-1,A]);else if(E.value){const O=document.createTextNode(E.value);a&&Rb.shouldBuildText(x)&&c.push(O),A.append(O)}}for(const f of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))f.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const Iy=1e3,_le=9,gh=new WeakSet;function Oc(n){return{width:n[2]-n[0],height:n[3]-n[1]}}class Ele{static create(t){switch(t.data.annotationType){case Gn.LINK:return new Mz(t);case Gn.TEXT:return new Sle(t);case Gn.WIDGET:switch(t.data.fieldType){case"Tx":return new Tle(t);case"Btn":return t.data.radioButton?new Rz(t):t.data.checkBox?new Ale(t):new Cle(t);case"Ch":return new kle(t);case"Sig":return new xle(t)}return new Th(t);case Gn.POPUP:return new pk(t);case Gn.FREETEXT:return new Vz(t);case Gn.LINE:return new Ple(t);case Gn.SQUARE:return new Mle(t);case Gn.CIRCLE:return new Ole(t);case Gn.POLYLINE:return new Hz(t);case Gn.CARET:return new Rle(t);case Gn.INK:return new pM(t);case Gn.POLYGON:return new Dle(t);case Gn.HIGHLIGHT:return new zz(t);case Gn.UNDERLINE:return new Lle(t);case Gn.SQUIGGLY:return new Fle(t);case Gn.STRIKEOUT:return new Nle(t);case Gn.STAMP:return new $z(t);case Gn.FILEATTACHMENT:return new Ble(t);default:return new Nn(t)}}}var _d,bg,wg,hv,mk;const IO=class IO{constructor(t,{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}={}){F(this,hv);F(this,_d,null);F(this,bg,!1);F(this,wg,null);this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),s&&this._createQuadrilaterals()}static _hasPopupData({titleObj:t,contentsObj:e,richText:i}){return!!(t!=null&&t.str||e!=null&&e.str||i!=null&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return IO._hasPopupData(this.data)}updateEdited(t){var i;if(!this.container)return;g(this,_d)||V(this,_d,{rect:this.data.rect.slice(0)});const{rect:e}=t;e&&W(this,hv,mk).call(this,e),(i=g(this,wg))==null||i.popup.updateEdited(t)}resetEdited(){var t;g(this,_d)&&(W(this,hv,mk).call(this,g(this,_d).rect),(t=g(this,wg))==null||t.popup.resetEdited(),V(this,_d,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:s}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",e.id),this instanceof Th||(r.tabIndex=Iy);const{style:o}=r;if(o.zIndex=this.parent.zIndex++,e.alternativeText&&(r.title=e.alternativeText),e.noRotate&&r.classList.add("norotate"),!e.rect||this instanceof pk){const{rotation:v}=e;return!e.hasOwnCanvas&&v!==0&&this.setRotation(v,r),r}const{width:a,height:l}=Oc(e.rect);if(!t&&e.borderStyle.width>0){o.borderWidth=`${e.borderStyle.width}px`;const v=e.borderStyle.horizontalCornerRadius,E=e.borderStyle.verticalCornerRadius;if(v>0||E>0){const A=`calc(${v}px * var(--scale-factor)) / calc(${E}px * var(--scale-factor))`;o.borderRadius=A}else if(this instanceof Rz){const A=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;o.borderRadius=A}switch(e.borderStyle.style){case ap.SOLID:o.borderStyle="solid";break;case ap.DASHED:o.borderStyle="dashed";break;case ap.BEVELED:ht("Unimplemented border style: beveled");break;case ap.INSET:ht("Unimplemented border style: inset");break;case ap.UNDERLINE:o.borderBottomStyle="solid";break}const x=e.borderColor||null;x?(V(this,bg,!0),o.borderColor=ze.makeHexColor(x[0]|0,x[1]|0,x[2]|0)):o.borderWidth=0}const c=ze.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:u,pageHeight:d,pageX:h,pageY:f}=s.rawDims;o.left=`${100*(c[0]-h)/u}%`,o.top=`${100*(c[1]-f)/d}%`;const{rotation:p}=e;return e.hasOwnCanvas||p===0?(o.width=`${100*a/u}%`,o.height=`${100*l/d}%`):this.setRotation(p,r),r}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:i,pageHeight:s}=this.parent.viewport.rawDims,{width:r,height:o}=Oc(this.data.rect);let a,l;t%180===0?(a=100*r/i,l=100*o/s):(a=100*o/i,l=100*r/s),e.style.width=`${a}%`,e.style.height=`${l}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,i,s)=>{const r=s.detail[e],o=r[0],a=r.slice(1);s.target.style[i]=hL[`${o}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[i]:hL[`${o}_rgb`](a)})};return wt(this,"_commonActions",{display:e=>{const{display:i}=e.detail,s=i%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,noPrint:i===1||i===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:i}=e.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:e=>{setTimeout(()=>
212e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const i=e.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const s of Object.keys(e.detail)){const r=t[s]||i[s];r==null||r(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[s,r]of Object.entries(e)){const o=i[s];if(o){const a={detail:{[s]:r},target:t};o(a),delete e[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,s,r]=this.data.rect.map(v=>Math.fround(v));if(t.length===8){const[v,E,x,A]=t.subarray(2,6);if(s===v&&r===E&&e===x&&i===A)return}const{style:o}=this.container;let a;if(g(this,bg)){const{borderColor:v,borderWidth:E}=o;o.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${v}" stroke-width="${E}">`],this.container.classList.add("hasBorder")}const l=s-e,c=r-i,{svgFactory:u}=this,d=u.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const h=u.createElement("defs");d.append(h);const f=u.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),h.append(f);for(let v=2,E=t.length;v<E;v+=8){const x=t[v],A=t[v+1],O=t[v+2],I=t[v+3],T=u.createElement("rect"),P=(O-e)/l,k=(r-A)/c,D=(x-O)/l,U=(A-I)/c;T.setAttribute("x",P),T.setAttribute("y",k),T.setAttribute("width",D),T.setAttribute("height",U),f.append(T),a==null||a.push(`<rect vector-effect="non-scaling-stroke" x="${P}" y="${k}" width="${D}" height="${U}"/>`)}g(this,bg)&&(a.push("</g></svg>')"),o.backgroundImage=a.join("")),this.container.append(d),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{data:t}=this,e=V(this,wg,new pk({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(e.render())}render(){Xt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const i=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:r,id:o,exportValues:a}of s){if(r===-1||o===e)continue;const l=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${o}"]`);if(c&&!gh.has(c)){ht(`_getElementsByName - element not allowed: ${o}`);continue}i.push({id:o,exportValue:l,domElement:c})}return i}for(const s of document.getElementsByName(t)){const{exportValue:r}=s,o=s.getAttribute("data-element-id");o!==e&&gh.has(s)&&i.push({id:o,exportValue:r,domElement:s})}return i}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{var i;(i=this.linkService.eventBus)==null||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}};_d=new WeakMap,bg=new WeakMap,wg=new WeakMap,hv=new WeakSet,mk=function(t){const{container:{style:e},data:{rect:i,rotation:s},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:o,pageX:a,pageY:l}}}}=this;i==null||i.splice(0,4,...t);const{width:c,height:u}=Oc(t);e.left=`${100*(t[0]-a)/r}%`,e.top=`${100*(o-t[3]+l)/o}%`,s===0?(e.width=`${100*c/r}%`,e.height=`${100*u/o}%`):this.setRotation(s)};let Nn=IO;
212var Va,yu,Q1,Oz,eS,Dz;class Mz extends Nn{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0});F(this,Va);F(this,Q1);F(this,eS);this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,s=document.createElement("a");s.setAttribute("data-element-id",e.id);let r=!1;return e.url?(i.addLinkAttributes(s,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(s,e.action),r=!0):e.attachment?(W(this,Q1,Oz).call(this,s,e.attachment,e.attachmentDest),r=!0):e.setOCGState?(W(this,eS,Dz).call(this,s,e.setOCGState),r=!0):e.dest?(this._bindLink(s,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,e),r=!0),e.resetForm?(this._bindResetFormAction(s,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(s,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(s),this.container}_bindLink(e,i){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&W(this,Va,yu).call(this)}_bindNamedAction(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),W(this,Va,yu).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(i.actions)){const o=s.get(r);o&&(e[o]=()=>{var a;return(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:r}}),!1})}e.onclick||(e.onclick=()=>!1),W(this,Va,yu).call(this)}_bindResetFormAction(e,i){const s=e.onclick;if(s||(e.href=this.linkService.getAnchorUrl("")),W(this,Va,yu).call(this),!this._fieldObjects){ht('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(e.onclick=()=>!1);return}e.onclick=()=>{var d;s==null||s();const{fields:r,refs:o,include:a}=i,l=[];if(r.length!==0||o.length!==0){const h=new Set(o);for(const f of r){const p=this._fieldObjects[f]||[];for(const{id:v}of p)h.add(v)}for(const f of Object.values(this._fieldObjects))for(const p of f)h.has(p.id)===a&&l.push(p)}else for(const h of Object.values(this._fieldObjects))l.push(...h);const c=this.annotationStorage,u=[];for(const h of l){const{id:f}=h;switch(u.push(f),h.type){case"text":{const v=h.defaultValue||"";c.setValue(f,{value:v});break}case"checkbox":case"radiobutton":{const v=h.defaultValue===h.exportValues;c.setValue(f,{value:v});break}case"combobox":case"listbox":{const v=h.defaultValue||"";c.setValue(f,{value:v});break}default:continue}const p=document.querySelector(`[data-element-id="${f}"]`);if(p){if(!gh.has(p)){ht(`_bindResetFormAction - element not allowed: ${f}`);continue}}else continue;p.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((d=this.linkService.eventBus)==null||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}})),!1}}}Va=new WeakSet,yu=function(){this.container.setAttribute("data-internal-link","")},Q1=new WeakSet,Oz=function(e,i,s=null){e.href=this.linkService.getAnchorUrl(""),i.description&&(e.title=i.description),e.onclick=()=>{var r;return(r=this.downloadManager)==null||r.openOrDownloadData(i.content,i.filename,s),!1},W(this,Va,yu).call(this)},eS=new WeakSet,Dz=function(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(i),!1),W(this,Va,yu).call(this)};class Sle extends Nn{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Th extends Nn{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&(((e=t.previousSibling)==null?void 0:e.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return es.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,s,r){i.includes("mouse")?t.addEventListener(i,o=>{var a;(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:r(o),shift:o.shift
212Key,modifier:this._getKeyModifier(o)}})}):t.addEventListener(i,o=>{var a;if(i==="blur"){if(!e.focused||!o.relatedTarget)return;e.focused=!1}else if(i==="focus"){if(e.focused)return;e.focused=!0}r&&((a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:r(o)}}))})}_setEventListeners(t,e,i,s){var r,o,a;for(const[l,c]of i)(c==="Action"||(r=this.data.actions)!=null&&r[c])&&((c==="Focus"||c==="Blur")&&(e||(e={focused:!1})),this._setEventListener(t,e,l,c,s),c==="Focus"&&!((o=this.data.actions)!=null&&o.Blur)?this._setEventListener(t,e,"blur","Blur",null):c==="Blur"&&!((a=this.data.actions)!=null&&a.Focus)&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":ze.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||_le,r=t.style;let o;const a=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),u=Math.round(c/(Qx*s))||1,d=c/u;o=Math.min(s,l(d/Qx))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);o=Math.min(s,l(c/Qx))}r.fontSize=`calc(${o}px * var(--scale-factor))`,r.color=ze.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(r.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Tle extends Th{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,i,s){const r=this.annotationStorage;
212for(const o of this._getElementsByName(t.name,t.id))o.domElement&&(o.domElement[e]=i),r.setValue(o.id,{[s]:i})}render(){var s,r;const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){const o=t.getValue(e,{value:this.data.fieldValue});let a=o.value||"";const l=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;l&&a.length>l&&(a=a.slice(0,l));let c=o.formattedValue||((s=this.data.textContent)==null?void 0:s.join(` 213`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const u={userValue:a,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=c??a,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",c??a),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),gh.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Iy,this._setRequired(i,this.data.required),l&&(i.maxLength=l),i.addEventListener("input",h=>{t.setValue(e,{value:h.target.value}),this.setPropertyOnSiblings(i,"value",h.target.value,"value"),u.formattedValue=null}),i.addEventListener("resetform",h=>{const f=this.data.defaultFieldValue??"";i.value=u.userValue=f,u.formattedValue=null});let d=h=>{const{formattedValue:f}=u;f!=null&&(h.target.value=f),h.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",f=>{var v;if(u.focused)return;const{target:p}=f;u.userValue&&(p.value=u.userValue),u.lastCommittedValue=p.value,u.commitKey=1,(v=this.data.actions)!=null&&v.Focus||(u.focused=!0)}),i.addEventListener("updatefromsandbox",f=>{this.showElementAndHideCanvas(f.target);const p={value(v){u.userValue=v.detail.value??"",t.setValue(e,{value:u.userValue.toString()}),v.target.value=u.userValue},formattedValue(v){const{formattedValue:E}=v.detail;u.formattedValue=E,E!=null&&v.target!==document.activeElement&&(v.target.value=E),t.setValue(e,{formattedValue:E})},selRange(v){v.target.setSelectionRange(...v.detail.selRange)},charLimit:v=>{var O;const{charLimit:E}=v.detail,{target:x}=v;if(E===0){x.removeAttribute("maxLength");return}x.setAttribute("maxLength",E);let A=u.userValue;!A||A.length<=E||(A=A.slice(0,E),x.value=u.userValue=A,t.setValue(e,{value:A}),(O=this.linkService.eventBus)==null||O.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:A,willCommit:!0,commitKey:1,selStart:x.selectionStart,selEnd:x.selectionEnd}}))}};this._dispatchEventFromSandbox(p,f)}),i.addEventListener("keydown",f=>{var E;u.commitKey=1;let p=-1;if(f.key==="Escape"?p=0:f.key==="Enter"&&!this.data.multiLine?p=2:f.key==="Tab"&&(u.commitKey=3),p===-1)return;const{value:v}=f.target;u.lastCommittedValue!==v&&(u.lastCommittedValue=v,u.userValue=v,(E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:v,willCommit:!0,commitKey:p,selStart:f.target.selectionStart,selEnd:f.target.selectionEnd}}))});const h=d;d=null,i.addEventListener("blur",f=>{var v,E;if(!u.focused||!f.relatedTarget)return;(v=this.data.actions)!=null&&v.Blur||(u.focused=!1);const{value:p}=f.target;u.userValue=p,u.lastCommittedValue!==p&&((E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:p,willCommit:!0,commitKey:u.commitKey,selStart:f.target.selectionStart,selEnd:f.target.selectionEnd}})),h(f)}),(r=this.data.actions)!=null&&r.Keystroke&&i.addEventListener("beforeinput",f=>{var T;u.lastCommittedValue=null;const{data:p,target:v}=f,{value:E,selectionStart:x,selectionEnd:A}=v;let O=x,I=A;switch(f.inputType){case"deleteWordBackward":{const P=E.substring(0,x).match(/\w*[^\w]*$/);P&&(O-=P[0].length);break}
vendor: 4,158 bytes, line 213
213case"deleteWordForward":{const P=E.substring(x).match(/^[^\w]*\w*/);P&&(I+=P[0].length);break}case"deleteContentBackward":x===A&&(O-=1);break;case"deleteContentForward":x===A&&(I+=1);break}f.preventDefault(),(T=this.linkService.eventBus)==null||T.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:E,change:p||"",willCommit:!1,selStart:O,selEnd:I}})}),this._setEventListeners(i,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],f=>f.target.value)}if(d&&i.addEventListener("blur",d),this.data.comb){const f=(this.data.rect[2]-this.data.rect[0])/l;i.classList.add("comb"),i.style.letterSpacing=`calc(${f}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class xle extends Th{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Ale extends Th{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",t.setValue(i,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return gh.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=e.fieldName,s&&r.setAttribute("checked",!0),r.setAttribute("exportValue",e.exportValue),r.tabIndex=Iy,r.addEventListener("change",o=>{const{name:a,checked:l}=o.target;for(const c of this._getElementsByName(a,i)){const u=l&&c.exportValue===e.exportValue;c.domElement&&(c.domElement.checked=u),t.setValue(c.id,{value:u})}t.setValue(i,{value:l})}),r.addEventListener("resetform",o=>{const a=e.defaultFieldValue||"Off";o.target.checked=a===e.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",o=>{const a={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(a,o)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Rz extends Th{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if(typeof s=="string"&&(s=s!==e.buttonValue,t.setValue(i,{value:s})),s)for(const o of this._getElementsByName(e.fieldName,i))t.setValue(o.id,{value:!1});const r=document.createElement("input");if(gh.add(r),r.setAttribute("data-element-id",i),r.disabled=e.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=e.fieldName,s&&r.setAttribute("checked",!0),r.tabIndex=Iy,r.addEventListener("change",o=>{const{name:a,checked:l}=o.target;for(const c of this._getElementsByName(a,i))t.setValue(c.id,{value:!1});t.setValue(i,{value:l})}),r.addEventListener("resetform",o=>{const a=e.defaultFieldValue;o.target.checked=a!=null&&a===e.buttonValue}),this.enableScripting&&this.hasJSActions){const o=e.buttonValue;r.addEventListener("updatefromsandbox",a=>{const l={value:c=>{const u=o===c.detail.value;for(const d of this._getElementsByName(c.target.name)){const h=u&&d.id===i;d.domElement&&(d.domElement.checked=h),t.setValue(d.id,{value:h})}}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}
213return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Cle extends Mz{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),t}}class kle extends Th{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),s=document.createElement("select");gh.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=Iy;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",u=>{const d=this.data.defaultFieldValue;for(const h of s.options)h.selected=h.value===d});for(const u of this.data.options){const d=document.createElement("option");d.textContent=u.displayValue,d.value=u.exportValue,i.value.includes(u.exportValue)&&(d.setAttribute("selected",!0),r=!1),s.append(d)}let o=null;if(r){const u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),s.prepend(u),o=()=>{u.remove(),s.removeEventListener("input",o),o=null},s.addEventListener("input",o)}const a=u=>{const d=u?"value":"textContent",{options:h,multiple:f}=s;return f?Array.prototype.filter.call(h,p=>p.selected).map(p=>p[d]):h.selectedIndex===-1?null:h[h.selectedIndex][d]};let l=a(!1);const c=u=>{const d=u.target.options;return Array.prototype.map.call(d,h=>({displayValue:h.textContent,exportValue:h.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",u=>{const d={value(h){o==null||o();const f=h.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(const v of s.options)v.selected=p.has(v.value);t.setValue(e,{value:a(!0)}),l=a(!1)},multipleSelection(h){s.multiple=!0},remove(h){const f=s.options,p=h.detail.remove;f[p].selected=!1,s.remove(p),f.length>0&&Array.prototype.findIndex.call(f,E=>E.selected)===-1&&(f[0].selected=!0),t.setValue(e,{value:a(!0),items:c(h)}),l=a(!1)},clear(h){for(;s.length!==0;)s.remove(0);t.setValue(e,{value:null,items:[]}),l=a(!1)},insert(h){const{index:f,displayValue:p,exportValue:v}=h.detail.insert,E=s.children[f],x=document.createElement("option");x.textContent=p,x.value=v,E?E.before(x):s.append(x),t.setValue(e,{value:a(!0),items:c(h)}),l=a(!1)},items(h){const{items:f}=h.detail;for(;s.length!==0;)s.remove(0);for(const p of f){const{displayValue:v,exportValue:E}=p,x=document.createElement("option");x.textContent=v,x.value=E,s.append(x)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:a(!0),items:c(h)}),l=a(!1)},indices(h){const f=new Set(h.detail.indices);for(const p of h.target.options)p.selected=f.has(p.index);t.setValue(e,{value:a(!0)}),l=a(!1)},editable(h){h.target.disabled=!h.detail.editable}};this._dispatchEventFromSandbox(d,u)}),s.addEventListener("input",u=>{var f;const d=a(!0),h=a(!1);t.setValue(e,{value:d}),u.preventDefault(),(f=this.linkService.eventBus)==null||f.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:h,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):s.addEventListener("input",function(u){t.setValue(e,{value:a(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class pk extends Nn{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Nn._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new Ile({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,i.container.ariaHasPopup="dialog",e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(i=>`${lM}
213${i}`).join(",")),this.container}}var vg,tS,nS,yg,Ed,En,Ha,_g,fv,gv,Eg,za,Hr,$a,mv,Wa,pv,Sd,Td,Sg,x0,bv,bk,iS,Lz,sS,Fz,rS,Nz,oS,Bz,Tg,A0,xg,C0,wv,wk;class Ile{constructor({container:t,color:e,elements:i,titleObj:s,modificationDate:r,contentsObj:o,richText:a,parent:l,rect:c,parentRect:u,open:d}){F(this,Sg);F(this,bv);F(this,iS);F(this,sS);F(this,rS);F(this,oS);F(this,Tg);F(this,xg);F(this,wv);F(this,vg,W(this,rS,Nz).bind(this));F(this,tS,W(this,wv,wk).bind(this));F(this,nS,W(this,xg,C0).bind(this));F(this,yg,W(this,Tg,A0).bind(this));F(this,Ed,null);F(this,En,null);F(this,Ha,null);F(this,_g,null);F(this,fv,null);F(this,gv,null);F(this,Eg,null);F(this,za,!1);F(this,Hr,null);F(this,$a,null);F(this,mv,null);F(this,Wa,null);F(this,pv,null);F(this,Sd,null);F(this,Td,!1);var h;V(this,En,t),V(this,pv,s),V(this,Ha,o),V(this,Wa,a),V(this,gv,l),V(this,Ed,e),V(this,mv,c),V(this,Eg,u),V(this,fv,i),V(this,_g,dM.toDateObject(r)),this.trigger=i.flatMap(f=>f.getElementsToTriggerPopup());for(const f of this.trigger)f.addEventListener("click",g(this,yg)),f.addEventListener("mouseenter",g(this,nS)),f.addEventListener("mouseleave",g(this,tS)),f.classList.add("popupTriggerArea");for(const f of i)(h=f.container)==null||h.addEventListener("keydown",g(this,vg));g(this,En).hidden=!0,d&&W(this,Tg,A0).call(this)}render(){if(g(this,Hr))return;const t=V(this,Hr,document.createElement("div"));if(t.className="popup",g(this,Ed)){const r=t.style.outlineColor=ze.makeHexColor(...g(this,Ed));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`:t.style.backgroundColor=ze.makeHexColor(...g(this,Ed).map(a=>Math.floor(.7*(255-a)+a)))}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),{dir:i.dir,str:i.textContent}=g(this,pv),t.append(e),g(this,_g)){const r=document.createElement("span");r.classList.add("popupDate"),r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:g(this,_g).valueOf()})),e.append(r)}const s=g(this,Sg,x0);if(s)Pz.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const r=this._formatContents(g(this,Ha));t.append(r)}g(this,En).append(t)}_formatContents({str:t,dir:e}){const i=document.createElement("p");i.classList.add("popupContent"),i.dir=e;const s=t.split(/(?:\r\n?|\n)/);for(let r=0,o=s.length;r<o;++r){const a=s[r];i.append(document.createTextNode(a)),r<o-1&&i.append(document.createElement("br"))}return i}updateEdited({rect:t,popupContent:e}){var i;g(this,Sd)||V(this,Sd,{contentsObj:g(this,Ha),richText:g(this,Wa)}),t&&V(this,$a,null),e&&(V(this,Wa,W(this,sS,Fz).call(this,e)),V(this,Ha,null)),(i=g(this,Hr))==null||i.remove(),V(this,Hr,null)}resetEdited(){var t;g(this,Sd)&&({contentsObj:Gi(this,Ha)._,richText:Gi(this,Wa)._}=g(this,Sd),V(this,Sd,null),(t=g(this,Hr))==null||t.remove(),V(this,Hr,null),V(this,$a,null))}forceHide(){V(this,Td,this.isVisible),g(this,Td)&&(g(this,En).hidden=!0)}maybeShow(){g(this,Td)&&(g(this,Hr)||W(this,xg,C0).call(this),V(this,Td,!1),g(this,En).hidden=!1)}get isVisible(){return g(this,En).hidden===!1}}vg=new WeakMap,tS=new WeakMap,nS=new WeakMap,yg=new WeakMap,Ed=new WeakMap,En=new WeakMap,Ha=new WeakMap,_g=new WeakMap,fv=new WeakMap,gv=new WeakMap,Eg=new WeakMap,za=new WeakMap,Hr=new WeakMap,$a=new WeakMap,mv=new WeakMap,Wa=new WeakMap,pv=new WeakMap,Sd=new WeakMap,Td=new WeakMap,Sg=new WeakSet,x0=function(){const t=g(this,Wa),e=g(this,Ha);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&g(this,Wa).html||null},bv=new WeakSet,bk=function(){var t,e,i;return((i=(e=(t=g(this,Sg,x0))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},iS=new WeakSet,Lz=function(){var t,e,i;return((i=(e=(t=g(this,Sg,x0))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},sS=new WeakSet,Fz=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},s={style:{color:g(this,iS,Lz),fontSize:g(this,bv,bk)?`calc(${g(this,bv,bk)}px * var(--scale-factor))`:""}};for(const r of t.split(` 214`))e.push({name:"span",value:r,attributes:s});return i},rS=new WeakSet,Nz=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&g(this,za))&&W(this,Tg,A0).call(this)},oS=new WeakSet,Bz=function(){if(g(this,$a)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:s,pageY:r}}}=g(this,gv);let o=!!g(this,Eg),a=o?g(this,Eg):g(this,mv);for(const p of g(this,fv))if(!a||ze.intersect(p.data.rect,a)!==null){a=p.data.rect,o=!0;break}const l=ze.normalizeRect([a[0],t[3]-a[1]+t[1],a[2],t[3]-a[3]+t[1]]),c=5,u=o?a[2]-a[0]+c:0,d=l[0]+u,h=l[1];V(this,$a,[100*(d-s)/e,100*(h-r)/i]);const{style:f}=g(this,En);f.left=`${g(this,$a)[0]}%`,f.top=`${g(this,$a)[1]}%`},Tg=new WeakSet,A0=function(){V(this,za,!g(this,za)),g(this,za)?(W(this,xg,C0).call(this),g(this,En).addEventListener("click",g(this,yg)),g(this,En).addEventListener("keydown",g(this,vg))):(W(this,wv,wk).call(this),g(this,En).removeEventListener("click",g(this,yg)),g(this,En).removeEventListener("keydown",g(this,vg)))},xg=new WeakSet,C0=function(){g(this,Hr)||this.render(),this.isVisible?g(this,za)&&g(this,En).classList.add("focused"):(W(this,oS,Bz).call(this),g(this,En).hidden=!1,g(this,En).style.zIndex=parseInt(g(this,En).style.zIndex)+1e3)},wv=new WeakSet,wk=function(){g(this,En).classList.remove("focused"),!(g(this,za)||!this.isVisible)&&(g(this,En).hidden=!0,g(this,En).style.zIndex=parseInt(g(this,En).style.zIndex)-1e3)};class Vz extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=ut.FREETEXT}
214render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var vv;class Ple extends Nn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});F(this,vv,null)}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:i,height:s}=Oc(e.rect),r=this.svgFactory.create(i,s,!0),o=V(this,vv,this.svgFactory.createElement("svg:line"));return o.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),o.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),o.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),o.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),o.setAttribute("stroke-width",e.borderStyle.width||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),r.append(o),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return g(this,vv)}addHighlightArea(){this.container.classList.add("highlightArea")}}vv=new WeakMap;var yv;class Mle extends Nn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});F(this,yv,null)}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:i,height:s}=Oc(e.rect),r=this.svgFactory.create(i,s,!0),o=e.borderStyle.width,a=V(this,yv,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",o/2),a.setAttribute("y",o/2),a.setAttribute("width",i-o),a.setAttribute("height",s-o),a.setAttribute("stroke-width",o||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return g(this,yv)}addHighlightArea(){this.container.classList.add("highlightArea")}}yv=new WeakMap;var _v;class Ole extends Nn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});F(this,_v,null)}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:i,height:s}=Oc(e.rect),r=this.svgFactory.create(i,s,!0),o=e.borderStyle.width,a=V(this,_v,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",i/2),a.setAttribute("cy",s/2),a.setAttribute("rx",i/2-o/2),a.setAttribute("ry",s/2-o/2),a.setAttribute("stroke-width",o||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return g(this,_v)}addHighlightArea(){this.container.classList.add("highlightArea")}}_v=new WeakMap;var Ev;class Hz extends Nn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});F(this,Ev,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:i,borderStyle:s,popupRef:r}}=this;if(!i)return this.container;const{width:o,height:a}=Oc(e),l=this.svgFactory.create(o,a,!0);let c=[];for(let d=0,h=i.length;d<h;d+=2){const f=i[d]-e[0],p=e[3]-i[d+1];c.push(`${f},${p}`)}c=c.join(" ");const u=V(this,Ev,this.svgFactory.createElement(this.svgElementName));return u.setAttribute("points",c),u.setAttribute("stroke-width",s.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),l.append(u),this.container.append(l),!r&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return g(this,Ev)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ev=new WeakMap;class Dle extends Hz{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Rle extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
214var Sv,xd,Tv,vk;class pM extends Nn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0});F(this,Tv);F(this,Sv,null);F(this,xd,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?ut.HIGHLIGHT:ut.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:i,inkLists:s,borderStyle:r,popupRef:o}}=this,{transform:a,width:l,height:c}=W(this,Tv,vk).call(this,i,e),u=this.svgFactory.create(l,c,!0),d=V(this,Sv,this.svgFactory.createElement("svg:g"));u.append(d),d.setAttribute("stroke-width",r.width||1),d.setAttribute("stroke-linecap","round"),d.setAttribute("stroke-linejoin","round"),d.setAttribute("stroke-miterlimit",10),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),d.setAttribute("transform",a);for(let h=0,f=s.length;h<f;h++){const p=this.svgFactory.createElement(this.svgElementName);g(this,xd).push(p),p.setAttribute("points",s[h].join(",")),d.append(p)}return!o&&this.hasPopupData&&this._createPopup(),this.container.append(u),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:i,points:s,rect:r}=e,o=g(this,Sv);if(i>=0&&o.setAttribute("stroke-width",i||1),s)for(let a=0,l=g(this,xd).length;a<l;a++)g(this,xd)[a].setAttribute("points",s[a].join(","));if(r){const{transform:a,width:l,height:c}=W(this,Tv,vk).call(this,this.data.rotation,r);o.parentElement.setAttribute("viewBox",`0 0 ${l} ${c}`),o.setAttribute("transform",a)}}getElementsToTriggerPopup(){return g(this,xd)}addHighlightArea(){this.container.classList.add("highlightArea")}}Sv=new WeakMap,xd=new WeakMap,Tv=new WeakSet,vk=function(e,i){switch(e){case 90:return{transform:`rotate(90) translate(${-i[0]},${i[1]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};case 180:return{transform:`rotate(180) translate(${-i[2]},${i[1]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]};case 270:return{transform:`rotate(270) translate(${-i[2]},${i[3]}) scale(1,-1)`,width:i[3]-i[1],height:i[2]-i[0]};default:return{transform:`translate(${-i[0]},${i[3]}) scale(1,-1)`,width:i[2]-i[0],height:i[3]-i[1]}}};class zz extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=ut.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class Lle extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Fle extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Nle extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class $z extends Nn{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=ut.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var xv,Av,yk;class Ble extends Nn{constructor(e){var s;super(e,{isRenderable:!0});F(this,Av);F(this,xv,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,(s=this.linkService.eventBus)==null||s.dispatch("fileattachmentannotation",{source:this,...i})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:i}=this;let s;i.hasAppearance||i.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(i.fillAlpha*100)}%);`)),s.addEventListener("dblclick",W(this,Av,yk).bind(this)),V(this,xv,s);const{isMac:r}=es.platform;return e.addEventListener("keydown",o=>{o.key==="Enter"&&(r?o.metaKey:o.ctrlKey)&&W(this,Av,yk).call(this)}),!i.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),e.append(s),e}getElementsToTriggerPopup(){return g(this,xv)}addHighlightArea(){this.container.classList.add("highlightArea")}}xv=new WeakMap,Av=new WeakSet,yk=function(){var e;(e=this.downloadManager)==null||e.openOrDownloadData(this.content,this.filename)};var Cv,Ad,Cd,kv,aS,Wz,Iv,_k;class Vle{constructor({div:t,accessibilityManager:e,annotationCanvasMap:i,annotationEditorUIManager:s,page:r,viewport:o,structTreeLayer:a}){F(this,aS);F(this,Iv);F(this,Cv,null);F(this,Ad,null);F(this,Cd,new Map);F(this,kv,null);this.div=t,V(this,Cv,e),V(this,Ad,i),V(this,kv,a||null),this.page=r,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=s}hasEditableAnnotations(){return g(this,Cd).size>0}async render(t){var o;const{annotations:e}=t,i=this.div;hh(i,this.viewport);const s=new Map,r={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new mM,annotationStorage:t.annotationStorage||new fM,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const a of e){if(a.noHTML)continue;const l=a.annotationType===Gn.POPUP;if(l){const d=s.get(a.id);if(!d)continue;r.elements=d}else{const{width:d,height:h}=Oc(a.rect);if(d<=0||h<=0)continue}r.data=a;const c=Ele.create(r);if(!c.isRenderable)continue;if(!l&&a.popupRef){const d=s.get(a.popupRef);d?d.push(c):s.set(a.popupRef,[c])}const u=c.render();a.hidden&&(u.style.visibility="hidden"),await W(this,aS,Wz).call(this,u,a.id),c._isEditable&&(g(this,Cd).set(c.data.id,c),(o=this._annotationEditorUIManager)==null||o.renderAnnotationElement(c))}W(this,Iv,_k).call(this)}update({viewport:t}){const e=this.div;this.viewport=t,hh(e,{rotation:t.rotation}),W(this,Iv,_k).call(this),e.hidden=!1}getEditableAnnotations(){return Array.from(g(this,Cd).values())}getEditableAnnotation(t){return g(this,Cd).get(t)}}Cv=new WeakMap,Ad=new WeakMap,Cd=new WeakMap,kv=new WeakMap,aS=new WeakSet,Wz=async function(t,e){var o,a;const i=t.firstChild||t,s=i.id=`${lM}${e}`,r=await((o=g(this,kv))==null?void 0:o.getAriaAttributes(s));if(r)for(const[l,c]of r)i.setAttribute(l,c);this.div.append(t),(a=g(this,Cv))==null||a.moveElementInDOM(this.div,t,i,!1)},Iv=new WeakSet,_k=function(){if(!g(this,Ad))return;const t=this.div;for(const[e,i]of g(this,Ad)){const s=t.querySelector(`[data-annotation-id="${e}"]`);if(!s)continue;i.className="annotationContent";const{firstChild:r}=s;r?r.nodeName==="CANVAS"?r.replaceWith(i):r.classList.contains("annotationContent")?r.after(i):r.before(i):s.append(i)}g(this,Ad).clear()};const A_=/\r\n?|\n/g;var zr,Os,Pv,kd,Ds,lS,Uz,cS,jz,uS,Gz,Ag,k0,Cg,I0,kg,P0,dS,Yz,Mv,Sk,hS,qz;const qt=class qt extends yn{constructor(e){super({...e,name:"freeTextEditor"});F(this,lS);F(this,cS);F(this,uS);F(this,Ag);F(this,kg);F(this,dS);F(this,hS);F(this,zr,void 0);F(this,Os,"");F(this,Pv,`${this.id}-editor`);F(this,kd,null);F(this,Ds,void 0);V(this,zr,e.color||qt._defaultColor||yn._defaultLineColor),V(this,Ds,e.fontSize||qt._defaultFontSize)}static get _keyboardManager(){const e=qt.prototype,i=o=>o.isEmpty(),s=fh.TRANSLATE_SMALL,r=fh.TRANSLATE_BIG;return wt(this,"_keyboardManager",new ky([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:i}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:i}]]))}static initialize(e,i){yn.initialize(e,i);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}
214static updateDefaultParams(e,i){switch(e){case xt.FREETEXT_SIZE:qt._defaultFontSize=i;break;case xt.FREETEXT_COLOR:qt._defaultColor=i;break}}updateParams(e,i){switch(e){case xt.FREETEXT_SIZE:W(this,lS,Uz).call(this,i);break;case xt.FREETEXT_COLOR:W(this,cS,jz).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[xt.FREETEXT_SIZE,qt._defaultFontSize],[xt.FREETEXT_COLOR,qt._defaultColor||yn._defaultLineColor]]}get propertiesToUpdate(){return[[xt.FREETEXT_SIZE,g(this,Ds)],[xt.FREETEXT_COLOR,g(this,zr)]]}_translateEmpty(e,i){this._uiManager.translateSelectedEditors(e,i,!0)}getInitialTranslation(){const e=this.parentScale;return[-qt._internalPadding*e,-(qt._internalPadding+g(this,Ds))*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(ut.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),V(this,kd,new AbortController);const e=this._uiManager.combinedSignal(g(this,kd));this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){var e;this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",g(this,Pv)),this._isDraggable=!0,(e=g(this,kd))==null||e.abort(),V(this,kd,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){var i;this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),(i=this._initialOptions)!=null&&i.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=g(this,Os),i=V(this,Os,W(this,uS,Gz).call(this).trimEnd());if(e===i)return;const s=r=>{if(V(this,Os,r),!r){this.remove();return}W(this,kg,P0).call(this),this._uiManager.rebuild(this),W(this,Ag,k0).call(this)};this.addCommands({cmd:()=>{s(i)},undo:()=>{s(e)},mustExec:!1}),W(this,Ag,k0).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){qt._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,i;this.width&&(e=this.x,i=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",g(this,Pv)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${g(this,Ds)}px * var(--scale-factor))`,s.color=g(this,zr),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),CE(this,this.div,["dblclick","keydown"]),this.width){const[r,o]=this.parentDimensions;
214if(this.annotationElementId){const{position:a}=this._initialData;let[l,c]=this.getInitialTranslation();[l,c]=this.pageTranslationToScreen(l,c);const[u,d]=this.pageDimensions,[h,f]=this.pageTranslation;let p,v;switch(this.rotation){case 0:p=e+(a[0]-h)/u,v=i+this.height-(a[1]-f)/d;break;case 90:p=e+(a[0]-h)/u,v=i-(a[1]-f)/d,[l,c]=[c,-l];break;case 180:p=e-this.width+(a[0]-h)/u,v=i-(a[1]-f)/d,[l,c]=[-l,-c];break;case 270:p=e+(a[0]-h-this.height*d)/u,v=i+(a[1]-f-this.width*u)/d,[l,c]=[-c,l];break}this.setAt(p*r,v*o,l,c)}else this.setAt(e*r,i*o,this.width*r,this.height*o);W(this,kg,P0).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){var p,v,E;const i=e.clipboardData||window.clipboardData,{types:s}=i;if(s.length===1&&s[0]==="text/plain")return;e.preventDefault();const r=W(p=qt,Mv,Sk).call(p,i.getData("text")||"").replaceAll(A_,` 215`);if(!r)return;const o=window.getSelection();if(!o.rangeCount)return;this.editorDiv.normalize(),o.deleteFromDocument();const a=o.getRangeAt(0);if(!r.includes(` 216`)){a.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),o.collapseToStart();return}const{startContainer:l,startOffset:c}=a,u=[],d=[];if(l.nodeType===Node.TEXT_NODE){const x=l.parentElement;if(d.push(l.nodeValue.slice(c).replaceAll(A_,"")),x!==this.editorDiv){let A=u;for(const O of this.editorDiv.childNodes){if(O===x){A=d;continue}A.push(W(v=qt,Cg,I0).call(v,O))}}u.push(l.nodeValue.slice(0,c).replaceAll(A_,""))}else if(l===this.editorDiv){let x=u,A=0;for(const O of this.editorDiv.childNodes)A++===c&&(x=d),x.push(W(E=qt,Cg,I0).call(E,O))}V(this,Os,`${u.join(` 217`)}${r}${d.join(` 218`)}`),W(this,kg,P0).call(this);const h=new Range;let f=u.reduce((x,A)=>x+A.length,0);for(const{firstChild:x}of this.editorDiv.childNodes)if(x.nodeType===Node.TEXT_NODE){const A=x.nodeValue.length;if(f<=A){h.setStart(x,f),h.setEnd(x,f);break}f-=A}o.removeAllRanges(),o.addRange(h)}get contentDiv(){return this.editorDiv}static async deserialize(e,i,s){var a;let r=null;if(e instanceof Vz){const{data:{defaultAppearanceData:{fontSize:l,fontColor:c},rect:u,rotation:d,id:h,popupRef:f},textContent:p,textPosition:v,parent:{page:{pageNumber:E}}}=e;if(!p||p.length===0)return null;r=e={annotationType:ut.FREETEXT,color:Array.from(c),fontSize:l,value:p.join(` 219`),position:v,pageIndex:E-1,rect:u.slice(0),rotation:d,id:h,deleted:!1,popupRef:f}}const o=await super.deserialize(e,i,s);return V(o,Ds,e.fontSize),V(o,zr,ze.makeHexColor(...e.color)),V(o,Os,W(a=qt,Mv,Sk).call(a,e.value)),o.annotationElementId=e.id||null,o._initialData=r,o}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const i=qt._internalPadding*this.parentScale,s=this.getRect(i,i),r=yn._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:g(this,zr)),o={annotationType:ut.FREETEXT,color:r,fontSize:g(this,Ds),value:W(this,dS,Yz).call(this),pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?o:this.annotationElementId&&!W(this,hS,qz).call(this,o)?null:(o.id=this.annotationElementId,o)}renderAnnotationElement(e){const i=super.renderAnnotationElement(e);if(this.deleted)return i;const{style:s}=i;s.fontSize=`calc(${g(this,Ds)}px * var(--scale-factor))`,s.color=g(this,zr),i.replaceChildren();for(const o of g(this,Os).split(` 220`)){const a=document.createElement("div");a.append(o?document.createTextNode(o):document.createElement("br")),i.append(a)}const r=qt._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(r,r),popupContent:g(this,Os)}),i}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}};zr=new WeakMap,Os=new WeakMap,Pv=new WeakMap,kd=new WeakMap,Ds=new WeakMap,lS=new WeakSet,Uz=function(e){const i=r=>{this.editorDiv.style.fontSize=`calc(${r}px * var(--scale-factor))`,this.translate(0,-(r-g(this,Ds))*this.parentScale),V(this,Ds,r),W(this,Ag,k0).call(this)},s=g(this,Ds);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:xt.FREETEXT_S
220IZE,overwriteIfSameType:!0,keepUndo:!0})},cS=new WeakSet,jz=function(e){const i=r=>{V(this,zr,this.editorDiv.style.color=r)},s=g(this,zr);this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:xt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},uS=new WeakSet,Gz=function(){var s;const e=[];this.editorDiv.normalize();let i=null;for(const r of this.editorDiv.childNodes)(i==null?void 0:i.nodeType)===Node.TEXT_NODE&&r.nodeName==="BR"||(e.push(W(s=qt,Cg,I0).call(s,r)),i=r);return e.join(` 221`)},Ag=new WeakSet,k0=function(){const[e,i]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:r,div:o}=this,a=o.style.display,l=o.classList.contains("hidden");o.classList.remove("hidden"),o.style.display="hidden",r.div.append(this.div),s=o.getBoundingClientRect(),o.remove(),o.style.display=a,o.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=s.width/e,this.height=s.height/i):(this.width=s.height/e,this.height=s.width/i),this.fixAndSetPosition()},Cg=new WeakSet,I0=function(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(A_,"")},kg=new WeakSet,P0=function(){if(this.editorDiv.replaceChildren(),!!g(this,Os))for(const e of g(this,Os).split(` 222`)){const i=document.createElement("div");i.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(i)}},dS=new WeakSet,Yz=function(){return g(this,Os).replaceAll("Â "," ")},Mv=new WeakSet,Sk=function(e){return e.replaceAll(" ","Â ")},hS=new WeakSet,qz=function(e){const{value:i,fontSize:s,color:r,pageIndex:o}=this._initialData;return this._hasBeenMoved||e.value!==i||e.fontSize!==s||e.color.some((a,l)=>a!==r[l])||e.pageIndex!==o},F(qt,Cg),F(qt,Mv),y(qt,"_freeTextDefaultContent",""),y(qt,"_internalPadding",0),y(qt,"_defaultColor",null),y(qt,"_defaultFontSize",10),y(qt,"_type","freetext"),y(qt,"_editorType",ut.FREETEXT);let Ek=qt;class Ne{toSVGPath(){Xt("Abstract method `toSVGPath` must be implemented.")}get box(){Xt("Abstract getter `box` must be implemented.")}serialize(t,e){Xt("Abstract method `serialize` must be implemented.")}static _rescale(t,e,i,s,r,o){o||(o=new Float32Array(t.length));for(let a=0,l=t.length;a<l;a+=2)o[a]=e+t[a]*s,o[a+1]=i+t[a+1]*r;return o}static _rescaleAndSwap(t,e,i,s,r,o){o||(o=new Float32Array(t.length));for(let a=0,l=t.length;a<l;a+=2)o[a]=e+t[a+1]*s,o[a+1]=i+t[a]*r;return o}static _translate(t,e,i,s){s||(s=new Float32Array(t.length));for(let r=0,o=t.length;r<o;r+=2)s[r]=e+t[r],s[r+1]=i+t[r+1];return s}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,e,i,s,r){switch(r){case 90:return[1-e/i,t/s];case 180:return[1-t/i,1-e/s];case 270:return[e/i,1-t/s];default:return[t/i,e/s]}}static _normalizePagePoint(t,e,i){switch(i){case 90:return[1-e,t];case 180:return[1-t,1-e];case 270:return[e,1-t];default:return[t,e]}}static createBezierPoints(t,e,i,s,r,o){return[(t+5*i)/6,(e+5*s)/6,(5*i+r)/6,(5*s+o)/6,(i+r)/2,(s+o)/2]}}y(Ne,"PRECISION",1e-4);var Rs,$r,Ig,Pg,Bo,bt,Id,Pd,Ov,Dv,Mg,Og,oc,Rv,fS,gS,Md,Vp,mS,Kz,pS,Xz,bS,Jz,wS,Zz,vS,Qz,yS,e$;const ya=class ya{constructor({x:t,y:e},i,s,r,o,a=0){F(this,Md);F(this,mS);F(this,pS);F(this,bS);F(this,wS);F(this,vS);F(this,yS);F(this,Rs,void 0);F(this,$r,[]);F(this,Ig,void 0);F(this,Pg,void 0);F(this,Bo,[]);F(this,bt,new Float32Array(18));F(this,Id,void 0);F(this,Pd,void 0);F(this,Ov,void 0);F(this,Dv,void 0);F(this,Mg,void 0);F(this,Og,void 0);F(this,oc,[]);V(this,Rs,i),V(this,Og,r*s),V(this,Pg,o),g(this,bt).set([NaN,NaN,NaN,NaN,t,e],6),V(this,Ig,a),V(this,Dv,g(ya,Rv)*s),V(this,Ov,g(ya,gS)*s),V(this,Mg,s),g(this,oc).push(t,e)}isEmpty(){return isNaN(g(this,bt)[8])}add({x:t,y:e}){var U;V(this,Id,t),V(this,Pd,e);const[i,s,r,o]=g(this,Rs);let[a,l,c,u]=g(this,bt).subarray(8,12);const d=t-c,h=e-u,f=Math.hypot(d,h);if(f<g(this,Ov))return!1;const p=f-g(this,Dv),v=p/f,E=v*d,x=v*h;let A=a,O=l;a=c,l=u,c+=E,u+=x,(U=g(this,oc))==null||U.push(t,e);const I=-x/p,T=E/p,P=I*g(this,Og),k=T*g(this,Og);return g(this,bt).set(g(this,bt).subarray(2,8),0),g(this,bt).set([c+P,u+k],4),g(this,bt).set(g(this,bt).subarray(14,18),12),g(this,bt).set([c-P,u-k],16),isNaN(g(this,bt)[6])?(g(this,Bo).length===0&&(g(this,bt).set([a+P,l+k],2),g(this,Bo).push(NaN,NaN,NaN,NaN,(a+P-i)/r,(l+k-s)/o),g(this,bt).set([a-P,l-k],14),g(this,$r).push(NaN,NaN,NaN,NaN,(a-P-i)/r,(l-k-s)/o)),g(this,bt).set([A,O,a,l,c,u],6),!this.isEmpty()):(g(this,bt).set([A,O,a,l,c,u],6),Math.abs(Math.atan2(O-l,A-a)-Math.atan2(x,E))<Math.PI/2?([a,l,c,u]=g(this,bt).subarray(2,6),g(this,Bo).push(NaN,NaN,NaN,NaN,((a+c)/2-i)/r,((l+u)/2-s)/o),[a,l,A,O]=g(this,bt).subarray(14,18),g(this,$r).push(NaN,NaN,NaN,NaN,((A+a)/2-i)/r,((O+l)/2-s)/o),!0):([A,O,a,l,c,u]=g(this,bt).subarray(0,6),g(this,Bo).push(((A+5*a)/6-i)/r,((O+5*l)/6-s)/o,((5*a+c)/6-i)/r,((5*l+u)/6-s)/o,((a+c)/2-i)/r,((l+u)/2-s)/o),[c,u,a,l,A,O]=g(this,bt).subarray(12,18),g(this,$r).push(((A+5*a)/6-i)/r,((O+5*l)/6-s)/o,((5*a+c)/6-i)/r,((5*l+u)/6-s)/o,((a+c)/2-i)/r,((l+u)/2-s)/o),!0))}toSVGPath(){if(this.isEmpty())return"";const t=g(this,Bo),e=g(this,$r);if(isNaN(g(this,bt)[6])&&!this.isEmpty())return W(this,mS,Kz).call(this);const i=[];i.push(`M${t[4]} ${t[5]}`);for(let s=6;s<t.length;s+=6)isNaN(t[s])?i.push(`L${t[s+4]} ${t[s+5]}`):i.push(`C${t[s]} ${t[s+1]} ${t[s+2]} ${t[s+3]} ${t[s+4]} ${t[s+5]}`);
222W(this,bS,Jz).call(this,i);for(let s=e.length-6;s>=6;s-=6)isNaN(e[s])?i.push(`L${e[s+4]} ${e[s+5]}`):i.push(`C${e[s]} ${e[s+1]} ${e[s+2]} ${e[s+3]} ${e[s+4]} ${e[s+5]}`);return W(this,pS,Xz).call(this,i),i.join(" ")}newFreeDrawOutline(t,e,i,s,r,o){return new t$(t,e,i,s,r,o)}getOutlines(){var d;const t=g(this,Bo),e=g(this,$r),i=g(this,bt),[s,r,o,a]=g(this,Rs),l=new Float32Array((((d=g(this,oc))==null?void 0:d.length)??0)+2);for(let h=0,f=l.length-2;h<f;h+=2)l[h]=(g(this,oc)[h]-s)/o,l[h+1]=(g(this,oc)[h+1]-r)/a;if(l[l.length-2]=(g(this,Id)-s)/o,l[l.length-1]=(g(this,Pd)-r)/a,isNaN(i[6])&&!this.isEmpty())return W(this,wS,Zz).call(this,l);const c=new Float32Array(g(this,Bo).length+24+g(this,$r).length);let u=t.length;for(let h=0;h<u;h+=2){if(isNaN(t[h])){c[h]=c[h+1]=NaN;continue}c[h]=t[h],c[h+1]=t[h+1]}u=W(this,yS,e$).call(this,c,u);for(let h=e.length-6;h>=6;h-=6)for(let f=0;f<6;f+=2){if(isNaN(e[h+f])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=e[h+f],c[u+1]=e[h+f+1],u+=2}return W(this,vS,Qz).call(this,c,u),this.newFreeDrawOutline(c,l,g(this,Rs),g(this,Mg),g(this,Ig),g(this,Pg))}};Rs=new WeakMap,$r=new WeakMap,Ig=new WeakMap,Pg=new WeakMap,Bo=new WeakMap,bt=new WeakMap,Id=new WeakMap,Pd=new WeakMap,Ov=new WeakMap,Dv=new WeakMap,Mg=new WeakMap,Og=new WeakMap,oc=new WeakMap,Rv=new WeakMap,fS=new WeakMap,gS=new WeakMap,Md=new WeakSet,Vp=function(){const t=g(this,bt).subarray(4,6),e=g(this,bt).subarray(16,18),[i,s,r,o]=g(this,Rs);return[(g(this,Id)+(t[0]-e[0])/2-i)/r,(g(this,Pd)+(t[1]-e[1])/2-s)/o,(g(this,Id)+(e[0]-t[0])/2-i)/r,(g(this,Pd)+(e[1]-t[1])/2-s)/o]},mS=new WeakSet,Kz=function(){const[t,e,i,s]=g(this,Rs),[r,o,a,l]=W(this,Md,Vp).call(this);return`M${(g(this,bt)[2]-t)/i} ${(g(this,bt)[3]-e)/s} L${(g(this,bt)[4]-t)/i} ${(g(this,bt)[5]-e)/s} L${r} ${o} L${a} ${l} L${(g(this,bt)[16]-t)/i} ${(g(this,bt)[17]-e)/s} L${(g(this,bt)[14]-t)/i} ${(g(this,bt)[15]-e)/s} Z`},pS=new WeakSet,Xz=function(t){const e=g(this,$r);t.push(`L${e[4]} ${e[5]} Z`)},bS=new WeakSet,Jz=function(t){const[e,i,s,r]=g(this,Rs),o=g(this,bt).subarray(4,6),a=g(this,bt).subarray(16,18),[l,c,u,d]=W(this,Md,Vp).call(this);t.push(`L${(o[0]-e)/s} ${(o[1]-i)/r} L${l} ${c} L${u} ${d} L${(a[0]-e)/s} ${(a[1]-i)/r}`)},wS=new WeakSet,Zz=function(t){const e=g(this,bt),[i,s,r,o]=g(this,Rs),[a,l,c,u]=W(this,Md,Vp).call(this),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(e[2]-i)/r,(e[3]-s)/o,NaN,NaN,NaN,NaN,(e[4]-i)/r,(e[5]-s)/o,NaN,NaN,NaN,NaN,a,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(e[16]-i)/r,(e[17]-s)/o,NaN,NaN,NaN,NaN,(e[14]-i)/r,(e[15]-s)/o],0),this.newFreeDrawOutline(d,t,g(this,Rs),g(this,Mg),g(this,Ig),g(this,Pg))},vS=new WeakSet,Qz=function(t,e){const i=g(this,$r);return t.set([NaN,NaN,NaN,NaN,i[4],i[5]],e),e+=6},yS=new WeakSet,e$=function(t,e){const i=g(this,bt).subarray(4,6),s=g(this,bt).subarray(16,18),[r,o,a,l]=g(this,Rs),[c,u,d,h]=W(this,Md,Vp).call(this);return t.set([NaN,NaN,NaN,NaN,(i[0]-r)/a,(i[1]-o)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,d,h,NaN,NaN,NaN,NaN,(s[0]-r)/a,(s[1]-o)/l],e),e+=24},F(ya,Rv,8),F(ya,fS,2),F(ya,gS,g(ya,Rv)+g(ya,fS));let PE=ya;var Dg,Od,Ua,Lv,Ls,Fv,kn,_S,n$;class t$ extends Ne{constructor(e,i,s,r,o,a){super();F(this,_S);F(this,Dg,void 0);F(this,Od,new Float32Array(4));F(this,Ua,void 0);F(this,Lv,void 0);F(this,Ls,void 0);F(this,Fv,void 0);F(this,kn,void 0);V(this,kn,e),V(this,Ls,i),V(this,Dg,s),V(this,Fv,r),V(this,Ua,o),V(this,Lv,a),this.lastPoint=[NaN,NaN],W(this,_S,n$).call(this,a);const[l,c,u,d]=g(this,Od);for(let h=0,f=e.length;h<f;h+=2)e[h]=(e[h]-l)/u,e[h+1]=(e[h+1]-c)/d;for(let h=0,f=i.length;h<f;h+=2)i[h]=(i[h]-l)/u,i[h+1]=(i[h+1]-c)/d}toSVGPath(){const e=[`M${g(this,kn)[4]} ${g(this,kn)[5]}`];for(let i=6,s=g(this,kn).length;i<s;i+=6){if(isNaN(g(this,kn)[i])){e.push(`L${g(this,kn)[i+4]} ${g(this,kn)[i+5]}`);continue}e.push(`C${g(this,kn)[i]} ${g(this,kn)[i+1]} ${g(this,kn)[i+2]} ${g(this,kn)[i+3]} ${g(this,kn)[i+4]} ${g(this,kn)[i+5]}`)}return e.push("Z"),e.join(" ")}serialize([e,i,s,r],o){const a=s-e,l=r-i;let c,u;switch(o){case 0:c=Ne._rescale(g(this,kn),e,r,a,-l),u=Ne._rescale(g(this,Ls),e,r,a,-l);break;case 90:c=Ne._rescaleAndSwap(g(this,kn),e,i,a,l),u=Ne._rescaleAndSwap(g(this,Ls),e,i,a,l);break;case 180:c=Ne._rescale(g(this,kn),s,i,-a,l),u=Ne._rescale(g(this,Ls),s,i,-a,l);break;case 270:c=Ne._rescaleAndSwap(g(this,kn),s,r,-a,-l),u=Ne._rescaleAndSwap(g(this,Ls),s,r,-a,-l);break}
222return{outline:Array.from(c),points:[Array.from(u)]}}get box(){return g(this,Od)}newOutliner(e,i,s,r,o,a=0){return new PE(e,i,s,r,o,a)}getNewOutline(e,i){const[s,r,o,a]=g(this,Od),[l,c,u,d]=g(this,Dg),h=o*u,f=a*d,p=s*u+l,v=r*d+c,E=this.newOutliner({x:g(this,Ls)[0]*h+p,y:g(this,Ls)[1]*f+v},g(this,Dg),g(this,Fv),e,g(this,Lv),i??g(this,Ua));for(let x=2;x<g(this,Ls).length;x+=2)E.add({x:g(this,Ls)[x]*h+p,y:g(this,Ls)[x+1]*f+v});return E.getOutlines()}}Dg=new WeakMap,Od=new WeakMap,Ua=new WeakMap,Lv=new WeakMap,Ls=new WeakMap,Fv=new WeakMap,kn=new WeakMap,_S=new WeakSet,n$=function(e){const i=g(this,kn);let s=i[4],r=i[5],o=s,a=r,l=s,c=r,u=s,d=r;const h=e?Math.max:Math.min;for(let p=6,v=i.length;p<v;p+=6){if(isNaN(i[p]))o=Math.min(o,i[p+4]),a=Math.min(a,i[p+5]),l=Math.max(l,i[p+4]),c=Math.max(c,i[p+5]),d<i[p+5]?(u=i[p+4],d=i[p+5]):d===i[p+5]&&(u=h(u,i[p+4]));else{const E=ze.bezierBoundingBox(s,r,...i.slice(p,p+6));o=Math.min(o,E[0]),a=Math.min(a,E[1]),l=Math.max(l,E[2]),c=Math.max(c,E[3]),d<E[3]?(u=E[2],d=E[3]):d===E[3]&&(u=h(u,E[2]))}s=i[p+4],r=i[p+5]}const f=g(this,Od);f[0]=o-g(this,Ua),f[1]=a-g(this,Ua),f[2]=l-o+2*g(this,Ua),f[3]=c-a+2*g(this,Ua),this.lastPoint=[u,d]};var Nv,Bv,ac,Wr,ES,i$,Rg,M0,SS,s$,TS,r$,Vv,xk;class Tk{constructor(t,e=0,i=0,s=!0){F(this,ES);F(this,Rg);F(this,SS);F(this,TS);F(this,Vv);F(this,Nv,void 0);F(this,Bv,void 0);F(this,ac,[]);F(this,Wr,[]);let r=1/0,o=-1/0,a=1/0,l=-1/0;const u=10**-4;for(const{x,y:A,width:O,height:I}of t){const T=Math.floor((x-e)/u)*u,P=Math.ceil((x+O+e)/u)*u,k=Math.floor((A-e)/u)*u,D=Math.ceil((A+I+e)/u)*u,U=[T,k,D,!0],Y=[P,k,D,!1];g(this,ac).push(U,Y),r=Math.min(r,T),o=Math.max(o,P),a=Math.min(a,k),l=Math.max(l,D)}const d=o-r+2*i,h=l-a+2*i,f=r-i,p=a-i,v=g(this,ac).at(s?-1:-2),E=[v[0],v[2]];for(const x of g(this,ac)){const[A,O,I]=x;x[0]=(A-f)/d,x[1]=(O-p)/h,x[2]=(I-p)/h}V(this,Nv,new Float32Array([f,p,d,h])),V(this,Bv,E)}getOutlines(){g(this,ac).sort((e,i)=>e[0]-i[0]||e[1]-i[1]||e[2]-i[2]);const t=[];for(const e of g(this,ac))e[3]?(t.push(...W(this,Vv,xk).call(this,e)),W(this,SS,s$).call(this,e)):(W(this,TS,r$).call(this,e),t.push(...W(this,Vv,xk).call(this,e)));return W(this,ES,i$).call(this,t)}}Nv=new WeakMap,Bv=new WeakMap,ac=new WeakMap,Wr=new WeakMap,ES=new WeakSet,i$=function(t){const e=[],i=new Set;for(const o of t){const[a,l,c]=o;e.push([a,l,o],[a,c,o])}e.sort((o,a)=>o[1]-a[1]||o[0]-a[0]);for(let o=0,a=e.length;o<a;o+=2){const l=e[o][2],c=e[o+1][2];l.push(c),c.push(l),i.add(l),i.add(c)}const s=[];let r;for(;i.size>0;){const o=i.values().next().value;let[a,l,c,u,d]=o;i.delete(o);let h=a,f=l;for(r=[a,c],s.push(r);;){let p;if(i.has(u))p=u;else if(i.has(d))p=d;else break;i.delete(p),[a,l,c,u,d]=p,h!==a&&(r.push(h,f,a,f===l?l:c),h=a),f=f===l?c:l}r.push(h,f)}return new Hle(s,g(this,Nv),g(this,Bv))},Rg=new WeakSet,M0=function(t){const e=g(this,Wr);let i=0,s=e.length-1;for(;i<=s;){const r=i+s>>1,o=e[r][0];if(o===t)return r;o<t?i=r+1:s=r-1}return s+1},SS=new WeakSet,s$=function([,t,e]){const i=W(this,Rg,M0).call(this,t);g(this,Wr).splice(i,0,[t,e])},TS=new WeakSet,r$=function([,t,e]){const i=W(this,Rg,M0).call(this,t);for(let s=i;s<g(this,Wr).length;s++){const[r,o]=g(this,Wr)[s];if(r!==t)break;if(r===t&&o===e){g(this,Wr).splice(s,1);return}}for(let s=i-1;s>=0;s--){const[r,o]=g(this,Wr)[s];if(r!==t)break;if(r===t&&o===e){g(this,Wr).splice(s,1);return}}},Vv=new WeakSet,xk=function(t){const[e,i,s]=t,r=[[e,i,s]],o=W(this,Rg,M0).call(this,s);for(let a=0;a<o;a++){const[l,c]=g(this,Wr)[a];for(let u=0,d=r.length;u<d;u++){const[,h,f]=r[u];if(!(c<=h||f<=l)){if(h>=l){if(f>c)r[u][1]=c;else{if(d===1)return[];r.splice(u,1),u--,d--}continue}r[u][2]=l,f>c&&r.push([e,c,f])}}}return r};var Hv,Lg;class Hle extends Ne{constructor(e,i,s){super();F(this,Hv,void 0);F(this,Lg,void 0);V(this,Lg,e),V(this,Hv,i),this.lastPoint=s}toSVGPath(){const e=[];for(const i of g(this,Lg)){let[s,r]=i;e.push(`M${s} ${r}`);for(let o=2;o<i.length;o+=2){const a=i[o],l=i[o+1];a===s?(e.push(`V${l}`),r=l):l===r&&(e.push(`H${a}`),s=a)}e.push("Z")}return e.join(" ")}serialize([e,i,s,r],o){const a=[],l=s-e,c=r-i;for(const u of g(this,Lg)){const d=new Array(u.length);for(let h=0;h<u.length;h+=2)d[h]=e+u[h]*l,d[h+1]=r-u[h+1]*c;a.push(d)}return a}get box(){return g(this,Hv)}get classNamesForOutlining(){return["highlightOutline"]}}Hv=new WeakMap,Lg=new WeakMap;class Ak extends PE{newFreeDrawOutline(t,e,i,s,r,o){return new zle(t,e,i,s,r,o)}}class zle extends t${newOutliner(t,e,i,s,r,o=0){return new Ak(t,e,i,s,r,o)}}var Ur,Dd,Fg,qn,zv,Ng,$v,Wv,lc,jr,Bg,Uv,jv,Ck,Gv,kk,Yv,Ik,ja,_u,xS,o$,Vo,Rl;const cs=class cs{constructor({editor:t=null,uiManager:e=null}){F(this,jv);F(this,Gv);F(this,Yv);F(this,ja);F(this,xS);F(this,Vo);F(this,Ur,null);F(this,Dd,null);F(this,Fg,void 0);F(this,qn,null);F(this,zv,!1);F(this,Ng,!1);F(this,$v,null);F(this,Wv,void 0);F(this,lc,null);F(this,jr,null);F(this,Bg,void 0);var i;t?(V(this,Ng,!1),V(this,Bg,xt.HIGHLIGHT_COLOR),V(this,$v,t)):(V(this,Ng,!0),V(this,Bg,xt.HIGHLIGHT_DEFAULT_COLOR)),V(this,jr,(t==null?void 0:t._uiManager)||e),V(this,Wv,g(this,jr)._eventBus),V(this,Fg,(t==null?void 0:t.color)||((i=g(this,jr))==null?void 0:i.highlightColors.values().next().value)||"#FFFF98"),g(cs,Uv)||V(cs,Uv,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return wt(this,"_keyboardManager",new ky([[["Escape","mac+Escape"],cs.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],cs.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],cs.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],cs.prototype._moveToPrevious],[["Home","mac+Home"],cs.prototype._moveToBeginning],[["End","mac+End"],cs.prototype._moveToEnd]]))}renderButton(){const t=V(this,Ur,document.createElement("button"));
222t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=g(this,jr)._signal;t.addEventListener("click",W(this,ja,_u).bind(this),{signal:e}),t.addEventListener("keydown",W(this,Yv,Ik).bind(this),{signal:e});const i=V(this,Dd,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=g(this,Fg),t.append(i),t}renderMainDropdown(){const t=V(this,qn,W(this,jv,Ck).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===g(this,Ur)){W(this,ja,_u).call(this,t);return}const e=t.target.getAttribute("data-color");e&&W(this,Gv,kk).call(this,e,t)}_moveToNext(t){var e,i;if(!g(this,Vo,Rl)){W(this,ja,_u).call(this,t);return}if(t.target===g(this,Ur)){(e=g(this,qn).firstChild)==null||e.focus();return}(i=t.target.nextSibling)==null||i.focus()}_moveToPrevious(t){var e,i;if(t.target===((e=g(this,qn))==null?void 0:e.firstChild)||t.target===g(this,Ur)){g(this,Vo,Rl)&&this._hideDropdownFromKeyboard();return}g(this,Vo,Rl)||W(this,ja,_u).call(this,t),(i=t.target.previousSibling)==null||i.focus()}_moveToBeginning(t){var e;if(!g(this,Vo,Rl)){W(this,ja,_u).call(this,t);return}(e=g(this,qn).firstChild)==null||e.focus()}_moveToEnd(t){var e;if(!g(this,Vo,Rl)){W(this,ja,_u).call(this,t);return}(e=g(this,qn).lastChild)==null||e.focus()}hideDropdown(){var t,e;(t=g(this,qn))==null||t.classList.add("hidden"),(e=g(this,lc))==null||e.abort(),V(this,lc,null)}_hideDropdownFromKeyboard(){var t;if(!g(this,Ng)){if(!g(this,Vo,Rl)){(t=g(this,$v))==null||t.unselect();return}this.hideDropdown(),g(this,Ur).focus({preventScroll:!0,focusVisible:g(this,zv)})}}updateColor(t){if(g(this,Dd)&&(g(this,Dd).style.backgroundColor=t),!g(this,qn))return;const e=g(this,jr).highlightColors.values();for(const i of g(this,qn).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;(t=g(this,Ur))==null||t.remove(),V(this,Ur,null),V(this,Dd,null),(e=g(this,qn))==null||e.remove(),V(this,qn,null)}};Ur=new WeakMap,Dd=new WeakMap,Fg=new WeakMap,qn=new WeakMap,zv=new WeakMap,Ng=new WeakMap,$v=new WeakMap,Wv=new WeakMap,lc=new WeakMap,jr=new WeakMap,Bg=new WeakMap,Uv=new WeakMap,jv=new WeakSet,Ck=function(){const t=document.createElement("div"),e=g(this,jr)._signal;t.addEventListener("contextmenu",lo,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,s]of g(this,jr).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",s),r.title=i,r.setAttribute("data-l10n-id",g(cs,Uv)[i]);const o=document.createElement("span");r.append(o),o.className="swatch",o.style.backgroundColor=s,r.setAttribute("aria-selected",s===g(this,Fg)),r.addEventListener("click",W(this,Gv,kk).bind(this,s),{signal:e}),t.append(r)}return t.addEventListener("keydown",W(this,Yv,Ik).bind(this),{signal:e}),t},Gv=new WeakSet,kk=function(t,e){e.stopPropagation(),g(this,Wv).dispatch("switchannotationeditorparams",{source:this,type:g(this,Bg),value:t})},Yv=new WeakSet,Ik=function(t){cs._keyboardManager.exec(this,t)},ja=new WeakSet,_u=function(t){if(g(this,Vo,Rl)){this.hideDropdown();return}if(V(this,zv,t.detail===0),g(this,lc)||(V(this,lc,new AbortController),window.addEventListener("pointerdown",W(this,xS,o$).bind(this),{signal:g(this,jr).combinedSignal(g(this,lc))})),g(this,qn)){g(this,qn).classList.remove("hidden");return}const e=V(this,qn,W(this,jv,Ck).call(this));g(this,Ur).append(e)},xS=new WeakSet,o$=function(t){var e;(e=g(this,qn))!=null&&e.contains(t.target)||this.hideDropdown()},Vo=new WeakSet,Rl=function(){return g(this,qn)&&!g(this,qn).classList.contains("hidden")},F(cs,Uv,null);let ME=cs;var Vg,qv,Ga,Rd,Hg,fs,Kv,Xv,Ld,gr,Fs,vi,zg,Ya,Oi,$g,mr,Jv,Zv,Pk,Wg,O0,AS,a$,CS,l$,kS,c$,Qv,Mk,qa,Eu,cc,ef,IS,u$,Ug,D0,Fd,Hp,PS,d$,MS,h$,OS,f$,DS,g$,RS,m$;
222const Mt=class Mt extends yn{constructor(e){super({...e,name:"highlightEditor"});F(this,Zv);F(this,Wg);F(this,AS);F(this,CS);F(this,kS);F(this,Qv);F(this,qa);F(this,IS);F(this,Ug);F(this,Fd);F(this,PS);F(this,MS);F(this,RS);F(this,Vg,null);F(this,qv,0);F(this,Ga,void 0);F(this,Rd,null);F(this,Hg,null);F(this,fs,null);F(this,Kv,null);F(this,Xv,0);F(this,Ld,null);F(this,gr,null);F(this,Fs,null);F(this,vi,!1);F(this,zg,null);F(this,Ya,void 0);F(this,Oi,null);F(this,$g,"");F(this,mr,void 0);F(this,Jv,"");this.color=e.color||Mt._defaultColor,V(this,mr,e.thickness||Mt._defaultThickness),V(this,Ya,e.opacity||Mt._defaultOpacity),V(this,Ga,e.boxes||null),V(this,Jv,e.methodOfCreation||""),V(this,$g,e.text||""),this._isDraggable=!1,e.highlightId>-1?(V(this,vi,!0),W(this,Wg,O0).call(this,e),W(this,qa,Eu).call(this)):g(this,Ga)&&(V(this,Vg,e.anchorNode),V(this,qv,e.anchorOffset),V(this,Kv,e.focusNode),V(this,Xv,e.focusOffset),W(this,Zv,Pk).call(this),W(this,qa,Eu).call(this),this.rotate(this.rotation))}static get _keyboardManager(){const e=Mt.prototype;return wt(this,"_keyboardManager",new ky([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:g(this,vi)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:g(this,mr),methodOfCreation:g(this,Jv)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("
222color").size}}static initialize(e,i){var s;yn.initialize(e,i),Mt._defaultColor||(Mt._defaultColor=((s=i.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(e,i){switch(e){case xt.HIGHLIGHT_DEFAULT_COLOR:Mt._defaultColor=i;break;case xt.HIGHLIGHT_THICKNESS:Mt._defaultThickness=i;break}}translateInPage(e,i){}get toolbarPosition(){return g(this,zg)}updateParams(e,i){switch(e){case xt.HIGHLIGHT_COLOR:W(this,AS,a$).call(this,i);break;case xt.HIGHLIGHT_THICKNESS:W(this,CS,l$).call(this,i);break}}static get defaultPropertiesToUpdate(){return[[xt.HIGHLIGHT_DEFAULT_COLOR,Mt._defaultColor],[xt.HIGHLIGHT_THICKNESS,Mt._defaultThickness]]}get propertiesToUpdate(){return[[xt.HIGHLIGHT_COLOR,this.color||Mt._defaultColor],[xt.HIGHLIGHT_THICKNESS,g(this,mr)||Mt._defaultThickness],[xt.HIGHLIGHT_FREE,g(this,vi)]]}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(V(this,Hg,new ME({editor:this})),e.addColorPicker(g(this,Hg))),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(W(this,Fd,Hp).call(this))}getBaseTranslation(){return[0,0]}getRect(e,i){return super.getRect(e,i,W(this,Fd,Hp).call(this))}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){W(this,Qv,Mk).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(W(this,qa,Eu).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?W(this,Qv,Mk).call(this):e&&(W(this,qa,Eu).call(this,e),i=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(e),this.show(this._isVisible),i&&this.select()}rotate(e){var r,o,a;const{drawLayer:i}=this.parent;let s;g(this,vi)?(e=(e-this.rotation+360)%360,s=W(r=Mt,cc,ef).call(r,g(this,gr).box,e)):s=W(o=Mt,cc,ef).call(o,[this.x,this.y,this.width,this.height],e),i.updateProperties(g(this,Fs),{bbox:s,root:{"data-main-rotation":e}}),i.updateProperties(g(this,Oi),{bbox:W(a=Mt,cc,ef).call(a,g(this,fs).box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();g(this,$g)&&(e.setAttribute("aria-label",g(this,$g)),e.setAttribute("role","mark")),g(this,vi)?e.classList.add("free"):this.div.addEventListener("keydown",W(this,IS,u$).bind(this),{signal:this._uiManager._signal});const i=V(this,Ld,document.createElement("div"));e.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",i.style.clipPath=g(this,Rd);const[s,r]=this.parentDimensions;return this.setDims(this.width*s,this.height*r),CE(this,g(this,Ld),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(g(this,Oi),{rootClass:{hovered:!0}})}pointerleave(){var e;this.isSelected||(e=this.parent)==null||e.drawLayer.updateProperties(g(this,Oi),{rootClass:{hovered:!1}})}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:W(this,Ug,D0).call(this,!0);break;case 1:case 3:W(this,Ug,D0).call(this,!1);break}}select(){var e;super.select(),g(this,Oi)&&((e=this.parent)==null||e.drawLayer.updateProperties(g(this,Oi),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var e;super.unselect(),g(this,Oi)&&((e=this.parent)==null||e.drawLayer.updateProperties(g(this,Oi),{rootClass:{selected:!1}}),g(this,vi)||W(this,Ug,D0).call(this,!1))}get _mustFixPosition(){return!g(this,vi)}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(g(this,Fs),{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(g(this,Oi),{rootClass:{hidden:!e}}))}static startHighlighting(e,i,{target:s,x:r,y:o}){const{x:a,y:l,width:c,height:u}=s.getBoundingClientRect(),d=new AbortController,h=e.combinedSignal(d),f=p=>{d.abort(),W(this,DS,g$).call(this,e,p)};window.addEventListener("blur",f,{signal:h}),window.addEventListener("pointerup",f,{signal:h}),window.addEventListener("pointerdown",$s,{capture:!0,passive:!1,signal:h}),window.addEventListener("contextmenu",lo,{signal:h}),s.addEventListener("pointermove",W(this,OS,f$).bind(this,e),{signal:h}),this._freeHighlight=new Ak({x:r,y:o},[a,l,c,u],e.scale,this._defaultThickness/2,i,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(e,i,s){var v,E,x,A;let r=null;if(e instanceof zz){const{data:{quadPoints:O,rect:I,rotation:T,id:P,color:k,opacity:D,popupRef:U},parent:{page:{pageNumber:Y}}}=e;r=e={annotationType:ut.HIGHLIGHT,color:Array.from(k),opacity:D,quadPoints:O,boxes:null,pageIndex:Y-1,rect:I.slice(0),rotation:T,id:P,deleted:!1,popupRef:U}}else if(e instanceof pM){const{data:{inkLists:O,rect:I,rotation:T,id:P,color:k,borderStyle:{rawWidth:D},popupRef:U},parent:{page:{pageNumber:Y}}}=e;r=e={annotationType:ut.HIGHLIGHT,color:Array.from(k),thickness:D,inkLists:O,boxes:null,pageIndex:Y-1,rect:I.slice(0),rotation:T,id:P,deleted:!1,popupRef:U}}const{color:o,quadPoints:a,inkLists:l,opacity:c}=e,u=await super.deserialize(e,i,s);u.color=ze.makeHexColor(...o),V(u,Ya,c||1),l&&V(u,mr,e.thickness),u.annotationElementId=e.id||null,u._initialData=r;const[d,h]=u.pageDimensions,[f,p]=u.pageTranslation;if(a){const O=V(u,Ga,[]);for(let I=0;I<a.length;I+=8)O.push({x:(a[I]-f)/d,y:1-(a[I+1]-p)/h,width:(a[I+2]-a[I])/d,height:(a[I+1]-a[I+5])/h});W(v=u,Zv,Pk).call(v),W(E=u,qa,Eu).call(E),u.rotate(u.rotation)}else if(l){V(u,vi,!0);const O=l[0],I={x:O[0]-f,y:h-(O[1]-p)},T=new Ak(I,[0,0,d,h],1,g(u,mr)/2,!0,.001);for(let D=0,U=O.length;D<U;D+=2)I.x=O[D]-f,I.y=h-(O[D+1]-p),T.add(I);const{id:P,clipPathId:k}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:u.color,"fill-opacity":u._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:T.toSVGPath()}},!0,!0);W(x=u,Wg,O0).call(x,{highlightOutlines:T.getOutlines(),highlightId:P,clipPathId:k}),W(A=u,qa,Eu).call(A)}return u}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const i=this.getRect(0,0),s=yn._colorManager.convert(this.color),r={annotationType:ut.HIGHLIGHT,color:s,opacity:g(this,Ya),thickness:g(this,mr),quadPoints:W(this,PS,d$).call(this),outlines:W(this,MS,h$).call(this,i),pageIndex:this.pageIndex,rect:i,rotation:W(this,Fd,Hp).call(this),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!W(this,RS,m$).call(this,r)?null:(r.id=this.annotationElementId,r)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};Vg=new WeakMap,qv=new WeakMap,Ga=new WeakMap,Rd=new WeakMap,Hg=new WeakMap,fs=new WeakMap,Kv=new WeakMap,Xv=new WeakMap,Ld=new WeakMap,gr=new WeakMap,Fs=new WeakMap,vi=new WeakMap,zg=new WeakMap,Ya=new WeakMap,Oi=new WeakMap,$g=new WeakMap,mr=new WeakMap,Jv=new WeakMap,Zv=new WeakSet,Pk=function(){const e=new Tk(g(this,Ga),.001);V(this,gr,e.getOutlines()),[this.x,this.y,this.width,this.height]=g(this,gr).box;const i=new Tk(g(this,Ga),.0025,.001,this._uiManager.direction==="ltr");V(this,fs,i.getOutlines());const{lastPoint:s}=g(this,fs);V(this,zg,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height])},Wg=new WeakSet,O0=function({highlightOutlines:e,highlightId:i,clipPathId:s}){var d,h;V(this,gr,e);const r=1.5;if(V(this,fs,e.getNewOutline(g(this,mr)/2+r,.0025)),i>=0)V(this,Fs,i),V(this,Rd,s),this.parent.drawLayer.finalizeDraw(i,{bbox:e.box,path:{d:e.toSVGPath()}}),V(this,Oi,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:g(this,fs).box,path:{d:g(this,fs).toSVGPath()}},!0));else if(this.parent){const f=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(g(this,Fs),{bbox:W(d=Mt,cc,ef).
222call(d,g(this,gr).box,(f-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(g(this,Oi),{bbox:W(h=Mt,cc,ef).call(h,g(this,fs).box,f),path:{d:g(this,fs).toSVGPath()}})}const[o,a,l,c]=e.box;switch(this.rotation){case 0:this.x=o,this.y=a,this.width=l,this.height=c;break;case 90:{const[f,p]=this.parentDimensions;this.x=a,this.y=1-o,this.width=l*p/f,this.height=c*f/p;break}case 180:this.x=1-o,this.y=1-a,this.width=l,this.height=c;break;case 270:{const[f,p]=this.parentDimensions;this.x=1-a,this.y=o,this.width=l*p/f,this.height=c*f/p;break}}const{lastPoint:u}=g(this,fs);V(this,zg,[(u[0]-o)/l,(u[1]-a)/c])},AS=new WeakSet,a$=function(e){const i=(o,a)=>{var l,c;this.color=o,V(this,Ya,a),(l=this.parent)==null||l.drawLayer.updateProperties(g(this,Fs),{root:{fill:o,"fill-opacity":a}}),(c=g(this,Hg))==null||c.updateColor(o)},s=this.color,r=g(this,Ya);this.addCommands({cmd:i.bind(this,e,Mt._defaultOpacity),undo:i.bind(this,s,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:xt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)},CS=new WeakSet,l$=function(e){const i=g(this,mr),s=r=>{V(this,mr,r),W(this,kS,c$).call(this,r)};this.addCommands({cmd:s.bind(this,e),undo:s.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:xt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)},kS=new WeakSet,c$=function(e){if(!g(this,vi))return;W(this,Wg,O0).call(this,{highlightOutlines:g(this,gr).getNewOutline(e/2)}),this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)},Qv=new WeakSet,Mk=function(){g(this,Fs)===null||!this.parent||(this.parent.drawLayer.remove(g(this,Fs)),V(this,Fs,null),this.parent.drawLayer.remove(g(this,Oi)),V(this,Oi,null))},qa=new WeakSet,Eu=function(e=this.parent){g(this,Fs)===null&&({id:Gi(this,Fs)._,clipPathId:Gi(this,Rd)._}=e.drawLayer.draw({bbox:g(this,gr).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":g(this,Ya)},rootClass:{highlight:!0,free:g(this,vi)},path:{d:g(this,gr).toSVGPath()}},!1,!0),V(this,Oi,e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:g(this,vi)},bbox:g(this,fs).box,path:{d:g(this,fs).toSVGPath()}},g(this,vi))),g(this,Ld)&&(g(this,Ld).style.clipPath=g(this,Rd)))},cc=new WeakSet,ef=function([e,i,s,r],o){switch(o){case 90:return[1-i-r,e,r,s];case 180:return[1-e-s,1-i-r,s,r];case 270:return[i,1-e-s,r,s]}return[e,i,s,r]},IS=new WeakSet,u$=function(e){Mt._keyboardManager.exec(this,e)},Ug=new WeakSet,D0=function(e){if(!g(this,Vg))return;const i=window.getSelection();e?i.setPosition(g(this,Vg),g(this,qv)):i.setPosition(g(this,Kv),g(this,Xv))},Fd=new WeakSet,Hp=function(){return g(this,vi)?this.rotation:0},PS=new WeakSet,d$=function(){if(g(this,vi))return null;const[e,i]=this.pageDimensions,[s,r]=this.pageTranslation,o=g(this,Ga),a=new Float32Array(o.length*8);let l=0;for(const{x:c,y:u,width:d,height:h}of o){const f=c*e+s,p=(1-u)*i+r;a[l]=a[l+4]=f,a[l+1]=a[l+3]=p,a[l+2]=a[l+6]=f+d*e,a[l+5]=a[l+7]=p-h*i,l+=8}return a},MS=new WeakSet,h$=function(e){return g(this,gr).serialize(e,W(this,Fd,Hp).call(this))},OS=new WeakSet,f$=function(e,i){this._freeHighlight.add(i)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},DS=new WeakSet,g$=function(e,i){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(i,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},RS=new WeakSet,m$=function(e){const{color:i}=this._initialData;return e.color.some((s,r)=>s!==i[r])},F(Mt,cc),F(Mt,OS),F(Mt,DS),y(Mt,"_defaultColor",null),y(Mt,"_defaultOpacity",1),y(Mt,"_defaultThickness",12),y(Mt,"_type","highlight"),y(Mt,"_editorType",ut.HIGHLIGHT),y(Mt,"_freeHighlightId",-1),y(Mt,"_freeHighlight",null),y(Mt,"_freeHighlightClipId","");let OE=Mt;var Nd;class $le{constructor(){F(this,Nd,Object.create(null))}updateProperty(t,e){this[t]=e,this.updateSVGProperty(t,e)}updateProperties(t){if(t)for(const[e,i]of Object.entries(t))this.updateProperty(e,i)}updateSVGProperty(t,e){g(this,Nd)[t]=e}toSVGProperties(){const t=g(this,Nd);return V(this,Nd,Object.create(null)),{root:t}}reset(){V(this,Nd,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){Xt("Not implemented")}}Nd=new WeakMap;var Ns,jg,ri,Bd,Vd,uc,dc,hc,Hd,ey,Dk,ty,Rk,ny,Lk,zd,zp,LS,p$,Gg,R0,$d,$p,fc,tf;const Ve=class Ve extends yn{constructor(e){super(e);F(this,ey);F(this,ty);F(this,ny);F(this,zd);F(this,LS);F(this,Gg);F(this,$d);F(this,fc);F(this,Ns,null);F(this,jg,void 0);y(this,"_drawId",null);
222V(this,jg,e.mustBeCommitted||!1),e.drawOutlines&&(W(this,ey,Dk).call(this,e),W(this,zd,zp).call(this))}static _mergeSVGProperties(e,i){const s=new Set(Object.keys(e));for(const[r,o]of Object.entries(i))s.has(r)?Object.assign(e[r],o):e[r]=o;return e}static getDefaultDrawingOptions(e){Xt("Not implemented")}static get typesMap(){Xt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,i){const s=this.typesMap.get(e);s&&this._defaultDrawingOptions.updateProperty(s,i),this._currentParent&&(g(Ve,ri).updateProperty(s,i),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,i){const s=this.constructor.typesMap.get(e);s&&this._updateProperty(e,s,i)}static get defaultPropertiesToUpdate(){const e=[],i=this._defaultDrawingOptions;for(const[s,r]of this.typesMap)e.push([s,i[r]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:i}=this;for(const[s,r]of this.constructor.typesMap)e.push([s,i[r]]);return e}_updateProperty(e,i,s){const r=this._drawingOptions,o=r[i],a=l=>{var u;r.updateProperty(i,l);const c=g(this,Ns).updateProperty(i,l);c&&W(this,$d,$p).call(this,c),(u=this.parent)==null||u.drawLayer.updateProperties(this._drawId,r.toSVGProperties())};this.addCommands({cmd:a.bind(this,s),undo:a.bind(this,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,Ve._mergeSVGProperties(g(this,Ns).getPathResizingSVGProperties(W(this,Gg,R0).call(this)),{bbox:W(this,fc,tf).call(this)}))}_onResized(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,Ve._mergeSVGProperties(g(this,Ns).getPathResizedSVGProperties(W(this,Gg,R0).call(this)),{bbox:W(this,fc,tf).call(this)}))}_onTranslating(e,i){var s;(s=this.parent)==null||s.drawLayer.updateProperties(this._drawId,{bbox:W(this,fc,tf).call(this,e,i)})}_onTranslated(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,Ve._mergeSVGProperties(g(this,Ns).getPathTranslatedSVGProperties(W(this,Gg,R0).call(this),this.parentDimensions),{bbox:W(this,fc,tf).call(this)}))}_onStartDragging(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var e;(e=this.parent)==null||e.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,g(this,jg)&&(V(this,jg,!1),this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){W(this,ny,Lk).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(W(this,zd,zp).call(this),W(this,$d,$p).call(this,g(this,Ns).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){var s;let i=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),W(this,ny,Lk).call(this)):e&&(this._uiManager.addShouldRescale(this),W(this,zd,zp).call(this,e),i=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(e),i&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Ve._mergeSVGProperties({bbox:W(this,fc,tf).call(this)},g(this,Ns).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&W(this,$d,$p).call(this,g(this,Ns).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;const e=super.render();e.classList.add("draw");const i=document.createElement("div");e.append(i),i.setAttribute("aria-hidden","true"),i.className="internal";const[s,r]=this.parentDimensions;return this.setDims(this.width*s,this.height*r),this._uiManager.addShouldRescale(this),this.disableEditing(),e}static createDrawerInstance(e,i,s,r,o){Xt("Not implemented")}static startDrawing(e,i,s,r){var E;const{target:o,offsetX:a,offsetY:l,pointerId:c,pointerType:u}=r;if(g(Ve,dc)&&g(Ve,dc)!==u)return;const{viewport:{rotation:d}}=e,{width:h,height:f}=o.getBoundingClientRect(),p=V(Ve,Bd,new AbortController),v=e.combinedSignal(p);if(g(Ve,uc)||V(Ve,uc,c),g(Ve,dc)??V(Ve,dc,u),window.addEventListener("pointerup",x=>{var A;g(Ve,uc)===x.pointerId?this._endDraw(x):(A=g(Ve,hc))==null||A.delete(x.pointerId)},{signal:v}),window.addEventListener("pointercancel",x=>{var A;g(Ve,uc)===x.pointerId?this._currentParent.endDrawingSession():(A=g(Ve,hc))==null||A.delete(x.pointerId)},{signal:v}),window.addEventListener("pointerdown",x=>{g(Ve,dc)===x.pointerType&&((g(Ve,hc)||V(Ve,hc,new Set)).add(x.pointerId),g(Ve,ri).isCancellable()&&(g(Ve,ri).removeLastElement(),g(Ve,ri).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:v}),window.addEventListener("contextmenu",lo,{signal:v}),o.addEventListener("pointermove",this._drawMove.bind(this),{signal:v}),o.addEventListener("touchmove",x=>{x.timeStamp===g(Ve,Hd)&&$s(x)},{signal:v}),e.toggleDrawing(),(E=i._editorUndoBar)==null||E.hide(),g(Ve,ri)){e.drawLayer.updateProperties(this._currentDrawId,g(Ve,ri).startNew(a,l,h,f,d));return}i.updateUIForDefaultProperties(this),V(Ve,ri,this.createDrawerInstance(a,l,h,f,d)),V(Ve,Vd,this.getDefaultDrawingOptions()),this._currentParent=e,{id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(g(Ve,Vd).toSVGProperties(),g(Ve,ri).defaultSVGProperties),!0,!1)}static _drawMove(e){var o;if(V(Ve,Hd,-1),!g(Ve,ri))return;const{offsetX:i,offsetY:s,pointerId:r}=e;if(g(Ve,uc)===r){if(((o=g(Ve,hc))==null?void 0:o.size)>=1){this._endDraw(e);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,g(Ve,ri).add(i,s)),V(Ve,Hd,e.timeStamp),$s(e)}}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,V(Ve,ri,null),V(Ve,Vd,null),V(Ve,dc,null),V(Ve,Hd,NaN)),g(Ve,Bd)&&(g(Ve,Bd).abort(),V(Ve,Bd,null),V(Ve,uc,NaN),V(Ve,hc,null))}static _endDraw(e){const i=this._currentParent;if(i){if(i.toggleDrawing(!0),this._cleanup(!1),e&&i.drawLayer.updateProperties(this._currentDrawId,g(Ve,ri).end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const s=g(Ve,ri),r=this._currentDrawId,o=s.getLastElement();i.addCommands({cmd:()=>{i.drawLayer.updateProperties(r,s.setLastElement(o))},undo:()=>{i.drawLayer.updateProperties(r,s.removeLastElement())},mustExec:!1,type:xt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(e){const i=this._currentParent;if(!i)return null;if(i.toggleDrawing(!0),i.cleanUndoStack(xt.DRAW_STEP),!g(Ve,ri).isEmpty()){const{pageDimensions:[s,r],scale:o}=i,a=i.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:g(Ve,ri).getOutlines(s*o,r*o,o,this._INNER_MARGIN),drawingOptions:g(Ve,Vd),mustBeCommitted:!e});return this._cleanup(!0),a}return i.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,i,s,r,o,a){Xt("Not implemented")}static async deserialize(e,i,s){var d,h;const{rawDims:{pageWidth:r,pageHeight:o,pageX:a,pageY:l}}=i.viewport,c=this.deserializeDraw(a,l,r,o,this._INNER_MARGIN,e),u=await super.deserialize(e,i,s);return u.createDrawingOptions(e),W(d=u,ey,Dk).call(d,{drawOutlines:c}),W(h=u,zd,zp).call(h),u.onScaleChanging(),u.rotate(),u}serializeDraw(e){const[i,s]=this.pageTranslation,[r,o]=this.pageDimensions;return g(this,Ns).serialize([i,s,r,o],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};Ns=new WeakMap,jg=new WeakMap,ri=new WeakMap,Bd=new WeakMap,Vd=new WeakMap,uc=new WeakMap,dc=new WeakMap,hc=new WeakMap,Hd=new WeakMap,ey=new WeakSet,Dk=function({drawOutlines:e,drawId:i,drawingOptions:s}){V(this,Ns,e),this._drawingOptions||(this._drawingOptions=s),i>=0?(this._drawId=i,this.parent.drawLayer.finalizeDraw(i,e.defaultProperties)):this._drawId=W(this,ty,Rk).call(this,e,this.parent),W(this,$d,$p).call(this,e.box)},ty=new WeakSet,Rk=function(e,i){const{id:s}=i.drawLayer.draw(Ve._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return s},ny=new WeakSet,Lk=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},zd=new WeakSet,zp=function(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=W(this,ty,Rk).call(this,g(this,Ns),e)}},LS=new WeakSet,p$=function([e,i,s,r]){const{parentDimensions:[o,a],rotation:l}=this;switch(l){case 90:return[i,1-e,s*(a/o),r*(o/a)];case 180:return[1-e,1-i,s,r];case 270:return[1-i,e,s*(a/o),r*(o/a)];default:return[e,i,s,r]}},Gg=new WeakSet,R0=function(){const{x:e,y:i,width:s,height:r,parentDimensions:[o,a],rotation:l}=this;switch(l){case 90:return[1-i,e,s*(o/a),r*(a/o)];case 180:return[1-e,1-i,s,r];case 270:return[i,1-e,s*(o/a),r*(a/o)];default:return[e,i,s,r]}},$d=new WeakSet,$p=function(e){if([this.x,this.y,this.width,this.height]=W(this,LS,p$).call(this,e),this.div){this.fixAndSetPosition();const[i,s]=this.parentDimensions;this.setDims(this.width*i,this.height*s)}this._onResized()},fc=new WeakSet,tf=function(){const{x:e,y:i,width:s,height:r,rotation:o,parentRotation:a,parentDimensions:[l,c]}=this;switch((o*4+a)/90){case 1:return[1-i-r,e,r,s];case 2:return[1-e-s,1-i-r,s,r];case 3:return[i,1-e-s,r,s];case 4:return[e,i-s*(l/c),r*(c/l),s*(l/c)];case 5:return[1-i,e,s*(l/c),r*(c/l)];case 6:return[1-e-r*(c/l),1-i,r*(c/l),s*(l/c)];case 7:return[i-s*(l/c),1-e-r*(c/l),s*(l/c),r*(c/l)];case 8:return[e-s,i-r,s,r];case 9:return[1-i,e-s,r,s];case 10:return[1-e,1-i,s,r];case 11:return[i-r,1-e,r,s];case 12:return[e-r*(c/l),i,r*(c/l),s*(l/c)];case 13:return[1-i-s*(l/c),e-r*(c/l),s*(l/c),r*(c/l)];case 14:return[1-e,1-i-s*(l/c),r*(c/l),s*(l/c)];case 15:return[i,1-e,s*(l/c),r*(c/l)];default:return[e,i,s,r]}},y(Ve,"_currentDrawId",-1),y(Ve,"_currentParent",null),F(Ve,ri,null),F(Ve,Bd,null),F(Ve,Vd,null),F(Ve,uc,NaN),F(Ve,dc,null),F(Ve,hc,null),F(Ve,Hd,NaN),y(Ve,"_INNER_MARGIN",3);let Ok=Ve;var Ho,oi,ai,Wd,Yg,Xi,yi,pr,Ud,jd,Gd,qg,L0;class Wle{constructor(t,e,i,s,r,o){F(this,qg);F(this,Ho,new Float64Array(6));F(this,oi,void 0);F(this,ai,void 0);F(this,Wd,void 0);F(this,Yg,void 0);F(this,Xi,void 0);F(this,yi,"");F(this,pr,0);F(this,Ud,new DE);F(this,jd,void 0);F(this,Gd,void 0);V(this,jd,i),V(this,Gd,s),V(this,Wd,r),V(this,Yg,o),[t,e]=W(this,qg,L0).call(this,t,e);const a=V(this,oi,[NaN,NaN,NaN,NaN,t,e]);V(this,Xi,[t,e]),V(this,ai,[{line:a,points:g(this,Xi)}]),g(this,Ho).set(a,0)}updateProperty(t,e){t==="stroke-width"&&V(this,Yg,e)}isEmpty(){return!g(this,ai)||g(this,ai).length===0}isCancellable(){return g(this,Xi).length<=10}add(t,e){[t,e]=W(this,qg,L0).call(this,t,e);
222const[i,s,r,o]=g(this,Ho).subarray(2,6),a=t-r,l=e-o;return Math.hypot(g(this,jd)*a,g(this,Gd)*l)<=2?null:(g(this,Xi).push(t,e),isNaN(i)?(g(this,Ho).set([r,o,t,e],2),g(this,oi).push(NaN,NaN,NaN,NaN,t,e),{path:{d:this.toSVGPath()}}):(isNaN(g(this,Ho)[0])&&g(this,oi).splice(6,6),g(this,Ho).set([i,s,r,o,t,e],0),g(this,oi).push(...Ne.createBezierPoints(i,s,r,o,t,e)),{path:{d:this.toSVGPath()}}))}end(t,e){const i=this.add(t,e);return i||(g(this,Xi).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,e,i,s,r){V(this,jd,i),V(this,Gd,s),V(this,Wd,r),[t,e]=W(this,qg,L0).call(this,t,e);const o=V(this,oi,[NaN,NaN,NaN,NaN,t,e]);V(this,Xi,[t,e]);const a=g(this,ai).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),g(this,ai).push({line:o,points:g(this,Xi)}),g(this,Ho).set(o,0),V(this,pr,0),this.toSVGPath(),null}getLastElement(){return g(this,ai).at(-1)}setLastElement(t){return g(this,ai)?(g(this,ai).push(t),V(this,oi,t.line),V(this,Xi,t.points),V(this,pr,0),{path:{d:this.toSVGPath()}}):g(this,Ud).setLastElement(t)}removeLastElement(){if(!g(this,ai))return g(this,Ud).removeLastElement();g(this,ai).pop(),V(this,yi,"");for(let t=0,e=g(this,ai).length;t<e;t++){const{line:i,points:s}=g(this,ai)[t];V(this,oi,i),V(this,Xi,s),V(this,pr,0),this.toSVGPath()}return{path:{d:g(this,yi)}}}toSVGPath(){const t=Ne.svgRound(g(this,oi)[4]),e=Ne.svgRound(g(this,oi)[5]);if(g(this,Xi).length===2)return V(this,yi,`${g(this,yi)} M ${t} ${e} Z`),g(this,yi);if(g(this,Xi).length<=6){const s=g(this,yi).lastIndexOf("M");V(this,yi,`${g(this,yi).slice(0,s)} M ${t} ${e}`),V(this,pr,6)}if(g(this,Xi).length===4){const s=Ne.svgRound(g(this,oi)[10]),r=Ne.svgRound(g(this,oi)[11]);return V(this,yi,`${g(this,yi)} L ${s} ${r}`),V(this,pr,12),g(this,yi)}const i=[];g(this,pr)===0&&(i.push(`M ${t} ${e}`),V(this,pr,6));for(let s=g(this,pr),r=g(this,oi).length;s<r;s+=6){const[o,a,l,c,u,d]=g(this,oi).slice(s,s+6).map(Ne.svgRound);i.push(`C${o} ${a} ${l} ${c} ${u} ${d}`)}return V(this,yi,g(this,yi)+i.join(" ")),V(this,pr,g(this,oi).length),g(this,yi)}getOutlines(t,e,i,s){const r=g(this,ai).at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),g(this,Ud).build(g(this,ai),t,e,i,g(this,Wd),g(this,Yg),s),V(this,Ho,null),V(this,oi,null),V(this,ai,null),V(this,yi,null),g(this,Ud)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Ho=new WeakMap,oi=new WeakMap,ai=new WeakMap,Wd=new WeakMap,Yg=new WeakMap,Xi=new WeakMap,yi=new WeakMap,pr=new WeakMap,Ud=new WeakMap,jd=new WeakMap,Gd=new WeakMap,qg=new WeakSet,L0=function(t,e){return Ne._normalizePoint(t,e,g(this,jd),g(this,Gd),g(this,Wd))};var Ji,iy,sy,Bs,zo,$o,Kg,Xg,Jg,Gr,ma,FS,b$,NS,w$,BS,v$;const PO=class PO extends Ne{constructor(){super(...arguments);F(this,Gr);F(this,FS);F(this,NS);F(this,BS);F(this,Ji,void 0);F(this,iy,0);F(this,sy,void 0);F(this,Bs,void 0);F(this,zo,void 0);F(this,$o,void 0);F(this,Kg,void 0);F(this,Xg,void 0);F(this,Jg,void 0)}build(e,i,s,r,o,a,l){V(this,zo,i),V(this,$o,s),V(this,Kg,r),V(this,Xg,o),V(this,Jg,a),V(this,sy,l??0),V(this,Bs,e),W(this,NS,w$).call(this)}setLastElement(e){return g(this,Bs).push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return g(this,Bs).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:i}of g(this,Bs)){if(e.push(`M${Ne.svgRound(i[4])} ${Ne.svgRound(i[5])}`),i.length===6){e.push("Z");continue}if(i.length===12){e.push(`L${Ne.svgRound(i[10])} ${Ne.svgRound(i[11])}`);continue}for(let s=6,r=i.length;s<r;s+=6){const[o,a,l,c,u,d]=i.subarray(s,s+6).map(Ne.svgRound);e.push(`C${o} ${a} ${l} ${c} ${u} ${d}`)}}return e.join("")}serialize([e,i,s,r],o){const a=[],l=[],[c,u,d,h]=W(this,FS,b$).call(this);let f,p,v,E,x,A,O,I,T;switch(g(this,Xg)){case 0:T=Ne._rescale,f=e,p=i+r,v=s,E=-r,x=e+c*s,A=i+(1-u-h)*r,O=e+(c+d)*s,I=i+(1-u)*r;break;case 90:T=Ne._rescaleAndSwap,f=e,p=i,v=s,E=r,x=e+u*s,A=i+c*r,O=e+(u+h)*s,I=i+(c+d)*r;break;case 180:T=Ne._rescale,f=e+s,p=i,v=-s,E=r,x=e+(1-c-d)*s,A=i+u*r,O=e+(1-c)*s,I=i+(u+h)*r;break;case 270:T=Ne._rescaleAndSwap,f=e+s,p=i+r,v=-s,E=-r,x=e+(1-u-h)*s,A=i+(1-c-d)*r,O=e+(1-u)*s,I=i+(1-c)*r;break}for(const{line:P,points:k}of g(this,Bs))a.push(T(P,f,p,v,E,o?new Array(P.length):null)),l.push(T(k,f,p,v,E,o?new Array(k.length):null));return{lines:a,points:l,rect:[x,A,O,I]}}static deserialize(e,i,s,r,o,{paths:{lines:a,points:l},rotation:c,thickness:u}){const d=[];let h,f,p,v,E;switch(c){case 0:E=Ne._rescale,h=-e/s,f=i/r+1,p=1/s,v=-1/r;break;case 90:E=Ne._rescaleAndSwap,h=-i/r,f=-e/s,p=1/r,v=1/s;break;case 180:E=Ne._rescale,h=e/s+1,f=-i/r,p=-1/s,v=1/r;break;case 270:E=Ne._rescaleAndSwap,h=i/r+1,f=e/s+1,p=-1/r,v=-1/s;break}if(!a){a=[];for(const A of l){const O=A.length;if(O===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,A[0],A[1]]));continue}if(O===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,A[0],A[1],NaN,NaN,NaN,NaN,A[2],A[3]]));continue}const I=new Float32Array(3*(O-2));a.push(I);let[T,P,k,D]=A.subarray(0,4);I.set([NaN,NaN,NaN,NaN,T,P],0);for(let U=4;U<O;U+=2){const Y=A[U],K=A[U+1];I.set(Ne.createBezierPoints(T,P,k,D,Y,K),(U-2)*3),[T,P,k,D]=[k,D,Y,K]}}}for(let A=0,O=a.length;A<O;A++)d.push({line:E(a[A].map(I=>I??NaN),h,f,p,v),points:E(l[A].map(I=>I??NaN),h,f,p,v)});const x=new PO;return x.build(d,s,r,1,c,u,o),x}get box(){return g(this,Ji)}updateProperty(e,i){return e==="stroke-width"?W(this,BS,v$).call(this,i):null}updateParentDimensions([e,i],s){const[r,o]=W(this,Gr,ma).call(this);V(this,zo,e),V(this,$o,i),V(this,Kg,s);const[a,l]=W(this,Gr,ma).call(this),c=a-r,u=l-o,d=g(this,Ji);return d[0]-=c,d[1]-=u,d[2]+=2*c,d[3]+=2*u,d}updateRotation(e){return V(this,iy,e),{path:{transform:this.rotationTransform}}}get viewBox(){return g(this,Ji).map(Ne.svgRound).join(" ")}get defaultProperties(){const[e,i]=g(this,Ji);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Ne.svgRound(e)} ${Ne.svgRound(i)}`}}}get rotationTransform(){const[,,e,i]=g(this,Ji);let s=0,r=0,o=0,a=0,l=0,c=0;switch(g(this,iy)){case 90:r=i/e,o=-e/i,l=e;break;case 180:s=-1,a=-1,l=e,c=i;break;case 270:r=-i/e,o=e/i,c=i;break;default:return""}return`matrix(${s} ${r} ${o} ${a} ${Ne.svgRound(l)} ${Ne.svgRound(c)})`}getPathResizingSVGProperties([e,i,s,r]){const[o,a]=W(this,Gr,ma).call(this),[l,c,u,d]=g(this,Ji);if(Math.abs(u-o)<=Ne.PRECISION||Math.abs(d-a)<=Ne.PRECISION){const E=e+s/2-(l+u/2),x=i+r/2-(c+d/2);return{path:{"transform-origin":`${Ne.svgRound(e)} ${Ne.svgRound(i)}`,transform:`${this.rotationTransform} translate(${E} ${x})`}}}const h=(s-2*o)/(u-2*o),f=(r-2*a)/(d-2*a),p=u/s,v=d/r;return{path:{"transform-origin":`${Ne.svgRound(l)} ${Ne.svgRound(c)}`,transform:`${this.rotationTransform} scale(${p} ${v}) translate(${Ne.svgRound(o)} ${Ne.svgRound(a)}) scale(${h} ${f}) translate(${Ne.svgRound(-o)} ${Ne.svgRound(-a)})`}}}getPathResizedSVGProperties([e,i,s,r]){const[o,a]=W(this,Gr,ma).call(this),l=g(this,Ji),[c,u,d,h]=l;if(l[0]=e,l[1]=i,l[2]=s,l[3]=r,Math.abs(d-o)<=Ne.PRECISION||Math.abs(h-a)<=Ne.PRECISION){const x=e+s/2-(c+d/2),A=i+r/2-(u+h/2);for(const{line:O,points:I}of g(this,Bs))Ne._translate(O,x,A,O),Ne._translate(I,x,A,I);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Ne.svgRound(e)} ${Ne.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const f=(s-2*o)/(d-2*o),p=(r-2*a)/(h-2*a),v=-f*(c+o)+e+o,E=-p*(u+a)+i+a;if(f!==1||p!==1||v!==0||E!==0)for(const{line:x,points:A}of g(this,Bs))Ne._rescale(x,v,E,f,p,x),Ne._rescale(A,v,E,f,p,A);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Ne.svgRound(e)} ${Ne.svgRound(i)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,i],s){const[r,o]=s,a=g(this,Ji),l=e-a[0],c=i-a[1];if(g(this,zo)===r&&g(this,$o)===o)for(const{line:u,points:d}of g(this,Bs))Ne._translate(u,l,c,u),Ne._translate(d,l,c,d);else{const u=g(this,zo)/r,d=g(this,$o)/o;V(this,zo,r),V(this,$o,o);for(const{line:h,points:f}of g(this,Bs))Ne._rescale(h,l,c,u,d,h),Ne._rescale(f,l,c,u,d,f);a[2]*=u,a[3]*=d}return a[0]=e,a[1]=i,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Ne.svgRound(e)} ${Ne.svgRound(i)}`}}}get defaultSVGProperties(){const e=g(this,Ji);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Ne.svgRound(e[0])} ${Ne.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}};Ji=new WeakMap,iy=new WeakMap,sy=new WeakMap,Bs=new WeakMap,zo=new WeakMap,$o=new WeakMap,Kg=new WeakMap,Xg=new WeakMap,Jg=new WeakMap,Gr=new WeakSet,ma=function(e=g(this,Jg)){const i=g(this,sy)+e/2*g(this,Kg);
222return g(this,Xg)%180===0?[i/g(this,zo),i/g(this,$o)]:[i/g(this,$o),i/g(this,zo)]},FS=new WeakSet,b$=function(){const[e,i,s,r]=g(this,Ji),[o,a]=W(this,Gr,ma).call(this,0);return[e+o,i+a,s-2*o,r-2*a]},NS=new WeakSet,w$=function(){const e=V(this,Ji,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:r}of g(this,Bs)){if(r.length<=12){for(let l=4,c=r.length;l<c;l+=6){const[u,d]=r.subarray(l,l+2);e[0]=Math.min(e[0],u),e[1]=Math.min(e[1],d),e[2]=Math.max(e[2],u),e[3]=Math.max(e[3],d)}continue}let o=r[4],a=r[5];for(let l=6,c=r.length;l<c;l+=6){const[u,d,h,f,p,v]=r.subarray(l,l+6);ze.bezierBoundingBox(o,a,u,d,h,f,p,v,e),o=p,a=v}}const[i,s]=W(this,Gr,ma).call(this);e[0]=Math.min(1,Math.max(0,e[0]-i)),e[1]=Math.min(1,Math.max(0,e[1]-s)),e[2]=Math.min(1,Math.max(0,e[2]+i)),e[3]=Math.min(1,Math.max(0,e[3]+s)),e[2]-=e[0],e[3]-=e[1]},BS=new WeakSet,v$=function(e){const[i,s]=W(this,Gr,ma).call(this);V(this,Jg,e);const[r,o]=W(this,Gr,ma).call(this),[a,l]=[r-i,o-s],c=g(this,Ji);return c[0]-=a,c[1]-=l,c[2]+=2*a,c[3]+=2*l,c};let DE=PO;var Zg;const MO=class MO extends $le{constructor(e){super();F(this,Zg,void 0);V(this,Zg,e),super.updateProperties({fill:"none",stroke:yn._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,i){e==="stroke-width"&&(i??(i=this["stroke-width"]),i*=g(this,Zg).realScale),super.updateSVGProperty(e,i)}clone(){const e=new MO(g(this,Zg));return e.updateAll(this),e}};Zg=new WeakMap;let Fk=MO;var VS,y$;const pf=class pf extends Ok{constructor(e){super({...e,name:"inkEditor"});F(this,VS);this._willKeepAspectRatio=!0}static initialize(e,i){yn.initialize(e,i),this._defaultDrawingOptions=new Fk(i.viewParameters)}static getDefaultDrawingOptions(e){const i=this._defaultDrawingOptions.clone();return i.updateProperties(e),i}static get supportMultipleDrawings(){return!0}static get typesMap(){return wt(this,"typesMap",new Map([[xt.INK_THICKNESS,"stroke-width"],[xt.INK_COLOR,"stroke"],[xt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,i,s,r,o){return new Wle(e,i,s,r,o,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,i,s,r,o,a){return DE.deserialize(e,i,s,r,o,a)}static async deserialize(e,i,s){let r=null;if(e instanceof pM){const{data:{inkLists:a,rect:l,rotation:c,id:u,color:d,opacity:h,borderStyle:{rawWidth:f},popupRef:p},parent:{page:{pageNumber:v}}}=e;r=e={annotationType:ut.INK,color:Array.from(d),thickness:f,opacity:h,paths:{points:a},boxes:null,pageIndex:v-1,rect:l.slice(0),rotation:c,id:u,deleted:!1,popupRef:p}}const o=await super.deserialize(e,i,s);return o.annotationElementId=e.id||null,o._initialData=r,o}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:i,parent:s}=this;i.updateSVGProperty("stroke-width"),s.drawLayer.updateProperties(e,i.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:i,opacity:s}){this._drawingOptions=pf.getDefaultDrawingOptions({stroke:ze.makeHexColor(...e),"stroke-width":i,"stroke-opacity":s})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:i,points:s,rect:r}=this.serializeDraw(e),{_drawingOptions:{stroke:o,"stroke-opacity":a,"stroke-width":l}}=this,c={annotationType:ut.INK,color:yn._colorManager.convert(o),opacity:a,thickness:l,paths:{lines:i,points:s},pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?c:this.annotationElementId&&!W(this,VS,y$).call(this,c)?null:(c.id=this.annotationElementId,c)}renderAnnotationElement(e){const{points:i,rect:s}=this.serializeDraw(!1);return e.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:i}),null}};VS=new WeakSet,y$=function(e){const{color:i,thickness:s,opacity:r,pageIndex:o}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||e.color.some((a,l)=>a!==i[l])||e.thickness!==s||e.opacity!==r||e.pageIndex!==o},y(pf,"_type","ink"),y(pf,"_editorType",ut.INK),y(pf,"_defaultDrawingOptions",null);let Nk=pf;var vn,_i,gc,Ka,mc,Qg,Wo,Uo,Vs,em,Yd,Wp,qd,Up,tm,F0,ry,Vk,nm,N0,oy,Hk,im,B0,HS,_$;const pb=class pb extends yn{constructor(e){super({...e,name:"stampEditor"});F(this,Yd);F(this,qd);F(this,tm);F(this,ry);F(this,nm);F(this,oy);F(this,im);F(this,HS);F(this,vn,null);F(this,_i,null);F(this,gc,null);F(this,Ka,null);F(this,mc,null);F(this,Qg,"");F(this,Wo,null);F(this,Uo,null);F(this,Vs,!1);F(this,em,!1);V(this,Ka,e.bitmapUrl),V(this,mc,e.bitmapFile)}static initialize(e,i){yn.initialize(e,i)}static get supportedTypes(){return wt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(i=>`image/${i}`))}static get supportedTypesStr(){return wt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,i){i.pasteEditor(ut.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var e;return{type:"stamp",hasAltText:!!((e=this.altTextData)!=null&&e.altText)}}static computeTelemetryFinalData(e){const i=e.get("hasAltText");return{hasAltText:i.get(!0)??0,hasNoAltText:i.get(!1)??0}}async mlGuessAltText(e=null,i=!0){if(this.hasAltTextData())return null;const{mlManager:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:r,width:o,height:a}=e||this.copyCanvas(null,null,!0).imageData,l=await s.guess({name:"altText",request:{data:r,width:o,height:a,channels:r.length/(o*a)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const c=l.output;return await this.setGuessedAltText(c),i&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){var e;g(this,_i)&&(V(this,vn,null),this._uiManager.imageManager.deleteId(g(this,_i)
222),(e=g(this,Wo))==null||e.remove(),V(this,Wo,null),g(this,Uo)&&(clearTimeout(g(this,Uo)),V(this,Uo,null))),super.remove()}rebuild(){if(!this.parent){g(this,_i)&&W(this,tm,F0).call(this);return}super.rebuild(),this.div!==null&&(g(this,_i)&&g(this,Wo)===null&&W(this,tm,F0).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(g(this,gc)||g(this,vn)||g(this,Ka)||g(this,mc)||g(this,_i))}get isResizable(){return!0}render(){if(this.div)return this.div;let e,i;if(this.width&&(e=this.x,i=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),g(this,vn)?W(this,ry,Vk).call(this):W(this,tm,F0).call(this),this.width&&!this.annotationElementId){const[s,r]=this.parentDimensions;this.setAt(e*s,i*r,this.width*s,this.height*r)}return this._uiManager.addShouldRescale(this),this.div}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;g(this,Uo)!==null&&clearTimeout(g(this,Uo)),V(this,Uo,setTimeout(()=>{V(this,Uo,null),W(this,oy,Hk).call(this)},200))}copyCanvas(e,i,s=!1){var f;e||(e=224);const{width:r,height:o}=g(this,vn),a=new FC;let l=g(this,vn),c=r,u=o,d=null;if(i){if(r>i||o>i){const D=Math.min(i/r,i/o);c=Math.floor(r*D),u=Math.floor(o*D)}d=document.createElement("canvas");const p=d.width=Math.ceil(c*a.sx),v=d.height=Math.ceil(u*a.sy);g(this,Vs)||(l=W(this,nm,N0).call(this,p,v));const E=d.getContext("2d");E.filter=this._uiManager.hcmFilter;let x="white",A="#cfcfd8";this._uiManager.hcmFilter!=="none"?A="black":(f=window.matchMedia)!=null&&f.call(window,"(prefers-color-scheme: dark)").matches&&(x="#8f8f9d",A="#42414d");const O=15,I=O*a.sx,T=O*a.sy,P=new OffscreenCanvas(I*2,T*2),k=P.getContext("2d");k.fillStyle=x,k.fillRect(0,0,I*2,T*2),k.fillStyle=A,k.fillRect(0,0,I,T),k.fillRect(I,T,I,T),E.fillStyle=E.createPattern(P,"repeat"),E.fillRect(0,0,p,v),E.drawImage(l,0,0,l.width,l.height,0,0,p,v)}let h=null;if(s){let p,v;if(a.symmetric&&l.width<e&&l.height<e)p=l.width,v=l.height;else if(l=g(this,vn),r>e||o>e){const A=Math.min(e/r,e/o);p=Math.floor(r*A),v=Math.floor(o*A),g(this,Vs)||(l=W(this,nm,N0).call(this,p,v))}const x=new OffscreenCanvas(p,v).getContext("2d",{willReadFrequently:!0});x.drawImage(l,0,0,l.width,l.height,0,0,p,v),h={width:p,height:v,data:x.getImageData(0,0,p,v).data}}return{canvas:d,width:c,height:u,imageData:h}}getImageForAltText(){return g(this,Wo)}static async deserialize(e,i,s){var v;let r=null;if(e instanceof $z){const{data:{rect:E,rotation:x,id:A,structParent:O,popupRef:I},container:T,parent:{page:{pageNumber:P}}}=e,k=T.querySelector("canvas"),D=s.imageManager.getFromCanvas(T.id,k);k.remove();const U=((v=await i._structTree.getAriaAttributes(`${lM}${A}`))==null?void 0:v.get("aria-label"))||"";r=e={annotationType:ut.STAMP,bitmapId:D.id,bitmap:D.bitmap,pageIndex:P-1,rect:E.slice(0),rotation:x,id:A,deleted:!1,accessibilityData:{decorative:!1,altText:U},isSvg:!1,structParent:O,popupRef:I}}const o=await super.deserialize(e,i,s),{rect:a,bitmap:l,bitmapUrl:c,bitmapId:u,isSvg:d,accessibilityData:h}=e;u&&s.imageManager.isValidId(u)?(V(o,_i,u),l&&V(o,vn,l)):V(o,Ka,c),V(o,Vs,d);const[f,p]=o.pageDimensions;return o.width=(a[2]-a[0])/f,o.height=(a[3]-a[1])/p,o.annotationElementId=e.id||null,h&&(o.altTextData=h),o._initialData=r,V(o,em,!!r),o}serialize(e=!1,i=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s={annotationType:ut.STAMP,bitmapId:g(this,_i),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:g(this,Vs),structTreeParentId:this._structTreeParentId};if(e)return s.bitmapUrl=W(this,im,B0).call(this,!0),s.accessibilityData=this.serializeAltText(!0),s;const{decorative:r,altText:o}=this.serializeAltText(!1);if(!r&&o&&(s.accessibilityData={type:"Figure",alt:o}),this.annotationElementId){const l=W(this,HS,_$).call(this,s);if(l.isSame)return null;l.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1}if(s.id=this.annotationElementId,i===null)return s;i.stamps||(i.stamps=new Map);const a=g(this,Vs)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;
222if(!i.stamps.has(g(this,_i)))i.stamps.set(g(this,_i),{area:a,serialized:s}),s.bitmap=W(this,im,B0).call(this,!1);else if(g(this,Vs)){const l=i.stamps.get(g(this,_i));a>l.area&&(l.area=a,l.serialized.bitmap.close(),l.serialized.bitmap=W(this,im,B0).call(this,!1))}return s}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}};vn=new WeakMap,_i=new WeakMap,gc=new WeakMap,Ka=new WeakMap,mc=new WeakMap,Qg=new WeakMap,Wo=new WeakMap,Uo=new WeakMap,Vs=new WeakMap,em=new WeakMap,Yd=new WeakSet,Wp=function(e,i=!1){if(!e){this.remove();return}V(this,vn,e.bitmap),i||(V(this,_i,e.id),V(this,Vs,e.isSvg)),e.file&&V(this,Qg,e.file.name),W(this,ry,Vk).call(this)},qd=new WeakSet,Up=function(){if(V(this,gc,null),this._uiManager.enableWaiting(!1),!!g(this,Wo)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,vn)){this._editToolbar.hide(),this._uiManager.editAltText(this,!0);return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&g(this,vn)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},tm=new WeakSet,F0=function(){if(g(this,_i)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(g(this,_i)).then(s=>W(this,Yd,Wp).call(this,s,!0)).finally(()=>W(this,qd,Up).call(this));return}if(g(this,Ka)){const s=g(this,Ka);V(this,Ka,null),this._uiManager.enableWaiting(!0),V(this,gc,this._uiManager.imageManager.getFromUrl(s).then(r=>W(this,Yd,Wp).call(this,r)).finally(()=>W(this,qd,Up).call(this)));return}if(g(this,mc)){const s=g(this,mc);V(this,mc,null),this._uiManager.enableWaiting(!0),V(this,gc,this._uiManager.imageManager.getFromFile(s).then(r=>W(this,Yd,Wp).call(this,r)).finally(()=>W(this,qd,Up).call(this)));return}const e=document.createElement("input");e.type="file",e.accept=pb.supportedTypesStr;const i=this._uiManager._signal;V(this,gc,new Promise(s=>{e.addEventListener("change",async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const r=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),W(this,Yd,Wp).call(this,r)}s()},{signal:i}),e.addEventListener("cancel",()=>{this.remove(),s()},{signal:i})}).finally(()=>W(this,qd,Up).call(this))),e.click()},ry=new WeakSet,Vk=function(){var d;const{div:e}=this;let{width:i,height:s}=g(this,vn);const[r,o]=this.pageDimensions,a=.75;if(this.width)i=this.width*r,s=this.height*o;else if(i>a*r||s>a*o){const h=Math.min(a*r/i,a*o/s);i*=h,s*=h}const[l,c]=this.parentDimensions;this.setDims(i*l/r,s*c/o),this._uiManager.enableWaiting(!1);const u=V(this,Wo,document.createElement("canvas"));u.setAttribute("role","img"),this.addContainer(u),this.width=i/r,this.height=s/o,(d=this._initialOptions)!=null&&d.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),W(this,oy,Hk).call(this),g(this,em)||(this.parent.addUndoableEditor(this),V(this,em,!0)),this._reportTelemetry({action:"inserted_image"}),g(this,Qg)&&u.setAttribute("aria-label",g(this,Qg))},nm=new WeakSet,N0=function(e,i){const{width:s,height:r}=g(this,vn);let o=s,a=r,l=g(this,vn);for(;o>2*e||a>2*i;){const c=o,u=a;o>2*e&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2)),a>2*i&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const d=new OffscreenCanvas(o,a);d.getContext("2d").drawImage(l,0,0,c,u,0,0,o,a),l=d.transferToImageBitmap()}return l},oy=new WeakSet,Hk=function(){const[e,i]=this.parentDimensions,{width:s,height:r}=this,o=new FC,a=Math.ceil(s*e*o.sx),l=Math.ceil(r*i*o.sy),c=g(this,Wo);if(!c||c.width===a&&c.height===l)return;c.width=a,c.height=l;const u=g(this,Vs)?g(this,vn):W(this,nm,N0).call(this,a,l),d=c.getContext("2d");d.filter=this._uiManager.hcmFilter,d.drawImage(u,0,0,u.width,u.height,0,0,a,l)},im=new WeakSet,B0=function(e){if(e){if(g(this,Vs)){const r=this._uiManager.imageManager.getSvgUrl(g(this,_i)
222);if(r)return r}const i=document.createElement("canvas");return{width:i.width,height:i.height}=g(this,vn),i.getContext("2d").drawImage(g(this,vn),0,0),i.toDataURL()}if(g(this,Vs)){const[i,s]=this.pageDimensions,r=Math.round(this.width*i*Hc.PDF_TO_CSS_UNITS),o=Math.round(this.height*s*Hc.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(r,o);return a.getContext("2d").drawImage(g(this,vn),0,0,g(this,vn).width,g(this,vn).height,0,0,r,o),a.transferToImageBitmap()}return structuredClone(g(this,vn))},HS=new WeakSet,_$=function(e){var a;const{pageIndex:i,accessibilityData:{altText:s}}=this._initialData,r=e.pageIndex===i,o=(((a=e.accessibilityData)==null?void 0:a.alt)||"")===s;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&r&&o,isSameAltText:o}},y(pb,"_type","stamp"),y(pb,"_editorType",ut.STAMP);let Bk=pb;var Kd,sm,jo,pc,Xa,br,bc,rm,Xd,Yr,Ja,Di,Za,He,wc,zS,E$,wr,So,ay,$k,ly,Wk,om,V0;const Mr=class Mr{constructor({uiManager:t,pageIndex:e,div:i,structTreeLayer:s,accessibilityManager:r,annotationLayer:o,drawLayer:a,textLayer:l,viewport:c,l10n:u}){F(this,zS);F(this,wr);F(this,ay);F(this,ly);F(this,om);F(this,Kd,void 0);F(this,sm,!1);F(this,jo,null);F(this,pc,null);F(this,Xa,null);F(this,br,new Map);F(this,bc,!1);F(this,rm,!1);F(this,Xd,!1);F(this,Yr,null);F(this,Ja,null);F(this,Di,null);F(this,Za,null);F(this,He,void 0);const d=[...g(Mr,wc).values()];if(!Mr._initialized){Mr._initialized=!0;for(const h of d)h.initialize(u,t)}t.registerEditorTypes(d),V(this,He,t),this.pageIndex=e,this.div=i,V(this,Kd,r),V(this,jo,o),this.viewport=c,V(this,Di,l),this.drawLayer=a,this._structTree=s,g(this,He).addLayer(this)}get isEmpty(){return g(this,br).size===0}get isInvisible(){return this.isEmpty&&g(this,He).getMode()===ut.NONE}updateToolbar(t){g(this,He).updateToolbar(t)}updateMode(t=g(this,He).getMode()){switch(W(this,om,V0).call(this),t){case ut.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case ut.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case ut.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of g(Mr,wc).values())e.toggle(`${i._type}Editing`,t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===((e=g(this,Di))==null?void 0:e.div)}setEditingState(t){g(this,He).setEditingState(t)}addCommands(t){g(this,He).addCommands(t)}cleanUndoStack(t){g(this,He).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var e;(e=g(this,jo))==null||e.div.classList.toggle("disabled",!t)}async enable(){V(this,Xd,!0),this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of g(this,br).values())i.enableEditing(),i.show(!0),i.annotationElementId&&(g(this,He).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!g(this,jo)){V(this,Xd,!1);return}const e=g(this,jo).getEditableAnnotations();for(const i of e){if(i.hide(),g(this,He).isDeletedAnnotationElement(i.data.id)||t.has(i.data.id))continue;const s=await this.deserialize(i);s&&(this.addOrRebuild(s),s.enableEditing())}V(this,Xd,!1)}disable(){var s;V(this,rm,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const r of g(this,br).values())if(r.disableEditing(),!!r.annotationElementId){if(r.serialize()!==null){t.set(r.annotationElementId,r);continue}else e.set(r.annotationElementId,r);(s=this.getEditableAnnotation(r.annotationElementId))==null||s.show(),r.remove()}if(g(this,jo)){const r=g(this,jo).getEditableAnnotations();for(const o of r){const{id:a}=o.data;if(g(this,He).isDeletedAnnotationElement(a))continue;let l=e.get(a);if(l){l.resetAnnotationElement(o),l.show(!1),o.show();continue}l=t.get(a),l&&(g(this,He).addChangedExistingAnnotation(l),l.renderAnnotationElement(o)&&l.show(!1)),o.show()}}W(this,om,V0).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:i}=this.div;for(const r of g(Mr,wc).values())i.remove(`${r._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),V(this,rm,!1)}getEditableAnnotation(t){var e;return((e=g(this,jo))==null?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){g(this,He).getActive()!==t&&g(this,He).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=g(this,Di))!=null&&t.div&&!g(this,Za)){V(this,Za,new AbortController);const e=g(this,He).combinedSignal(g(this,Za));g(this,Di).div.addEventListener("pointerdown",W(this,zS,E$).bind(this),{signal:e}),g(this,Di).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=g(this,Di))!=null&&t.div&&g(this,Za)&&(g(this,Za).abort(),V(this,Za,null),g(this,Di).div.classList.remove("highlighting"))}enableClick(){if(g(this,pc))return;V(this,pc,new AbortController);const t=g(this,He).combinedSignal(g(this,pc));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const e=this.pointerup.bind(this);this.div.addEventListener("pointerup",e,{signal:t}),this.div.addEventListener("pointercancel",e,{signal:t})}disableClick(){var t;(t=g(this,pc))==null||t.abort(),V(this,pc,null)}attach(t){g(this,br).set(t.id,t);const{annotationElementId:e}=t;e&&g(this,He).isDeletedAnnotationElement(e)&&g(this,He).removeDeletedAnnotationElement(t)}detach(t){var e;g(this,br).delete(t.id),(e=g(this,Kd))==null||e.removePointerInTextLayer(t.contentDiv),!g(this,rm)&&t.annotationElementId&&g(this,He).addDeletedAnnotationElement(t)}remove(t){this.detach(t),g(this,He).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(g(this,He).addDeletedAnnotationElement(t.annotationElementId),yn.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(e=t.parent)==null||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}
222add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),g(this,He).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!g(this,Xd)),g(this,He).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var i;if(!t.isAttachedToDOM)return;const{activeElement:e}=document;t.div.contains(e)&&!g(this,Xa)&&(t._focusEventsAllowed=!1,V(this,Xa,setTimeout(()=>{V(this,Xa,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:g(this,He)._signal}),e.focus())},0))),t._structTreeParentId=(i=g(this,Kd))==null?void 0:i.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const e=()=>t._uiManager.rebuild(t),i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getNextId(){return g(this,He).getId()}combinedSignal(t){return g(this,He).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=g(this,wr,So))==null?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){g(this,He).updateToolbar(t),g(this,He).updateMode(t);const{offsetX:i,offsetY:s}=W(this,ly,Wk).call(this),r=this.getNextId(),o=W(this,ay,$k).call(this,{parent:this,id:r,x:i,y:s,uiManager:g(this,He),isCentered:!0,...e});o&&this.add(o)}async deserialize(t){var e;return await((e=g(Mr,wc).get(t.annotationType??t.annotationEditorType))==null?void 0:e.deserialize(t,this,g(this,He)))||null}createAndAddNewEditor(t,e,i={}){const s=this.getNextId(),r=W(this,ay,$k).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:g(this,He),isCentered:e,...i});return r&&this.add(r),r}addNewEditor(){this.createAndAddNewEditor(W(this,ly,Wk).call(this),!0)}setSelected(t){g(this,He).setSelected(t)}toggleSelected(t){g(this,He).toggleSelected(t)}unselect(t){g(this,He).unselect(t)}pointerup(t){var i;const{isMac:e}=es.platform;if(!(t.button!==0||t.ctrlKey&&e)&&t.target===this.div&&g(this,bc)&&(V(this,bc,!1),!((i=g(this,wr,So))!=null&&i.isDrawer&&g(this,wr,So).supportMultipleDrawings))){if(!g(this,sm)){V(this,sm,!0);return}if(g(this,He).getMode()===ut.STAMP){g(this,He).unselectAll();return}this.createAndAddNewEditor(t,!1)}}pointerdown(t){var s;if(g(this,He).getMode()===ut.HIGHLIGHT&&this.enableTextSelection(),g(this,bc)){V(this,bc,!1);return}const{isMac:e}=es.platform;if(t.button!==0||t.ctrlKey&&e||t.target!==this.div)return;if(V(this,bc,!0),(s=g(this,wr,So))!=null&&s.isDrawer){this.startDrawingSession(t);return}const i=g(this,He).getActive();V(this,sm,!i||i.isEmpty())}startDrawingSession(t){if(this.div.focus(),g(this,Yr)){g(this,wr,So).startDrawing(this,g(this,He),!1,t);return}g(this,He).setCurrentDrawingSession(this),V(this,Yr,new AbortController);const e=g(this,He).combinedSignal(g(this,Yr));this.div.addEventListener("blur",({relatedTarget:i})=>{i&&!this.div.contains(i)&&(V(this,Ja,null),this.commitOrRemove())},{signal:e}),g(this,wr,So).startDrawing(this,g(this,He),!1,t)}pause(t){if(t){const{activeElement:e}=document;this.div.contains(e)&&V(this,Ja,e);return}g(this,Ja)&&setTimeout(()=>{var e;(e=g(this,Ja))==null||e.focus(),V(this,Ja,null)},0)}endDrawingSession(t=!1){return g(this,Yr)?(g(this,He).setCurrentDrawingSession(null),g(this,Yr).abort(),V(this,Yr,null),V(this,Ja,null),g(this,wr,So).endDrawing(t)):null}findNewParent(t,e,i){const s=g(this,He).findParent(e,i);return s===null||s===this?!1:(s.changeParent(t),!0)}commitOrRemove(){return g(this,Yr)?(this.endDrawingSession(),!0):!1}onScaleChanging(){g(this,Yr)&&g(this,wr,So).onScaleChangingWhenDrawing(this)}destroy(){var t,e;this.commitOrRemove(),((t=g(this,He).getActive())==null?void 0:t.parent)===this&&(g(this,He).commitOrRemove(),g(this,He).setActiveEditor(null)),g(this,Xa)&&(clearTimeout(g(this,Xa)),V(this,Xa,null));for(const i of g(this,br).values())(e=g(this,Kd))==null||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove();this.div=null,g(this,br).clear(),g(this,He).removeLayer(this)}render({viewport:t}){this.viewport=t,hh(this.div,t);for(const e of g(this,He).getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:t}){g(this,He).commitOrRemove(),W(this,om,V0).call(this);const e=this.viewport.rotation,i=t.rotation;if(this.viewport=t,hh(this.div,{rotation:i}),e!==i)for(const s of g(this,br).values())s.rotate(i)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return g(this,He).viewParameters.realScale}};Kd=new WeakMap,sm=new WeakMap,jo=new WeakMap,pc=new WeakMap,Xa=new WeakMap,br=new WeakMap,bc=new WeakMap,rm=new WeakMap,Xd=new WeakMap,Yr=new WeakMap,Ja=new WeakMap,Di=new WeakMap,Za=new WeakMap,He=new WeakMap,wc=new WeakMap,zS=new WeakSet,E$=function(t){g(this,He).unselectAll();const{target:e}=t;if(e===g(this,Di).div||(e.getAttribute("role")==="img"||e.classList.contains("endOfContent"))&&g(this,Di).div.contains(e)){const{isMac:i}=es.platform;if(t.button!==0||t.ctrlKey&&i)return;g(this,He).showAllEditors("highlight",!0,!0),g(this,Di).div.classList.add("free"),this.toggleDrawing(),OE.startHighlighting(this,g(this,He).direction==="ltr",{target:g(this,Di).div,x:t.x,y:t.y}),g(this,Di).div.addEventListener("pointerup",()=>{g(this,Di).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:g(this,He)._signal}),t.preventDefault()}},wr=new WeakSet,So=function(){return g(Mr,wc).get(g(this,He).getMode())},ay=new WeakSet,$k=function(t){const e=g(this,wr,So);return e?new e.prototype.constructor(t):null},ly=new WeakSet,Wk=function(){const{x:t,y:e,width:i,height:s}=this.div.getBoundingClientRect(),r=Math.max(0,t),o=Math.max(0,e),a=Math.min(window.innerWidth,t+i),l=Math.min(window.innerHeight,e+s),c=(r+a)/2-t,u=(o+l)/2-e,[d,h]=this.viewport.rotation%180===0?[c,u]:[u,c];return{offsetX:d,offsetY:h}},om=new WeakSet,V0=function(){for(const t of g(this,br).values())t.isEmpty()&&t.remove()},y(Mr,"_initialized",!1),F(Mr,wc,new Map([Ek,Nk,Bk,OE].map(t=>[t._editorType,t])));let zk=Mr;
222var qr,cy,Zi,Jd,$S,S$,uy,jk,WS,T$,dy,Gk;const Ii=class Ii{constructor({pageIndex:t}){F(this,uy);F(this,WS);F(this,dy);F(this,qr,null);F(this,cy,0);F(this,Zi,new Map);F(this,Jd,new Map);this.pageIndex=t}setParent(t){if(!g(this,qr)){V(this,qr,t);return}if(g(this,qr)!==t){if(g(this,Zi).size>0)for(const e of g(this,Zi).values())e.remove(),t.append(e);V(this,qr,t)}}static get _svgFactory(){return wt(this,"_svgFactory",new mM)}draw(t,e=!1,i=!1){const s=Gi(this,cy)._++,r=W(this,uy,jk).call(this),o=Ii._svgFactory.createElement("defs");r.append(o);const a=Ii._svgFactory.createElement("path");o.append(a);const l=`path_p${this.pageIndex}_${s}`;a.setAttribute("id",l),a.setAttribute("vector-effect","non-scaling-stroke"),e&&g(this,Jd).set(s,a);const c=i?W(this,WS,T$).call(this,o,l):null,u=Ii._svgFactory.createElement("use");return r.append(u),u.setAttribute("href",`#${l}`),this.updateProperties(r,t),g(this,Zi).set(s,r),{id:s,clipPathId:`url(#${c})`}}drawOutline(t,e){const i=Gi(this,cy)._++,s=W(this,uy,jk).call(this),r=Ii._svgFactory.createElement("defs");s.append(r);const o=Ii._svgFactory.createElement("path");r.append(o);const a=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",a),o.setAttribute("vector-effect","non-scaling-stroke");let l;if(e){const d=Ii._svgFactory.createElement("mask");r.append(d),l=`mask_p${this.pageIndex}_${i}`,d.setAttribute("id",l),d.setAttribute("maskUnits","objectBoundingBox");const h=Ii._svgFactory.createElement("rect");d.append(h),h.setAttribute("width","1"),h.setAttribute("height","1"),h.setAttribute("fill","white");const f=Ii._svgFactory.createElement("use");d.append(f),f.setAttribute("href",`#${a}`),f.setAttribute("stroke","none"),f.setAttribute("fill","black"),f.setAttribute("fill-rule","nonzero"),f.classList.add("mask")}const c=Ii._svgFactory.createElement("use");s.append(c),c.setAttribute("href",`#${a}`),l&&c.setAttribute("mask",`url(#${l})`);const u=c.cloneNode();return s.append(u),c.classList.add("mainOutline"),u.classList.add("secondaryOutline"),this.updateProperties(s,t),g(this,Zi).set(i,s),i}finalizeDraw(t,e){g(this,Jd).delete(t),this.updateProperties(t,e)}updateProperties(t,e){var l;if(!e)return;const{root:i,bbox:s,rootClass:r,path:o}=e,a=typeof t=="number"?g(this,Zi).get(t):t;if(a){if(i&&W(this,dy,Gk).call(this,a,i),s&&W(l=Ii,$S,S$).call(l,a,s),r){const{classList:c}=a;for(const[u,d]of Object.entries(r))c.toggle(u,d)}if(o){const u=a.firstChild.firstChild;W(this,dy,Gk).call(this,u,o)}}}updateParent(t,e){if(e===this)return;const i=g(this,Zi).get(t);i&&(g(e,qr).append(i),g(this,Zi).delete(t),g(e,Zi).set(t,i))}remove(t){g(this,Jd).delete(t),g(this,qr)!==null&&(g(this,Zi).get(t).remove(),g(this,Zi).delete(t))}destroy(){V(this,qr,null);for(const t of g(this,Zi).values())t.remove();g(this,Zi).clear(),g(this,Jd).clear()}};qr=new WeakMap,cy=new WeakMap,Zi=new WeakMap,Jd=new WeakMap,$S=new WeakSet,S$=function(t,[e,i,s,r]){const{style:o}=t;o.top=`${100*i}%`,o.left=`${100*e}%`,o.width=`${100*s}%`,o.height=`${100*r}%`},uy=new WeakSet,jk=function(){const t=Ii._svgFactory.create(1,1,!0);return g(this,qr).append(t),t.setAttribute("aria-hidden",!0),t},WS=new WeakSet,T$=function(t,e){const i=Ii._svgFactory.createElement("clipPath");t.append(i);const s=`clip_${e}`;i.setAttribute("id",s),i.setAttribute("clipPathUnits","objectBoundingBox");const r=Ii._svgFactory.createElement("use");return i.append(r),r.setAttribute("href",`#${e}`),r.classList.add("clip"),s},dy=new WeakSet,Gk=function(t,e){for(const[i,s]of Object.entries(e))s===null?t.removeAttribute(i):t.setAttribute(i,s)},F(Ii,$S);let Uk=Ii;globalThis.pdfjsTestingUtils={HighlightOutliner:Tk};nt.AbortException;nt.AnnotationEditorLayer;nt.AnnotationEditorParamsType;nt.AnnotationEditorType;nt.AnnotationEditorUIManager;nt.AnnotationLayer;nt.AnnotationMode;nt.ColorPicker;nt.DOMSVGFactory;nt.DrawLayer;nt.FeatureTest;var Ule=nt.GlobalWorkerOptions;nt.ImageKind;nt.InvalidPDFException;nt.MissingPDFException;nt.OPS;nt.OutputScale;nt.PDFDataRangeTransport;nt.PDFDateString;nt.PDFWorker;nt.PasswordResponses;nt.PermissionFlag;nt.PixelsPerInch;nt.RenderingCancelledException;nt.TextLayer;nt.TouchManager;nt.UnexpectedResponseException;nt.Util;nt.VerbosityLevel;nt.XfaLayer;nt.build;nt.createValidAbsoluteUrl;nt.fetchData;nt.getDocument;nt.getFilenameFromUrl;nt.getPdfFilenameFromUrl;nt.getXfaPageViewport;nt.isDataScheme;nt.isPdfFile;
222nt.noContextMenu;nt.normalizeUnicode;nt.setLayerDimensions;nt.shadow;nt.stopEvent;nt.version;const jle="/build/assets/pdf.worker-7c237f83.mjs";var x$={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(window,function(){return function(e){var i={};function s(r){if(i[r])return i[r].exports;var o=i[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,s),o.l=!0,o.exports}return s.m=e,s.c=i,s.d=function(r,o,a){s.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:a})},s.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},s.t=function(r,o){if(1&o&&(r=s(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var l in r)s.d(a,l,(function(c){return r[c]}).bind(null,l));return a},s.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return s.d(o,"a",o),o},s.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},s.p="/",s(s.s=1)}([function(e,i){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch{typeof window=="object"&&(s=window)}e.exports=s},function(e,i,s){s(2),e.exports=s(6)},function(e,i,s){(function(r,o){var a,l;function c(u){return(c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d})(u)}(function(u,d){c(i)=="object"&&e!==void 0?d():(l=typeof(a=d)=="function"?a.call(i,s,i,e):a)===void 0||(e.exports=l)})(0,function(){function u(I){var T=this.constructor;return this.then(function(P){return T.resolve(I()).then(function(){return P})},function(P){return T.resolve(I()).then(function(){return T.reject(P)})})}function d(){}function h(I){if(!(this instanceof h))throw new TypeError("Promises must be constructed via new");if(typeof I!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],x(I,this)}function f(I,T){for(;I._state===3;)I=I._value;I._state!==0?(I._handled=!0,h._immediateFn(function(){var P=I._state===1?T.onFulfilled:T.onRejected;if(P!==null){var k;try{k=P(I._value)}catch(D){return void v(T.promise,D)}p(T.promise,k)}else(I._state===1?p:v)(T.promise,I._value)})):I._deferreds.push(T)}function p(I,T){try{if(T===I)throw new TypeError("A promise cannot be resolved with itself.");if(T&&(c(T)=="object"||typeof T=="function")){var P=T.then;if(T instanceof h)return I._state=3,I._value=T,void E(I);if(typeof P=="function")return void x(function(k,D){return function(){k.apply(D,arguments)}}(P,T),I)}I._state=1,I._value=T,E(I)}catch(k){v(I,k)}}function v(I,T){I._state=2,I._value=T,E(I)}function E(I){I._state===2&&I._deferreds.length===0&&h._immediateFn(function(){I._handled||h._unhandledRejectionFn(I._value)});for(var T=0,P=I._deferreds.length;P>T;T++)f(I,I._deferreds[T]);I._deferreds=null}function x(I,T){var P=!1;try{I(function(k){P||(P=!0,p(T,k))},function(k){P||(P=!0,v(T,k))})}catch(k){if(P)return;P=!0,v(T,k)}}var A=setTimeout;h.prototype.catch=function(I){return this.then(null,I)},h.prototype.then=function(I,T){var P=new this.constructor(d);return f(this,new function(k,D,U){this.onFulfilled=typeof k=="function"?k:null,this.onRejected=typeof D=="function"?D:null,this.promise=U}(I,T,P)),P},h.prototype.finally=u,h.all=function(I){return new h(function(T,P){function k(K,j){try{if(j&&(c(j)=="object"||typeof j=="function")){var L=j.then;if(typeof L=="function")return void L.call(j,function(N){k(K,N)},P)}D[K]=j,--U==0&&T(D)}catch(N){P(N)}}if(!I||I.length===void 0)throw new TypeError("Promise.all accepts an array");var D=Array.prototype.slice.call(I);if(D.length===0)return T([]);for(var U=D.length,Y=0;D.length>Y;Y++)k(Y,D[Y])})},h.resolve=function(I){return I&&c(I)=="object"&&I.constructor===h?I:new h(function(T){T(I)})},h.reject=function(I){return new h(function(T,P){P(I)})},h.race=function(I){return new h(function(T,P){for(var k=0,D=I.length;D>k;k++)I[k].then(T,P)})},h._immediateFn=typeof r=="function"&&function(I){r(I)}||function(I){A(I,0)},h._unhandledRejectionFn=function(I){console!==void 0&&console&&console.warn("Possible Unhandled Promise Rejection:",I)};var O=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(o!==void 0)return o;throw Error("unable to locate global object")}();"Promise"in O?O.Promise.prototype.finally||(O.Promise.prototype.finally=u):O.Promise=h})}).call(this,s(3).setImmediate,s(0))},function(e,i,s){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,a=Function.prototype.apply;function l(c,u){this._id=c,this._clearFn=u}i.setTimeout=function(){return new l(a.call(setTimeout,o,arguments),clearTimeout)},i.setInterval=function(){return new l(a.call(setInterval,o,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(c){c&&c.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(o,this._id)},i.enroll=function(c,u){clearTimeout(c._idleTimeoutId),c._idleTimeout=u},i.unenroll=function(c){clearTimeout(c._idleTimeoutId),c._idleTimeout=-1},i._unrefActive=i.active=function(c){clearTimeout(c._idleTimeoutId);var u=c._idleTimeout;u>=0&&(c._idleTimeoutId=setTimeout(function(){c._onTimeout&&c._onTimeout()},u))},s(4),i.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,i.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,s(0))},function(e,i,s){(function(r,o){(function(a,l){if(!a.setImmediate){var c,u,d,h,f,p=1,v={},E=!1,x=a.document,A=Object.getPrototypeOf&&Object.getPrototypeOf(a);A=A&&A.setTimeout?A:a,{}.toString.call(a.process)==="[object process]"?c=function(T){o.nextTick(function(){I(T)})}:function(){if(a.postMessage&&!a.importScripts){var T=!0,P=a.onmessage;return a.onmessage=function(){T=!1},a.postMessage("","*"),a.onmessage=P,T}}()?(h="setImmediate$"+Math.random()+"$",f=function(T){T.source===a&&typeof T.data=="str
222ing"&&T.data.indexOf(h)===0&&I(+T.data.slice(h.length))},a.addEventListener?a.addEventListener("message",f,!1):a.attachEvent("onmessage",f),c=function(T){a.postMessage(h+T,"*")}):a.MessageChannel?((d=new MessageChannel).port1.onmessage=function(T){I(T.data)},c=function(T){d.port2.postMessage(T)}):x&&"onreadystatechange"in x.createElement("script")?(u=x.documentElement,c=function(T){var P=x.createElement("script");P.onreadystatechange=function(){I(T),P.onreadystatechange=null,u.removeChild(P),P=null},u.appendChild(P)}):c=function(T){setTimeout(I,0,T)},A.setImmediate=function(T){typeof T!="function"&&(T=new Function(""+T));for(var P=new Array(arguments.length-1),k=0;k<P.length;k++)P[k]=arguments[k+1];var D={callback:T,args:P};return v[p]=D,c(p),p++},A.clearImmediate=O}function O(T){delete v[T]}function I(T){if(E)setTimeout(I,0,T);else{var P=v[T];if(P){E=!0;try{(function(k){var D=k.callback,U=k.args;switch(U.length){case 0:D();break;case 1:D(U[0]);break;case 2:D(U[0],U[1]);break;case 3:D(U[0],U[1],U[2]);break;default:D.apply(void 0,U)}})(P)}finally{O(T),E=!1}}}}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,s(0),s(5))},function(e,i){var s,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function c(A){if(s===setTimeout)return setTimeout(A,0);if((s===a||!s)&&setTimeout)return s=setTimeout,setTimeout(A,0);try{return s(A,0)}catch{try{return s.call(null,A,0)}catch{return s.call(this,A,0)}}}(function(){try{s=typeof setTimeout=="function"?setTimeout:a}catch{s=a}try{r=typeof clearTimeout=="function"?clearTimeout:l}catch{r=l}})();var u,d=[],h=!1,f=-1;function p(){h&&u&&(h=!1,u.length?d=u.concat(d):f=-1,d.length&&v())}function v(){if(!h){var A=c(p);h=!0;for(var O=d.length;O;){for(u=d,d=[];++f<O;)u&&u[f].run();f=-1,O=d.length}u=null,h=!1,function(I){if(r===clearTimeout)return clearTimeout(I);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(I);try{r(I)}catch{try{return r.call(null,I)}catch{return r.call(this,I)}}}(A)}}function E(A,O){this.fun=A,this.array=O}function x(){}o.nextTick=function(A){var O=new Array(arguments.length-1);if(arguments.length>1)for(var I=1;I<arguments.length;I++)O[I-1]=arguments[I];d.push(new E(A,O)),d.length!==1||h||c(v)},E.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=x,o.addListener=x,o.once=x,o.off=x,o.removeListener=x,o.removeAllListeners=x,o.emit=x,o.prependListener=x,o.prependOnceListener=x,o.listeners=function(A){return[]},o.binding=function(A){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(A){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,i,s){s.r(i),s.d(i,"getInstance",function(){return I});var r={ASM:"asm",WASM:"ems",JS_WORKER:"jsworker",THREADED_WASM:"wasm-threads"};function o(T,P){if(typeof T!="string"||!P)return T;var k=P.substr(0,P.lastIndexOf("/"));return/^(\/|%2F|[a-z0-9-]+:)/i.test(T)?T:k+"/"+T}function a(T,P){var k=Object.keys(T);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(T);P&&(D=D.filter(function(U){return Object.getOwnPropertyDescriptor(T,U).enumerable})),k.push.apply(k,D)}return k}function l(T){for(var P=1;P<arguments.length;P++){var k=arguments[P]!=null?arguments[P]:{};P%2?a(Object(k),!0).forEach(function(D){c(T,D,k[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(k)):a(Object(k)).forEach(function(D){Object.defineProperty(T,D,Object.getOwnPropertyDescriptor(k,D))})}return T}function c(T,P,k){return P in T?Object.defineProperty(T,P,{value:k,enumerable:!0,configurable:!0,writable:!0}):T[P]=k,T}var u={},d=0;window.isPdfjs=!0,typeof console>"u"&&(window.console={log:function(){},warn:function(){},error:function(){}});var h=function(){for(var T=1;T<arguments.length;T++)for(var P=Object.keys(arguments[T]),k=0;k<P.length;k++)arguments[0][P[k]]=arguments[T][P[k]];return arguments[0]},f=function(T){var P=[];return T.forEach(function(k){P.push(k)}),P},p=function(T,P){var k;try{k=new CustomEvent(T,{detail:P,bubbles:!0,cancelable:!0})}catch{(k=document.createEvent("Event")).initEvent(T,!0,!0),k.detail=P}return k};window.PDFNet&&!u.skipPDFNetWebViewerWarning&&console.warn("PDFNet.js and WebViewer.js have been included in the same context. See https://www.pdftron.com/kb_same_context for an explanation of why this could be an error in your application.");var v=new Map,E=new Map;u.WebViewer=function(T,P){var k=this;if(E.get(P))throw new Error("Two instances of WebViewer were created on the same HTML element. Please create a new element for each instance of WebViewer");E.set(P,!0),P.addEventListener("ready",function K(){v.get(P).instance=k.getCompleteInstance(),P.removeEventListener("ready",K)}
222),this._validateOptions(T);var D=T.webviewerServerURL||T.pdftronServer;T.fullAPI&&D&&(T.forceClientSideInit||console.warn("The fullAPI and webviewerServerURL options have both been set so the forceClientSideInit option is now enabled. This means that WebViewer will switch to client side rendering and processing to allow use of the full API."),T.forceClientSideInit=!0),this.options=h({},u.WebViewer.Options,T);var U=this.options.path.length-1;U>0&&this.options.path[U]!=="/"&&(this.options.path+="/"),this.options.uiPath=this.options.path+this.options.uiPath,P||console.error("ViewerElement is not defined. This may be caused by calling the WebViewer constructor before the DOM is loaded, or an invalid selector. Please see http://r.pdftron.com/guides/quick-start for an example."),this.element=P,this.element.style.overflow="hidden";var Y=this;this.messageHandler=function(K){if(K.data==="requestl"&&K.source&&K.source.postMessage({type:"responsel",value:T.l||T.licenseKey},"*"),K.data.type==="requestConfig"&&K.data.id===Y.id&&K.source){var j=T.config?Y._correctRelativePath(T.config):"";K.source.postMessage({type:"responseConfig",value:j},"*")}},window.addEventListener("message",this.messageHandler,!1),this.options.autoCreate&&this.create()};var x={licenseKey:void 0,enableAzureWorkaround:!1,isAdminUser:!1,isReadOnly:!1};u.WebViewer.prototype={version:"8.7.5",create:function(){if(this.options.initialDoc){var T=this._correctRelativePath(this.options.initialDoc);T=encodeURIComponent(JSON.stringify(T)),this.options.initialDoc=T}this._create()},_create:function(){this.id=++d,this._trigger===void 0&&(this._trigger=function(P,k){var D=p(P,k);this.element.dispatchEvent(D)});var T=this.options.type.replace(" ","").split(",");T.length<1&&(T[0]="html5"),this._createViewer(T)},_validateOptions:function(T){for(var P=Object.keys(T),k=0;k<P.length;k++){var D=P[k];D in h({},x,u.WebViewer.Options)||console.warn("".concat(D," is not a valid option name. See http://r.pdftron.com/api/options_anchor for all available options."))}var U=T.webviewerServerURL||T.pdftronServer;!T.enableRedaction||T.fullAPI||U||console.warn("FullAPI or WebViewer Server is needed to apply redactions")},_notSupportedMobile:function(){var T=document.createElement("div");T.id="webviewer-browser-unsupported",T.textContent="PDF document viewing is not supported by this browser.",this.element.appendChild(T)},_createViewer:function(T){var P,k=this;if(k.selectedType=null,this.isMobileDevice()){if(this.options.documentType&&this.options.documentType!=="xod"&&!this._testWebAssembly())return void this._notSupportedMobile();if(T=Array("html5Mobile"),k.selectedType="html5Mobile",this.options.mobileRedirect)return P=this.options.uiPath+this._getHTML5OptionsURL(),void(window.location=P)}for(var D=!1,U=!1,Y=0;Y<T.length;Y++){if(T[Y].toLowerCase()==="html5mobile"){if(this.options.documentType&&this.options.documentType!=="xod"&&!this._testWebAssembly())continue;if(D=!0,k._testHTML5()){if(this.options.mobileRedirect)return k.selectedType="html5Mobile",P=this.options.uiPath+this._getHTML5OptionsURL(),void(window.location=P);if(this.options.xdomainProxyUrl||k.isSameOrigin(decodeURIComponent(k.options.initialDoc))||k._testCORS()){k.selectedType="html5Mobile";break}U=!0}}if(T[Y].toLowerCase()==="html5"&&(D=!0,k._testHTML5())){var K=k.isSameOrigin(decodeURIComponent(k.options.initialDoc));if(this.options.xdomainProxyUrl||K||k._testCORS()){k.selectedType="html5";break}U=!0}}if(k.selectedType==="html5")k._createHTML5();else if(k.selectedType==="html5Mobile")k._createHTML5Mobile();else{var j;if(U?j="This browser does not support cross origin requests. Please configure xdomain to support CORS.":D&&(j="Please use an HTML5 compatible browser."),j){var L=document.createElement("div");L.id="webviewer-browser-unsupported",L.textContent=j,k.element.appendChild(L)}}},_viewerLoaded:function(T){this._trigger("ready");try{var P=T.contentWindow;if(P.postMessage({type:"viewerLoaded"},"*"),this.options.encryption!==void 0){var k=decodeURIComponent(this.options.initialDoc);this.options.initialDoc&&(k=JSON.parse(k));var D={decrypt:P.Core.Encryption.decrypt,decryptOptions:this.options.encryption,documentId:this.options.documentId,extension:"xod"};this.getInstance().loadDocument(k,D)}}catch{console.warn("Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions. See http://r.pdftron.com/kb_cross_origin for more information.")}},_getHTML5OptionsURL:function(){var T,P,k,D=this.options,U=D.webviewerServerURL||D.pdftronServer,Y="";if(D.initialDoc&&(Y+="#d=".concat(D.initialDoc)),D.backendType===void 0&&(D.backendType=D.pdfBackend),D.documentType&&D.documentType==="xod"&&(T=D.documentType),D.preloadWorker&&D.preloadWorker==="xod"&&(T=D.preloadWorker),D.extension&&(T=D.extension),T&&(Y+="&extension=".concat(T)),D.documentType&&D.documentType!=="xod"&&(P=D.documentType),D.preloadWorker&&D.preloadWorker!=="xod"&&(P=D.preloadWorker),P&&(Y+="&preloadWorker=".concat(P)),D.backendType&&(Y+="&pdf=".concat(D.backendType,"&office
222=").concat(D.backendType,"&legacyOffice=").concat(D.backendType)),D.filename&&(Y+="&filename=".concat(D.filename)),D.streaming!==void 0&&(Y+="&streaming=".concat(D.streaming)),D.externalPath){var K=this._correctRelativePath(D.externalPath);K=encodeURIComponent(K),Y+="&p=".concat(K)}if(D.encryption&&(Y+="&auto_load=false"),D.enableAnnotations&&(Y+="&a=1"),D.disabledElements){var j=encodeURIComponent(D.disabledElements.join(","));Y+="&disabledElements=".concat(j)}if(D.serverUrl){var L=this._correctRelativePath(D.serverUrl);L=encodeURIComponent(L),Y+="&server_url=".concat(L)}if(D.serverUrlHeaders&&(Y+="&serverUrlHeaders=".concat(JSON.stringify(D.serverUrlHeaders))),D.documentId&&(Y+="&did=".concat(D.documentId)),D.css){var N=this._correctRelativePath(D.css);N=encodeURIComponent(N),Y+="&css=".concat(N)}if(D.disableI18n&&(Y+="&disableI18n=1"),D.enableOfflineMode&&(Y+="&offline=1"),D.startOffline&&(Y+="&startOffline=1"),(D.enableReadOnlyMode||D.isReadOnly)&&(Y+="&readonly=1"),D.hideAnnotationPanel&&(Y+="&hideAnnotationPanel=1"),D.disableToolGroupReordering&&(Y+="&disableToolGroupReordering=1"),D.annotationUser!==void 0&&(Y+="&user=".concat(D.annotationUser)),D.annotationAdmin===void 0&&D.isAdminUser===void 0||(Y+="&admin=".concat(D.annotationAdmin||D.isAdminUser?1:0)),D.custom!==void 0&&(Y+="&custom=".concat(encodeURIComponent(D.custom))),D.showLocalFilePicker===void 0&&D.enableFilePicker===void 0||(Y+="&filepicker=".concat(D.showLocalFilePicker||D.enableFilePicker?1:0)),D.fullAPI!==void 0){if(D.fullAPI)throw new Error('"fullAPI" is not a valid constuctor option for PDF.js Express. Please make sure you are referring to the proper documentation (https://pdfjs.express/documentation)');Y+="&pdfnet=".concat(D.fullAPI?1:0)}return D.enableRedaction!==void 0&&(Y+="&enableRedaction=".concat(D.enableRedaction?1:0)),D.disableVirtualDisplayMode!==void 0&&(Y+="&disableVirtualDisplayMode=".concat(D.disableVirtualDisplayMode?1:0)),D.enableMeasurement!==void 0&&(Y+="&enableMeasurement=".concat(D.enableMeasurement?1:0)),D.showToolbarControl!==void 0&&(Y+="&toolbar=".concat(D.showToolbarControl?"true":"false")),D.showPageHistoryButtons!==void 0&&(Y+="&pageHistory=".concat(D.showPageHistoryButtons?1:0)),D.notesInLeftPanel!==void 0&&(Y+="¬esInLeftPanel=".concat(D.notesInLeftPanel?1:0)),D.xdomainProxyUrl!==void 0&&(k=typeof D.xdomainProxyUrl=="string"?{url:D.xdomainProxyUrl}:D.xdomainProxyUrl,Y+="&xdomain_urls=".concat(encodeURIComponent(JSON.stringify(k)))),(D.azureWorkaround||D.enableAzureWorkaround)&&(Y+="&azureWorkaround=1"),D.enableOptimizedWorkers||(Y+="&enableOptimizedWorkers=0"),D.useDownloader||(Y+="&useDownloader=0"),D.disableWebsockets&&(Y+="&disableWebsockets=1"),D.disableStreaming&&(Y+="&disableStreaming=1"),D.forceClientSideInit&&(Y+="&forceClientSideInit=1"),D.loadAsPDF&&(Y+="&loadAsPDF=1"),D.workerTransportPromise!==void 0&&(Y+="&useSharedWorker=".concat(D.workerTransportPromise?"true":"false")),U!==void 0&&U&&(Y+="&webviewerServerURL=".concat(encodeURIComponent(U))),D.fallbackToClientSide&&(Y+="&fallbackToClientSide=1"),D.singleServerMode!==void 0&&(Y+="&singleServerMode=".concat(D.singleServerMode?"true":"false")),D.accessibleMode!==void 0&&(Y+="&accessibleMode=".concat(D.accessibleMode?1:0)),D.disableLogs&&(Y+="&disableLogs=1"),D.enableViewStateAnnotations&&(Y+="&enableViewStateAnnotations=1"),D.disableFlattenedAnnotations&&(Y+="&disableFlattenedAnnotations=1"),D.highContrastMode&&(Y+="&highContrastMode=1"),D.selectAnnotationOnCreation!==void 0&&(Y+="&selectAnnotationOnCreation=".concat(D.selectAnnotationOnCreation?1:0)),D.autoFocusNoteOnAnnotationSelection!==void 0&&(Y+="&autoFocusNoteOnAnnotationSelection=".concat(D.autoFocusNoteOnAnnotationSelection?1:0)),Y+="&id=".concat(this.id),(Y+="&basePath=".concat(encodeURIComponent(window.location.pathname))).length>0&&Y[0]==="&"&&(Y="#".concat(Y.slice(1))),Y+="&webViewerJSVersion=".concat(this.version)},setInstanceData:function(T){v.set(this.element,{iframe:T,l:this.options.l||this.options.licenseKey,workerTransportPromise:this.options.workerTransportPromise})},_createHTML5:function(){var T=this,P=this.options.uiPath+this._getHTML5OptionsURL(),k=document.createElement("iframe");
222this.setInstanceData(k),k.id="webviewer-".concat(this.id),k.src=P,k.title="webviewer",k.frameBorder=0,k.width="100%",k.height="100%",k.setAttribute("allowfullscreen",!0),k.setAttribute("webkitallowfullscreen",!0),k.setAttribute("mozallowfullscreen",!0),this.iframe=k,this.options.backgroundColor&&k.setAttribute("data-bgcolor",this.options.backgroundColor),this.options.assetPath&&k.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),this.element.appendChild(k),window.addEventListener("message",function D(U){if(U.data.type==="viewerLoaded"&&U.data.id===T.id)try{T.instance=T.iframe.contentWindow.instance}catch{}finally{window.removeEventListener("message",D),T._viewerLoaded(T.iframe)}})},_createHTML5Mobile:function(){var T=this,P=this.options.uiPath+this._getHTML5OptionsURL(),k=document.createElement("iframe");this.setInstanceData(k),k.id="webviewer-".concat(this.id),k.src=P,k.frameborder=0,this.options.assetPath&&k.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),k.style.width="100%",k.style.height="100%",this.iframe=k,this.element.appendChild(k),window.addEventListener("message",function D(U){if(U.data.type==="viewerLoaded"&&U.data.id===T.id)try{T.instance=T.iframe.contentWindow.instance}catch{}finally{window.removeEventListener("message",D),T._viewerLoaded(T.iframe)}})},dispose:function(){var T=this;return new Promise(function(P){v.delete(T.element),E.delete(T.element),window.removeEventListener("message",T.messageHandler),T.iframe.removeEventListener("load",T.loadListener),T.iframe=null,console.clear(),T.instance.Core.documentViewer.closeDocument().then(function(){P()})})},getInstance:function(){return this.instance},setCompleteInstance:function(T){this.completeInstance=T},getCompleteInstance:function(){return this.completeInstance},_correctRelativePath:function(T){var P=window.location.pathname;return Array.isArray(T)?T.map(function(k){return o(k,P)}):o(T,P)},_testHTML5:function(){try{var T=document.createElement("canvas");return T&&T.getContext("2d")}catch{return!1}},_testWebAssembly:function(){return!(!window.WebAssembly||!window.WebAssembly.validate)},_testCORS:function(){return"XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest},isIE:function(){var T=navigator.userAgent.toLowerCase(),P=/(msie) ([\w.]+)/.exec(T)||/(trident)(?:.*? rv:([\w.]+)|)/.exec(T);return P&&parseInt(P[2],10)},isMobileDevice:function(){return!this.isIE()&&(this.scrollbarWidth()===0&&navigator.userAgent.match(/Edge/i)||navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Touch/i)||navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/Silk/i))},scrollbarWidth:function(){var T=document.createElement("div");T.style.cssText="width:100px;height:100px;overflow:scroll !important;position:absolute;top:-9999px",document.body.appendChild(T);var P=T.offsetWidth-T.clientWidth;return document.body.removeChild(T),P},isSameOrigin:function(T){var P=window.location,k=document.createElement("a");k.href=T,k.host===""&&(k.href=k.href);var D=window.location.port,U=k.port;return k.protocol==="http:"?(U=U||"80",D=D||"80"):k.protocol==="https:"&&(U=U||"443",D=D||"443"),k.hostname===P.hostname&&k.protocol===P.protocol&&U===D}},u.WebViewer.Options={initialDoc:void 0,annotationAdmin:void 0,isAdminUser:void 0,annotationUser:void 0,assetPath:void 0,autoCreate:!0,autoFocusNoteOnAnnotationSelection:!0,azureWorkaround:!1,additionalTranslations:void 0,enableAzureWorkaround:!1,enableOptimizedWorkers:!0,backgroundColor:void 0,backendType:void 0,css:void 0,config:void 0,custom:void 0,documentId:void 0,documentType:void 0,preloadWorker:void 0,extension:void 0,enableAnnotations:!0,filename:void 0,disableI18n:!1,disabledElements:void 0,disableWebsockets:!1,enableOfflineMode:!1,enableReadOnlyMode:!1,isReadOnly:!1,enableRedaction:!1,disableVirtualDisplayMode:!1,enableMeasurement:!1,encryption:void 0,externalPath:void 0,hideAnnotationPanel:!1,disableToolGroupReordering:!1,uiPath:"./ui/index.html",l:void 0,licenseKey:void 0,mobileRedirect:!1,path:"",pdfBackend:void 0,webviewerServerURL:void 0,fallbackToClientSide:!1,singleServerMode:!1,fullAPI:!1,preloadPDFWorker:!0,serverUrl:void 0,serverUrlHeaders:void 0,showLocalFilePicker:!1,enableFilePicker:!1,showPageHistoryButtons:!0,showToolbarControl:void 0,startOffline:!1,streaming:void 0,type:"html5",useDownloader:!0,workerTransportPromise:void 0,xdomainProxyUrl:void 0,ui:void 0,forceClientSideInit:!1,loadAsPDF:!1,accessibleMode:void 0,disableLogs:!1,enableViewStateAnnotations:!1,highContrastMode:!1,selectAnnotationOnCreation:!1,notesInLeftPanel:!1,documentXFDFRetriever:void 0,disableFlattenedAnnotations:!1,disableStreaming:!1};var A=function(T,P){return new Promise(function(k,D){T.l=T.l||T.licenseKey,T.azureWorkaround=T.azureWorkaround||T.enableAzureWork
222around,T.annotationAdmin=T.annotationAdmin||T.isAdminUser,T.enableReadOnlyMode=T.enableReadOnlyMode||T.isReadOnly,T.showLocalFilePicker=T.showLocalFilePicker||T.enableFilePicker,P.addEventListener("ready",function Y(){P.removeEventListener("ready",Y);try{var K=P.querySelector("iframe").contentWindow;if(K.Tools===void 0)throw new Error("Viewer isn't instantiated correctly. It could be caused by the 'path' option in the WebViewer constructor not being defined correctly. The 'path' option should be relative to the HTML file you're loading the script on and the lib folder needs to be publicly accessible.");var j=U.getInstance(),L={iframeWindow:K,dispose:U.dispose.bind(U)},N=h({},j,l(c({},j.UI_NAMESPACE_KEY,l(l({},j[j.UI_NAMESPACE_KEY]),L)),L));U.setCompleteInstance(N);var m=Promise.resolve();if(T.documentXFDFRetriever&&(m=N[j.CORE_NAMESPACE_KEY].documentViewer.setDocumentXFDFRetriever(T.documentXFDFRetriever)),T.additionalTranslations){var _=T.additionalTranslations;N[j.UI_NAMESPACE_KEY].setTranslations(_.language,_.translations)}m.then(function(){k(N)})}catch{if("config"in T&&T.config!=="")return k();D("Viewer is on a different domain, the promise from WebViewer function is rejected and API functions will not work because of cross domain permissions. See https://www.pdftron.com/kb_cross_origin for more information.")}});var U=new u.WebViewer(T,P)})},O=function(T){for(var P=f(v),k=0;k<P.length;k++){var D=P[k];if(D.iframe===T)return D}return null};A.l=function(T){var P=O(T);return P&&P.l},A.workerTransportPromise=function(T){var P=O(T);return P&&P.workerTransportPromise},A.WorkerTypes={ALL:"all",OFFICE:"office",LEGACY_OFFICE:"legacyOffice",PDF:"pdf",CONTENT_EDIT:"contentEdit"},A.BackendTypes=r;var I=function(T){var P=f(v);if(!P.length||!P.filter(function(k){return k.instance}).length)return console.warn("WebViewer.getInstance() was called before any instances were available"),null;if(P.length>1&&!T)throw new Error("More than one instance of WebViewer was found, and no element was passed into getInstance(). Please specify which instance you want to get.");return T?(v.get(T)||{}).instance:(P[0]||{}).instance};A.getInstance=I,window.WebViewer=A,i.default=A}])})})(x$);var Gle=x$.exports;const Yle=zI(Gle);/*! name: vanilla-calendar-pro v3.1.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */var qle=Object.defineProperty,Kle=Object.defineProperties,Xle=Object.getOwnPropertyDescriptors,fL=Object.getOwnPropertySymbols,Jle=Object.prototype.hasOwnProperty,Zle=Object.prototype.propertyIsEnumerable,Yk=(n,t,e)=>t in n?qle(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,gm=(n,t)=>{for(var e in t||(t={}))Jle.call(t,e)&&Yk(n,e,t[e]);if(fL)for(var e of fL(t))Zle.call(t,e)&&Yk(n,e,t[e]);return n},Qle=(n,t)=>Kle(n,Xle(t)),Pe=(n,t,e)=>(Yk(n,typeof t!="symbol"?t+"":t,e),e);const zc={notFoundSelector:n=>`${n} is not found, check the first argument passed to new Calendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:"You specified an incorrect language label or did not specify the required number of values ââfor «locale.weekdays» or «locale.months».",incorrectTime:"The value of the time property can be: false, 12 or 24.",incorrectMonthsCount:"For the «multiple» calendar type, the «displayMonthsCount» parameter can have a value from 2 to 12, and for all others it cannot be greater than 1."},Be=(n,t,e)=>{n.context[t]=e},ece=n=>{var t,e,i,s,r;if(!n.context.isInit)throw new Error(zc.notInit);n.inputMode?((t=n.context.mainElement.parentElement)==null||t.removeChild(n.context.mainElement),(i=(e=n.context.inputElement)==null?void 0:e.replaceWith)==null||i.call(e,n.context.originalElement),Be(n,"inputElement",void 0)):(r=(s=n.context.mainElement).replaceWith)==null||r.call(s,n.context.originalElement),Be(n,"mainElement",n.context.originalElement),n.onDestroy&&n.onDestroy(n)},bM=new WeakSet,tce=n=>bM.has(n),nce=n=>{bM.add(n)},ice=n=>{bM.delete(n)},Cf="data-vc-prev-tabindex",gL=n=>n.tabIndex>=0&&!n.hasAttribute("disabled")&&n.getAttribute("aria-disabled")!=="true",mL=n=>{if(n.hasAttribute(Cf))return;const t=n.getAttribute("tabindex");n.setAttribute(Cf,t??"")},pL=n=>{if(!n.hasAttribute(Cf))return;const t=n.getAttribute(Cf);t===""||t===null?n.removeAttribute("tabindex"):n.setAttribute("tabindex",t),n.removeAttribute(Cf)},sce=n=>{gL(n)&&(mL(n),n.tabIndex=-1);const t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>gL(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();){const e=t.currentNode;mL(e),e.tabIndex=-1}},rce=n=>{pL(n),n.querySelectorAll(`[${Cf}]`).forEach(pL)},qk=n=>
222{n.context.isShowInInputMode&&n.context.currentType&&(n.context.mainElement.dataset.vcCalendarHidden="",Be(n,"isShowInInputMode",!1),n.inputMode&&sce(n.context.mainElement),n.context.cleanupHandlers[0]&&(n.context.cleanupHandlers.forEach(t=>t()),Be(n,"cleanupHandlers",[])),n.inputMode&&n.context.inputElement&&n.context.mainElement.contains(document.activeElement)&&((typeof n.openOnFocus=="function"||n.openOnFocus===!0)&&nce(n),n.context.inputElement.focus()),n.onHide&&n.onHide(n))};function wM(n){if(!n||!n.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};const t=n.getBoundingClientRect(),e=document.documentElement;return{bottom:t.bottom,right:t.right,top:t.top+window.scrollY-e.clientTop,left:t.left+window.scrollX-e.clientLeft}}function vM(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function oce(){return{left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0}}function ace(n){const{top:t,left:e}=oce(),{top:i,left:s}=wM(n),{vh:r,vw:o}=vM(),a=i-t,l=s-e;return{top:a,bottom:r-(a+n.clientHeight),left:l,right:o-(l+n.clientWidth)}}function A$(n,t,e=5){const i={top:!0,bottom:!0,left:!0,right:!0},s=[];if(!t||!n)return{canShow:i,parentPositions:s};const{bottom:r,top:o}=ace(n),{top:a,left:l}=wM(n),{height:c,width:u}=t.getBoundingClientRect(),{vh:d,vw:h}=vM(),f=h/2,p=d/2;return[{condition:a<p,position:"top"},{condition:a>p,position:"bottom"},{condition:l<f,position:"left"},{condition:l>f,position:"right"}].forEach(({condition:v,position:E})=>{v&&s.push(E)}),Object.assign(i,{top:c<=o-e,bottom:c<=r-e,left:u<=l,right:u<=h-l}),{canShow:i,parentPositions:s}}const lce=(n,t,e,i)=>{var s;const r=i.querySelector(`[data-vc-date="${t}"]`),o=r==null?void 0:r.querySelector("[data-vc-date-btn]");if(!r||!o||(e!=null&&e.modifier&&o.classList.add(...e.modifier.trim().split(" ")),!(e!=null&&e.html)))return;const a=document.createElement("div");a.className=n.styles.datePopup,a.dataset.vcDatePopup="",a.innerHTML=n.sanitizerHTML(e.html),o.ariaExpanded="true",o.ariaLabel=`${o.ariaLabel}, ${(s=a==null?void 0:a.textContent)==null?void 0:s.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/ /g," ")}`,r.appendChild(a),requestAnimationFrame(()=>{if(!a)return;const{canShow:l}=A$(r,a),c=l.bottom?r.offsetHeight:-a.offsetHeight,u=l.left&&!l.right?r.offsetWidth-a.offsetWidth/2:!l.left&&l.right?a.offsetWidth/2:0;Object.assign(a.style,{left:`${u}px`,top:`${c}px`})})},cce=(n,t)=>{var e;n.popups&&((e=Object.entries(n.popups))==null||e.forEach(([i,s])=>lce(n,i,s,t)))},rt=n=>new Date(`${n}T00:00:00`),mh=n=>`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`,pl=n=>n.reduce((t,e)=>{if(e instanceof Date||typeof e=="number"){const i=e instanceof Date?e:new Date(e);t.push(i.toISOString().substring(0,10))}else e.match(/^(\d{4}-\d{2}-\d{2})$/g)?t.push(e):e.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(i,s,r)=>{const o=rt(s),a=rt(r),l=new Date(o.getTime());for(;l<=a;l.setDate(l.getDate()+1))t.push(mh(l));return i});return t},[]),Ol=(n,t,e,i="")=>{t?n.setAttribute(e,i):n.getAttribute(e)===i&&n.removeAttribute(e)},C$=(n,t,e,i,s,r,o)=>{var a,l,c,u;const d=rt(n.context.displayDateMin)>rt(r)||rt(n.context.displayDateMax)<rt(r)||((a=n.context.disableDates)==null?void 0:a.includes(r))||!n.selectionMonthsMode&&o!=="current"||!n.selectionYearsMode&&rt(r).getFullYear()!==t;Ol(e,d,"data-vc-date-disabled"),i&&Ol(i,d,"aria-disabled","true"),i&&Ol(i,d,"tabindex","-1"),Ol(e,!n.disableToday&&n.context.dateToday===r,"data-vc-date-today"),Ol(e,!n.disableToday&&n.context.dateToday===r,"aria-current","date"),Ol(e,(l=n.selectedWeekends)==null?void 0:l.includes(s),"data-vc-date-weekend");const h=(c=n.selectedHolidays)!=null&&c[0]?pl(n.selectedHolidays):[];if(Ol(e,h.includes(r),"data-vc-date-holiday"),(u=n.context.selectedDates)!=null&&u.includes(r)?(e.setAttribute("data-vc-date-selected",""),i&&i.setAttribute("aria-selected","true"),n.context.selectedDates.length>1&&n.selectionDatesMode==="multiple-ranged"&&(n.context.selectedDates[0]===r&&n.context.selectedDates[n.context.selectedDates.length-1]===r?e.setAttribute("data-vc-date-selected","first-and-last"):n.context.selectedDates[0]===r?e.setAttribute("data-vc-date-selected","first"):n.context.selectedDates[n.context.selectedDates.length-1]===r&&e.setAttribute("data-vc-date-selected","last"),n.context.selectedDates[0]!==r&&n.context.selectedDates[n.context.selectedDates.length-1]!==r&&e.setAttribute("data-vc-date-selected","middle"))):e.hasAttribute("data-vc-date-selected")&&(e.removeAttribute("data-vc-date-selected"),i&&i.removeAttribute("aria-selected")),!n.context.disableDates.includes(r)&&n.enableEdgeDatesOnly&&n.context.selectedDates.length>1&&n.selectionDatesMode==="multiple-ranged"){const f=rt(n.context.selectedDates[0]),p=rt(n.context.selectedDates[n.context.selectedDates.length-1]),v=rt(r);Ol(e,v>f&&v<p,"data-vc-date-selected","middle")}},uce=(n,t,e)=>new Date(`${n}
222T00:00:00.000Z`).toLocaleString(t,e),k$=(n,t)=>{const e=rt(n),i=(e.getDay()-t+7)%7;e.setDate(e.getDate()+4-i);const s=new Date(e.getFullYear(),0,1),r=Math.ceil(((+e-+s)/864e5+1)/7);return{year:e.getFullYear(),week:r}},dce=(n,t,e)=>{const i=k$(e,n.firstWeekday);i&&(t.dataset.vcDateWeekNumber=String(i.week))},hce=(n,t,e)=>{var i,s,r,o,a;const l=(i=n.disableWeekdays)==null?void 0:i.includes(e),c=n.disableAllDates&&!!((s=n.context.enableDates)!=null&&s[0]);!l&&!c||(r=n.context.enableDates)!=null&&r.includes(t)||(o=n.context.disableDates)!=null&&o.includes(t)||(n.context.disableDates.push(t),(a=n.context.disableDates)==null||a.sort((u,d)=>+new Date(u)-+new Date(d)))},yM=(n,t,e,i,s,r)=>{const o=rt(s).getDay(),a=typeof n.locale=="string"&&n.locale.length?n.locale:"en",l=document.createElement("div");let c;l.className=n.styles.date,l.dataset.vcDate=s,l.dataset.vcDateMonth=r,l.dataset.vcDateWeekDay=String(o),l.role="gridcell",(r==="current"||n.displayDatesOutside)&&(c=document.createElement("button"),c.className=n.styles.dateBtn,c.type="button",c.ariaLabel=uce(s,a,{dateStyle:"long",timeZone:"UTC"}),c.dataset.vcDateBtn="",c.innerText=String(i),l.appendChild(c)),n.enableWeekNumbers&&dce(n,l,s),hce(n,s,o),C$(n,t,l,c,o,s,r),e.addDate(l),n.onCreateDateEls&&n.onCreateDateEls(n,l)},fce=(n,t,e,i,s)=>{for(let r=1;r<=e;r++){const o=new Date(i,s,r);yM(n,i,t,r,mh(o),"current")}},gce=(n,t,e,i,s)=>{const r=s+1===12?i+1:i,o=s+1===12?"01":s+2<10?`0${s+2}`:s+2;for(let a=1;a<=e;a++){const l=a<10?`0${a}`:String(a);yM(n,i,t,a,`${r}-${o}-${l}`,"next")}},mce=(n,t,e,i,s)=>{let r=new Date(e,i,0).getDate()-(s-1);const o=i===0?e-1:e,a=i===0?12:i<10?`0${i}`:i;for(let l=s;l>0;l--,r++)yM(n,e,t,r,`${o}-${a}-${r}`,"prev")},pce=(n,t,e,i,s)=>{if(!n.enableWeekNumbers)return;i.textContent="";const r=document.createElement("b");r.className=n.styles.weekNumbersTitle,r.innerText="#",r.dataset.vcWeekNumbers="title",i.appendChild(r);const o=document.createElement("div");o.className=n.styles.weekNumbersContent,o.dataset.vcWeekNumbers="content",i.appendChild(o);const a=document.createElement("button");a.type="button",a.className=n.styles.weekNumber;const l=s.querySelectorAll("[data-vc-date]"),c=Math.ceil((t+e)/7);for(let u=0;u<c;u++){const d=l[u===0?6:7*u].dataset.vcDate,h=k$(d,n.firstWeekday);if(!h)return;const f=a.cloneNode(!0);f.innerText=String(h.week),f.dataset.vcWeekNumber=String(h.week),f.dataset.vcWeekYear=String(h.year),f.role="rowheader",f.ariaLabel=`${h.week}`,o.appendChild(f)}},Kk=n=>{const t=new Date(n.context.selectedYear,n.context.selectedMonth,1),e=n.context.mainElement.querySelectorAll('[data-vc="dates"]'),i=n.context.mainElement.querySelectorAll('[data-vc-week="numbers"]');e.forEach((s,r)=>{n.selectionDatesMode||(s.dataset.vcDatesDisabled=""),s.textContent="";const o=new Date(t);o.setMonth(o.getMonth()+r);const a=o.getMonth(),l=o.getFullYear(),c=(new Date(l,a,1).getDay()-n.firstWeekday+7)%7,u=new Date(l,a+1,0).getDate(),d=c+u,h=Math.ceil(d/7),f=7*h-d,p=[];for(let A=0;A<h;A++){const O=document.createElement("div");O.className=n.styles.datesRow,O.setAttribute("data-vc-dates","row"),O.setAttribute("role","row"),p.push(O)}let v=0,E=0;const x={addDate:A=>{p[v].appendChild(A),E++,E>=7&&(v++,E=0)}};mce(n,x,l,a,c),fce(n,x,u,l,a),gce(n,x,f,l,a);for(const A of p)s.appendChild(A);cce(n,s),pce(n,c,u,i[r],s)})},bce=n=>` 223 <div class="${n.styles.header}" data-vc="header" role="toolbar" aria-label="${n.labels.navigation}"> 224 <#ArrowPrev [month] /> 225 <div class="${n.styles.headerContent}" data-vc-header="content"> 226 <#Month /> 227 <#Year /> 228 </div> 229 <#ArrowNext [month] /> 230 </div> 231 <div class="${n.styles.wrapper}" data-vc="wrapper"> 232 <#WeekNumbers /> 233 <div class="${n.styles.content}" data-vc="content" role="grid"> 234 <#Week /> 235 <#Dates /> 236 <#DateRangeTooltip /> 237 </div> 238 </div> 239 <#ControlTime /> 240`,wce=n=>` 241 <div class="${n.styles.header}" data-vc="header" role="toolbar" aria-label="${n.labels.navigation}"> 242 <div class="${n.styles.headerContent}" data-vc-header="content"> 243 <#Month /> 244 <#Year /> 245 </div> 246 </div> 247 <div class="${n.styles.wrapper}" data-vc="wrapper"> 248 <div class="${n.styles.content}" data-vc="content"> 249 <#Months /> 250 </div> 251 </div> 252`,vce=n=>` 253 <div class="${n.styles.controls}" data-vc="controls" role="toolbar" aria-label="${n.labels.navigation}"> 254 <#ArrowPrev [month] /> 255 <#ArrowNext [month] /> 256 </div> 257 <div class="${n.styles.grid}" data-vc="grid"> 258 <#Multiple> 259 <div class="${n.styles.column}" data-vc="column" role="region"> 260 <div class="${n.styles.header}" data-vc="header"> 261 <div class="${n.styles.headerContent}" data-vc-header="content"> 262 <#Month /> 263 <#Year /> 264 </div> 265 </div> 266 <div class="${n.styles.wrapper}" data-vc="wrapper"> 267 <#WeekNumbers /> 268 <div class="${n.styles.content}" data-vc="content" role="grid"> 269 <#Week /> 270 <#Dates /> 271 </div> 272 </div> 273 </div> 274 <#/Multiple> 275 <#DateRangeTooltip /> 276 </div> 277 <#ControlTime /> 278`,yce=n=>` 279 <div class="${n.styles.header}" data-vc="header" role="toolbar" aria-label="${n.labels.navigation}"> 280 <#ArrowPrev [year] />
280 281 <div class="${n.styles.headerContent}" data-vc-header="content"> 282 <#Month /> 283 <#Year /> 284 </div> 285 <#ArrowNext [year] /> 286 </div> 287 <div class="${n.styles.wrapper}" data-vc="wrapper"> 288 <div class="${n.styles.content}" data-vc="content"> 289 <#Years /> 290 </div> 291 </div> 292`,_ce=(n,t)=>`<button type="button" class="${n.styles.arrowNext}" data-vc-arrow="next" aria-label="${n.labels.arrowNext[t]}"></button>`,Ece=(n,t)=>`<button type="button" class="${n.styles.arrowPrev}" data-vc-arrow="prev" aria-label="${n.labels.arrowPrev[t]}"></button>`,Sce=n=>n.selectionTimeMode?`<div class="${n.styles.time}" data-vc="time" role="group" aria-label="${n.labels.selectingTime}"></div>`:"",Tce=n=>n.onCreateDateRangeTooltip?`<div class="${n.styles.dateRangeTooltip}" data-vc-date-range-tooltip="hidden"></div>`:"",xce=n=>`<div class="${n.styles.dates}" data-vc="dates" aria-live="assertive" aria-label="${n.labels.dates}" ${n.type==="multiple"?"aria-multiselectable":""}></div>`,Ace=n=>`<button type="button" class="${n.styles.month}" data-vc="month"></button>`,Cce=n=>`<div class="${n.styles.months}" data-vc="months" role="grid" aria-live="assertive" aria-label="${n.labels.months}"></div>`,kce=n=>`<div class="${n.styles.week}" data-vc="week" role="row" aria-label="${n.labels.week}"></div>`,Ice=n=>n.enableWeekNumbers?`<div class="${n.styles.weekNumbers}" data-vc-week="numbers" role="row" aria-label="${n.labels.weekNumber}"></div>`:"",Pce=n=>`<button type="button" class="${n.styles.year}" data-vc="year"></button>`,Mce=n=>`<div class="${n.styles.years}" data-vc="years" role="grid" aria-live="assertive" aria-label="${n.labels.years}"></div>`,Oce={ArrowNext:_ce,ArrowPrev:Ece,ControlTime:Sce,Dates:xce,DateRangeTooltip:Tce,Month:Ace,Months:Cce,Week:kce,WeekNumbers:Ice,Year:Pce,Years:Mce},Dce=n=>Oce[n],oA=(n,t)=>t.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(e,i)=>{const s=(i.match(/\[(.*?)\]/)||[])[1],r=i.replace(/[/\s\n\t]|\[(.*?)\]/g,""),o=Dce(r),a=o?o(n,s??null):"";return n.sanitizerHTML(a)}).replace(/[\n\t]/g,""),Rce=(n,t)=>t.replace(new RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(e,i)=>{const s=Array(n.context.displayMonthsCount).fill(i).join("");return n.sanitizerHTML(s)}).replace(/[\n\t]/g,""),_M=(n,t)=>{const e={default:bce,month:wce,year:yce,multiple:vce};if(Object.keys(e).forEach(i=>{const s=i;n.layouts[s].length||(n.layouts[s]=e[s](n))}),n.context.mainElement.className=n.styles.calendar,n.context.mainElement.dataset.vc="calendar",n.context.mainElement.dataset.vcType=n.context.currentType,n.context.mainElement.role="application",n.context.mainElement.tabIndex=0,n.context.mainElement.ariaLabel=n.labels.application,n.context.currentType!=="multiple"){if(n.type==="multiple"&&t){const i=n.context.mainElement.querySelector('[data-vc="controls"]'),s=n.context.mainElement.querySelector('[data-vc="grid"]'),r=t.closest('[data-vc="column"]');return i&&i.remove(),s&&(s.dataset.vcGrid="hidden"),r&&(r.dataset.vcColumn=n.context.currentType),void(r&&(r.innerHTML=n.sanitizerHTML(oA(n,n.layouts[n.context.currentType]))))}n.context.mainElement.innerHTML=n.sanitizerHTML(oA(n,n.layouts[n.context.currentType]))}else n.context.mainElement.innerHTML=n.sanitizerHTML(Rce(n,oA(n,n.layouts[n.context.currentType])))},I$=(n,t,e,i)=>{n.style.visibility=e?"hidden":"",t.style.visibility=i?"hidden":""},Lce=(n,t,e)=>{const i=rt(mh(new Date(n.context.selectedYear,n.context.selectedMonth,1))),s=new Date(i.getTime()),r=new Date(i.getTime());s.setMonth(s.getMonth()-n.monthsToSwitch),r.setMonth(r.getMonth()+n.monthsToSwitch);const o=rt(n.context.dateMin),a=rt(n.context.dateMax);n.selectionYearsMode||(o.setFullYear(i.getFullYear()),a.setFullYear(i.getFullYear()));const l=!n.selectionMonthsMode||s.getFullYear()<o.getFullYear()||s.getFullYear()===o.getFullYear()&&s.getMonth()<o.getMonth(),c=!n.selectionMonthsMode||r.getFullYear()>a.getFullYear()||r.getFullYear()===a.getFullYear()&&r.getMonth()>a.getMonth()-(n.context.displayMonthsCount-1);I$(t,e,l,c)},Fce=(n,t,e)=>{const i=rt(n.context.dateMin),s=rt(n.context.dateMax),r=!!(i.getFullYear()&&n.context.displayYear-7<=i.getFullYear()),o=!!(s.getFullYear()&&n.context.displayYear+7>=s.getFullYear());I$(t,e,r,o)},NT=n=>{if(n.context.currentType==="month")return;const t=n.context.mainElement.querySelector('[data-vc-arrow="prev"]'),e=n.context.mainElement.querySelector('[data-vc-arrow="next"]');!t||!e||{default:()=>Lce(n,t,e),year:()=>Fce(n,t,e)}[n.context.currentType==="multiple"?"default":n.context.currentType]()},Nce=(n,t,e,i,s)=>{const r=new Date(i.setFullYear(n.context.selectedYear,n.context.selectedMonth+e)).getFullYear(),o=new Date(i.setMonth(n.context.selectedMonth+e)).getMonth(),a=n.context.locale.months.long[o
292],l=t.closest('[data-vc="column"]');l&&(l.ariaLabel=`${a} ${r}`);const c={month:{id:o,label:a},year:{id:r,label:r}};t.innerText=String(c[s].label),t.dataset[`vc${s.charAt(0).toUpperCase()+s.slice(1)}`]=String(c[s].id),t.ariaLabel=`${n.labels[s]} ${c[s].label}`;const u={month:n.selectionMonthsMode,year:n.selectionYearsMode},d=u[s]===!1||u[s]==="only-arrows";d&&(t.tabIndex=-1),t.disabled=d},Py=n=>{const t=n.context.mainElement.querySelectorAll('[data-vc="month"]'),e=n.context.mainElement.querySelectorAll('[data-vc="year"]'),i=new Date(n.context.selectedYear,n.context.selectedMonth,1);[t,e].forEach(s=>s==null?void 0:s.forEach((r,o)=>Nce(n,r,o,i,r.dataset.vc)))},EM=(n,t,e,i,s)=>{var r;const o={month:"[data-vc-months-month]",year:"[data-vc-years-year]"},a={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};s&&((r=n.context.mainElement.querySelectorAll(o[e]))==null||r.forEach(l=>{l.removeAttribute(a[e].selected),l.removeAttribute(a[e].aria)}),Be(n,a[e].selectedProperty,Number(t.dataset[a[e].value])),Py(n),e==="year"&&NT(n)),i&&(t.setAttribute(a[e].selected,""),t.setAttribute(a[e].aria,"true"))},SM=(n,t)=>{var e;if(n.type!=="multiple")return{currentValue:null,columnID:0};const i=n.context.mainElement.querySelectorAll('[data-vc="column"]'),s=Array.from(i).findIndex(r=>r.closest(`[data-vc-column="${t}"]`));return{currentValue:s>=0?Number((e=i[s].querySelector(`[data-vc="${t}"]`))==null?void 0:e.getAttribute(`data-vc-${t}`)):null,columnID:Math.max(s,0)}},Bce=(n,t,e,i,s,r,o)=>{const a=t.cloneNode(!1);return a.className=n.styles.monthsMonth,a.innerText=i,a.ariaLabel=s,a.role="gridcell",a.dataset.vcMonthsMonth=`${o}`,r&&(a.ariaDisabled="true"),r&&(a.tabIndex=-1),a.disabled=r,EM(n,a,"month",e===o,!1),a},P$=(n,t)=>{var e,i;const s=(e=t==null?void 0:t.closest('[data-vc="header"]'))==null?void 0:e.querySelector('[data-vc="year"]'),r=s?Number(s.dataset.vcYear):n.context.selectedYear,o=t!=null&&t.dataset.vcMonth?Number(t.dataset.vcMonth):n.context.selectedMonth;Be(n,"currentType","month"),_M(n,t),Py(n);const a=n.context.mainElement.querySelector('[data-vc="months"]');if(!n.selectionMonthsMode||!a)return;const l=n.monthsToSwitch>1?n.context.locale.months.long.map((u,d)=>o-n.monthsToSwitch*d).concat(n.context.locale.months.long.map((u,d)=>o+n.monthsToSwitch*d)).filter(u=>u>=0&&u<=12):Array.from(Array(12).keys()),c=document.createElement("button");c.type="button";for(let u=0;u<12;u++){const d=rt(n.context.dateMin),h=rt(n.context.dateMax),f=n.context.displayMonthsCount-1,{columnID:p}=SM(n,"month"),v=r<=d.getFullYear()&&u<d.getMonth()+p||r>=h.getFullYear()&&u>h.getMonth()-f+p||r>h.getFullYear()||u!==o&&!l.includes(u),E=Bce(n,c,o,n.context.locale.months.short[u],n.context.locale.months.long[u],v,u);a.appendChild(E),n.onCreateMonthEls&&n.onCreateMonthEls(n,E)}(i=n.context.mainElement.querySelector("[data-vc-months-month]:not([disabled])"))==null||i.focus()},bL=(n,t,e,i,s)=>` 293 <label class="${t}" data-vc-time-input="${n}"> 294 <input type="text" name="${n}" maxlength="2" aria-label="${e[`input${n.charAt(0).toUpperCase()+n.slice(1)}`]}" value="${i}" ${s?"disabled":""}> 295 </label> 296`,wL=(n,t,e,i,s,r,o)=>` 297 <label class="${t}" data-vc-time-range="${n}"> 298 <input type="range" name="${n}" min="${i}" max="${s}" step="${r}" aria-label="${e[`range${n.charAt(0).toUpperCase()+n.slice(1)}`]}" value="${o}"> 299 </label> 300`,rb=(n,t,e,i)=>{({hour:()=>Be(n,"selectedHours",e),minute:()=>Be(n,"selectedMinutes",e)})[i](),Be(n,"selectedTime",`${n.context.selectedHours}:${n.context.selectedMinutes}${n.context.selectedKeeping?` ${n.context.selectedKeeping}`:""}`),n.onChangeTime&&n.onChangeTime(n,t,!1),n.inputMode&&n.context.inputElement&&n.context.mainElement&&n.onChangeToInput&&n.onChangeToInput(n,t)},RE=(n,t)=>{var e;return((e={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(n)])==null?void 0:e[t])||String(n)},Vce=(n,t,e,i,s)=>{const r=o=>{const a=n.context.selectedKeeping==="AM"?"PM":"AM",l=RE(n.context.selectedHours,a);Number(l)<=i&&Number(l)>=s?(Be(n,"selectedKeeping",a),e.value=l,rb(n,o,n.context.selectedHours,"hour"),t.ariaLabel=`${n.labels.btnKeeping} ${n.context.selectedKeeping}`,t.innerText=n.context.selectedKeeping):n.onChangeTime&&n.onChangeTime(n,o,!0)};return t.addEventListener("click",r),()=>{t.removeEventListener("click",r)}},Lb=n=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"})[Number(n)]||String(n),C_=(n,t,e,i)=>{n.value=e,t.value=i},Hce=(n,t,e)=>{t&&e&&(Be(n,"selectedKeeping",e),t.innerText=e)},vL=(n,t,e,i,s,r,o)=>{const a={hour:(c,u,d)=>{n.selectionTimeMode&&{12:()=>{if(!n.context.selectedKeeping)return;const h=Number(RE(u,n.context.selectedKeeping));if(!(h<=r&&h>=o))return C_(e,t,n.context.selectedHours,n.context.selectedHours),void(n.onChangeTime&&n.onChangeTime(n,d,!0));C_(e,t,Lb(u),RE(u,n.context.selectedKeeping)),c>12&&Hce(n,i,"PM"),rb(n,d,Lb(u),s)},24:()=>{if(!(c<=r&&c>=o))return C_(e,t,n.context.selectedHours,n.context.selectedHours),void(n.onChangeTime&&n.onChangeTime(n,d,!0));C_(e,t,u,u),rb(n,d,u,s)}}[n.selectionTimeMode]()},minute:(c,u,d)=>{if(!(c<=r&&c>=o))return e.value=n.context.selectedMinutes,void(n.onChangeTime&&n.onChangeTime(n,d,!0));e.value=u,t.value=u,rb(n,d,u,s)}},l=c=>{const u=Number(e.value),d=e.value.padStart(2,"0");a[s]&&a[s](u,d,c)};return e.addEventListener("change",l),()=>{e.removeEventListener("change",l)}},zce=(n,t,e,i,s)=>{t.value=s,rb(n,e,s,i)},$ce=(n,t,e)=>{t&&(Be(n,"selectedKeeping",e),t.innerText=e)},yL=(n,t,e,i,s)=>{const r=o=>{const a=Number(t.value),l=t.value.padStart(2,"0"),c=s==="hour",u=n.selectionTimeMode===24,d=a>0&&a<12;c&&!u&&$ce(n,i,a===0||d?"AM":"PM"),zce(n,e,o,s,!c||u||d?l:Lb(t.value))};return t.addEventListener("input",r),()=>{t.removeEventListener("input",r)}},_L=n=>n.setAttribute("data-vc-input-focus",""),EL=n=>n.removeAttribute("data-vc-input-focus"),Wce=(n,t)=>{const e=t.querySelector('[data-vc-time-range="hour"] input[name="hour"]'),i=t.querySelector('[data-vc-time-range="minute"] input[name="minute"]'),s=t.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),r=t.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),o=t.querySelector('[data-vc-time="keeping"]');if(!(e&&i&&s&&r))return;const a=c=>{c.target===e&&_L(s),c.target===i&&_L(r)},l=c=>{c.target===e&&EL(s),c.target===i&&EL(r)};return t.addEventListener("mouseover",a),t.addEventListener("mouseout",l),vL(n,e,s,o,"hour",n.timeMaxHour,n.timeMinHour),vL(n,i,r,o,"minute",n.timeMaxMinute,n.timeMinMinute),yL(n,e,s,o,"hour"),yL(n,i,r,o,"minute"),o&&Vce(n,o,e,n.timeMaxHour,n.timeMinHour),()=>{t.removeEventListener("mouseover",a),t.removeEventListener("mouseout",l)}},Uce=n=>{const t=n.context.mainElement.querySelector('[data-vc="time"]');
300if(!n.selectionTimeMode||!t)return;const[e,i]=[n.timeMinHour,n.timeMaxHour],[s,r]=[n.timeMinMinute,n.timeMaxMinute],o=n.context.selectedKeeping?RE(n.context.selectedHours,n.context.selectedKeeping):n.context.selectedHours,a=n.timeControls==="range";var l;t.innerHTML=n.sanitizerHTML(` 301 <div class="${n.styles.timeContent}" data-vc-time="content"> 302 ${bL("hour",n.styles.timeHour,n.labels,n.context.selectedHours,a)} 303 ${bL("minute",n.styles.timeMinute,n.labels,n.context.selectedMinutes,a)} 304 ${n.selectionTimeMode===12?(l=n.context.selectedKeeping,`<button type="button" class="${n.styles.timeKeeping}" aria-label="${n.labels.btnKeeping} ${l}" data-vc-time="keeping" ${a?"disabled":""}>${l}</button>`):""} 305 </div> 306 <div class="${n.styles.timeRanges}" data-vc-time="ranges"> 307 ${wL("hour",n.styles.timeRange,n.labels,e,i,n.timeStepHour,o)} 308 ${wL("minute",n.styles.timeRange,n.labels,s,r,n.timeStepMinute,n.context.selectedMinutes)} 309 </div> 310 `),Wce(n,t)},SL=n=>{const t=n.selectedWeekends?[...n.selectedWeekends]:[],e=[...n.context.locale.weekdays.long].reduce((s,r,o)=>[...s,{id:o,titleShort:n.context.locale.weekdays.short[o],titleLong:r,isWeekend:t.includes(o)}],[]),i=[...e.slice(n.firstWeekday),...e.slice(0,n.firstWeekday)];n.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(s=>{const r=n.onClickWeekDay?document.createElement("button"):document.createElement("b");n.onClickWeekDay&&(r.type="button"),i.forEach(o=>{const a=r.cloneNode(!0);a.innerText=o.titleShort,a.className=n.styles.weekDay,a.role="columnheader",a.ariaLabel=o.titleLong,a.dataset.vcWeekDay=String(o.id),o.isWeekend&&(a.dataset.vcWeekDayOff=""),s.appendChild(a)})})},jce=(n,t,e,i,s)=>{const r=t.cloneNode(!1);return r.className=n.styles.yearsYear,r.innerText=String(s),r.ariaLabel=String(s),r.role="gridcell",r.dataset.vcYearsYear=`${s}`,i&&(r.ariaDisabled="true"),i&&(r.tabIndex=-1),r.disabled=i,EM(n,r,"year",e===s,!1),r},TM=(n,t)=>{var e;const i=t!=null&&t.dataset.vcYear?Number(t.dataset.vcYear):n.context.selectedYear;Be(n,"currentType","year"),_M(n,t),Py(n),NT(n);const s=n.context.mainElement.querySelector('[data-vc="years"]');if(!n.selectionYearsMode||!s)return;const r=n.type!=="multiple"||n.context.selectedYear===i?0:1,o=document.createElement("button");o.type="button";for(let a=n.context.displayYear-7;a<n.context.displayYear+8;a++){const l=a<rt(n.context.dateMin).getFullYear()+r||a>rt(n.context.dateMax).getFullYear(),c=jce(n,o,i,l,a);s.appendChild(c),n.onCreateYearEls&&n.onCreateYearEls(n,c)}(e=n.context.mainElement.querySelector("[data-vc-years-year]:not([disabled])"))==null||e.focus()},Gce=(n,t,e)=>{new MutationObserver(i=>{for(let s=0;s<i.length;s++)if(i[s].attributeName===t){e();break}}).observe(n,{attributes:!0})},LE={value:!1,set:()=>LE.value=!0,check:()=>LE.value},mm=(n,t)=>n.dataset.vcTheme=t,TL=(n,t)=>{if(mm(n.context.mainElement,t.matches?"dark":"light"),n.selectedTheme!=="system"||LE.check())return;const e=i=>{const s=document.querySelectorAll('[data-vc="calendar"]');s==null||s.forEach(r=>mm(r,i.matches?"dark":"light"))};t.addEventListener?t.addEventListener("change",e):t.addListener(e),LE.set()},Yce=(n,t)=>{const e=n.themeAttrDetect.length?document.querySelector(n.themeAttrDetect):null,i=n.themeAttrDetect.replace(/^.*\[(.+)\]/g,(r,o)=>o);if(!e||e.getAttribute(i)==="system")return void TL(n,t);const s=e.getAttribute(i);s?(mm(n.context.mainElement,s),Gce(e,i,()=>{const r=e.getAttribute(i);r&&mm(n.context.mainElement,r)})):TL(n,t)},qce=n=>{window.matchMedia("(prefers-color-scheme)").media!=="not all"?n.selectedTheme==="system"?Yce(n,window.matchMedia("(prefers-color-scheme: dark)")):mm(n.context.mainElement,n.selectedTheme):mm(n.context.mainElement,"light")},FE=n=>n.charAt(0).toUpperCase()+n.slice(1).replace(/\./,""),Kce=(n,t,e)=>{const i=new Date(`1978-01-0${t+1}T00:00:00.000Z`),s=i.toLocaleString(e,{weekday:"short",timeZone:"UTC"}),r=i.toLocaleString(e,{weekday:"long",timeZone:"UTC"});n.context.locale.weekdays.short.push(FE(s)),n.context.locale.weekdays.long.push(FE(r))},Xce=(n,t,e)=>{const i=new Date(`1978-${String(t+1).padStart(2,"0")}
310-01T00:00:00.000Z`),s=i.toLocaleString(e,{month:"short",timeZone:"UTC"}),r=i.toLocaleString(e,{month:"long",timeZone:"UTC"});n.context.locale.months.short.push(FE(s)),n.context.locale.months.long.push(FE(r))},Jce=n=>{var t,e,i,s,r,o,a,l;if(!(n.context.locale.weekdays.short[6]&&n.context.locale.weekdays.long[6]&&n.context.locale.months.short[11]&&n.context.locale.months.long[11]))if(typeof n.locale=="string"){if(typeof n.locale=="string"&&!n.locale.length)throw new Error(zc.notLocale);Array.from({length:7},(c,u)=>Kce(n,u,n.locale)),Array.from({length:12},(c,u)=>Xce(n,u,n.locale))}else{if(!((e=(t=n.locale)==null?void 0:t.weekdays)!=null&&e.short[6]&&((s=(i=n.locale)==null?void 0:i.weekdays)!=null&&s.long[6])&&((o=(r=n.locale)==null?void 0:r.months)!=null&&o.short[11])&&((l=(a=n.locale)==null?void 0:a.months)!=null&&l.long[11])))throw new Error(zc.notLocale);Be(n,"locale",gm({},n.locale))}},BT=n=>{const t={default:()=>{SL(n),Kk(n)},multiple:()=>{SL(n),Kk(n)},month:()=>P$(n),year:()=>TM(n)};qce(n),Jce(n),_M(n),Py(n),NT(n),Uce(n),t[n.context.currentType]()},M$=n=>{const t=e=>{var i;const s=e.target;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)||s.localName!=="button")return;const r=Array.from(n.context.mainElement.querySelectorAll('[data-vc="calendar"] button')),o=r.indexOf(s);if(o===-1)return;const a=(l=r[o]).hasAttribute("data-vc-date-btn")?7:l.hasAttribute("data-vc-months-month")?4:l.hasAttribute("data-vc-years-year")?5:1;var l;const c=(0,{ArrowUp:()=>Math.max(0,o-a),ArrowDown:()=>Math.min(r.length-1,o+a),ArrowLeft:()=>Math.max(0,o-1),ArrowRight:()=>Math.min(r.length-1,o+1)}[e.key])();(i=r[c])==null||i.focus()};return n.context.mainElement.addEventListener("keydown",t),()=>n.context.mainElement.removeEventListener("keydown",t)},Xk=(n,t)=>{const e=rt(mh(new Date(n.context.selectedYear,n.context.selectedMonth,1)));({prev:()=>e.setMonth(e.getMonth()-n.monthsToSwitch),next:()=>e.setMonth(e.getMonth()+n.monthsToSwitch)})[t](),Be(n,"selectedMonth",e.getMonth()),Be(n,"selectedYear",e.getFullYear()),Py(n),NT(n),Kk(n)},Zce=(n,t)=>{const e=t.target.closest("[data-vc-arrow]");if(e){if(["default","multiple"].includes(n.context.currentType))Xk(n,e.dataset.vcArrow);else if(n.context.currentType==="year"&&n.context.displayYear!==void 0){const i={prev:-15,next:15}[e.dataset.vcArrow];Be(n,"displayYear",n.context.displayYear+i),TM(n,t.target)}n.onClickArrow&&n.onClickArrow(n,t)}},O$=(n,t)=>t===void 0||(typeof t=="function"?t(n):t),Jk=n=>O$(n,n.enableDateToggle),xL=(n,t,e)=>{const i=t.dataset.vcDate,s=t.closest("[data-vc-date][data-vc-date-selected]"),r=Jk(n);if(s&&!r)return;const o=s?n.context.selectedDates.filter(a=>a!==i):e?[...n.context.selectedDates,i]:[i];Be(n,"selectedDates",o)},cl=(n,t,e)=>{if(!t)return;if(!e)return t.dataset.vcDateRangeTooltip="hidden",void(t.textContent="");const i=n.context.mainElement.getBoundingClientRect(),s=e.getBoundingClientRect();t.style.left=s.left-i.left+s.width/2+"px",t.style.top=s.bottom-i.top-s.height+"px",t.dataset.vcDateRangeTooltip="visible",t.innerHTML=n.sanitizerHTML(n.onCreateDateRangeTooltip(n,e,t,s,i))},xe={self:null,lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null},Qce=(n,t,e)=>{var i,s,r;if(!((s=(i=xe.self)==null?void 0:i.context)!=null&&s.selectedDates[0]))return;const o=mh(n);(r=xe.self.context.disableDates)!=null&&r.includes(o)||(xe.self.context.mainElement.querySelectorAll(`[data-vc-date="${o}"]`).forEach(a=>a.dataset.vcDateHover=""),t.forEach(a=>a.dataset.vcDateHover="first"),e.forEach(a=>{a.dataset.vcDateHover==="first"?a.dataset.vcDateHover="first-and-last":a.dataset.vcDateHover="last"}))},Fb=()=>{var n,t;(t=(n=xe.self)==null?void 0:n.context)!=null&&t.mainElement&&xe.self.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(e=>e.removeAttribute("data-vc-date-hover"))},eue=n=>{var t,e;if(!n||!((e=(t=xe.self)==null?void 0:t.context)!=null&&e.selectedDates[0]))return;if(!n.closest('[data-vc="dates"]'))return xe.lastDateEl=null,cl(xe.self,xe.tooltipEl,null),void Fb();const i=n.closest("[data-vc-date]");if(!i||xe.lastDateEl===i)return;xe.lastDateEl=i,cl(xe.self,xe.tooltipEl,i),Fb();const s=i.dataset.vcDate,r=rt(xe.self.context.selectedDates[0]),o=rt(s),a=xe.self.context.mainElement.querySelectorAll(`[data-vc-date="${xe.self.context.selectedDates[0]}"]`),l=xe.self.context.mainElement.querySelectorAll(`[data-vc-date="${s}"]`),[c,u]=r<o?[a,l]:[l,a],[d,h]=r<o?[r,o]:[o,r];for(let f=new Date(d);f<=h;f.setDate(f.getDate()+1))Qce(f,c,u)},tue=n=>{const t=n==null?void 0:n.closest("[data-vc-date-selected]");if(!t&&xe.lastDateEl)return xe.lastDateEl=null,void cl(xe.self,xe.tooltipEl,null);t&&xe.lastDateEl!==t&&(xe.lastDateEl=t,cl(xe.self,xe.tooltipEl,t))},D$=n=>t=>{const e=t.target;xe.isHovering||(xe.isHovering=!0,requestAnimationFrame(()=>{n(e),xe.isHovering=!1}))},H0=D$(eue),k_=D$(tue),jp=n=>{xe.self&&n.key==="Escape"&&(xe.lastDateEl=null,Be(xe.self,"selectedDates",[]),xe.self.context.mainElement.removeEventListener("mousemove",H0),xe.self.context.mainElement.removeEventListener("keydown",jp),cl(xe.self,xe.tooltipEl,null),Fb())},fu=()=>{xe.timeoutId!==null&&clearTimeout(xe.timeoutId),xe.timeoutId=setTimeout(()=>{xe.lastDateEl=null,cl(xe.self,xe.tooltipEl,null),Fb()},50)},nue=()=>{var n,t,e,i;if(!((e=(t=(n=xe.self)==null?void 0:n.context)==null?void 0:t.selectedDates)!=null&&e[0])||!((i=xe.self.context.disableDates)!=null&&i[0]))return;const s=rt(xe.self.context.selectedDates[0]),[r,o]=xe.self.context.disableDates.map(a=>rt(a)).reduce(([a,l],c)=>[s>=c?c:a,s<c&&l===null?c:l],[null,null]);r&&Be(xe.self,"displayDateMin",mh(new Date(r.setDate(r.getDate()+1)))),o&&Be(xe.self,"displayDateMax",mh(new Date(o.setDate(o.getDate()-1)))),xe.self.disableDatesPast&&!xe.self.disableAllDates&&rt(xe.self.context.displayDateMin)<rt(xe.self.context.dateToday)&&Be(xe.self,"displayDateMin",xe.self.context.dateToday)},R$=(n,t)=>
310{xe.self=n,xe.lastDateEl=t,Fb(),n.disableDatesGaps&&(xe.rangeMin=xe.rangeMin?xe.rangeMin:n.context.displayDateMin,xe.rangeMax=xe.rangeMax?xe.rangeMax:n.context.displayDateMax),n.onCreateDateRangeTooltip&&(xe.tooltipEl=n.context.mainElement.querySelector("[data-vc-date-range-tooltip]"));const e=t==null?void 0:t.dataset.vcDate;if(e){const i=n.context.selectedDates.length===1&&n.context.selectedDates[0].includes(e),s=i&&!Jk(n)?[e,e]:i&&Jk(n)?[]:n.context.selectedDates.length>1?[e]:[...n.context.selectedDates,e];Be(n,"selectedDates",s),n.context.selectedDates.length>1&&n.context.selectedDates.sort((r,o)=>+new Date(r)-+new Date(o))}({set:()=>(n.disableDatesGaps&&nue(),cl(xe.self,xe.tooltipEl,t),xe.self.context.mainElement.removeEventListener("mousemove",k_),xe.self.context.mainElement.removeEventListener("mouseleave",fu),xe.self.context.mainElement.removeEventListener("keydown",jp),xe.self.context.mainElement.addEventListener("mousemove",H0),xe.self.context.mainElement.addEventListener("mouseleave",fu),xe.self.context.mainElement.addEventListener("keydown",jp),()=>{xe.self.context.mainElement.removeEventListener("mousemove",H0),xe.self.context.mainElement.removeEventListener("mouseleave",fu),xe.self.context.mainElement.removeEventListener("keydown",jp)}),reset:()=>{const[i,s]=[n.context.selectedDates[0],n.context.selectedDates[n.context.selectedDates.length-1]],r=n.context.selectedDates[0]!==n.context.selectedDates[n.context.selectedDates.length-1],o=pl([`${i}:${s}`]).filter(l=>!n.context.disableDates.includes(l)),a=r?n.enableEdgeDatesOnly?[i,s]:o:[n.context.selectedDates[0],n.context.selectedDates[0]];if(Be(n,"selectedDates",a),n.disableDatesGaps&&(Be(n,"displayDateMin",xe.rangeMin),Be(n,"displayDateMax",xe.rangeMax)),xe.self.context.mainElement.removeEventListener("mousemove",H0),xe.self.context.mainElement.removeEventListener("mouseleave",fu),xe.self.context.mainElement.removeEventListener("keydown",jp),n.onCreateDateRangeTooltip)return n.context.selectedDates[0]||(xe.self.context.mainElement.removeEventListener("mousemove",k_),xe.self.context.mainElement.removeEventListener("mouseleave",fu),cl(xe.self,xe.tooltipEl,null)),n.context.selectedDates[0]&&(xe.self.context.mainElement.addEventListener("mousemove",k_),xe.self.context.mainElement.addEventListener("mouseleave",fu),cl(xe.self,xe.tooltipEl,t)),()=>{xe.self.context.mainElement.removeEventListener("mousemove",k_),xe.self.context.mainElement.removeEventListener("mouseleave",fu)}}})[n.context.selectedDates.length===1?"set":"reset"]()},aA=n=>{n.context.mainElement.querySelectorAll("[data-vc-date]").forEach(t=>{const e=t.querySelector("[data-vc-date-btn]"),i=t.dataset.vcDate,s=rt(i).getDay();C$(n,n.context.selectedYear,t,e,s,i,"current")})},iue=(n,t)=>{var e;const i=t.target,s=i.closest("[data-vc-date-btn]");if(!n.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(n.selectionDatesMode)||!s)return;const r=s.closest("[data-vc-date]");({single:()=>xL(n,r,!1),multiple:()=>xL(n,r,!0),"multiple-ranged":()=>R$(n,r)})[n.selectionDatesMode](),(e=n.context.selectedDates)==null||e.sort((l,c)=>+new Date(l)-+new Date(c)),n.onClickDate&&n.onClickDate(n,t),n.inputMode&&n.context.inputElement&&n.context.mainElement&&n.onChangeToInput&&n.onChangeToInput(n,t);const o=i.closest('[data-vc-date-month="prev"]'),a=i.closest('[data-vc-date-month="next"]');({prev:()=>n.enableMonthChangeOnDayClick?Xk(n,"prev"):aA(n),next:()=>n.enableMonthChangeOnDayClick?Xk(n,"next"):aA(n),current:()=>aA(n)})[o?"prev":a?"next":"current"]()},sue=["month","year"],L$=(n,t,e)=>{const{currentValue:i,columnID:s}=SM(n,t);return n.context.currentType==="month"&&s>=0?e-s:n.context.currentType==="year"&&n.context.selectedYear!==i?e-1:e},rue=(n,t)=>{const e=L$(n,"year",Number(t.dataset.vcYearsYear)),i=rt(n.context.dateMin),s=rt(n.context.dateMax),r=n.context.displayMonthsCount-1,{columnID:o}=SM(n,"year"),a=n.context.selectedMonth<i.getMonth()&&e<=i.getFullYear(),l=n.context.selectedMonth>s.getMonth()-r+o&&e>=s.getFullYear(),c=e<i.getFullYear(),u=e>s.getFullYear(),d=a||c?i.getFullYear():l||u?s.getFullYear():e,h=a||c?i.getMonth():l||u?s.getMonth()-r+o:n.context.selectedMonth;Be(n,"selectedYear",d),Be(n,"selectedMonth",h)},oue=(n,t)=>{const e=t.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),i=L$(n,"month",Number(t.dataset.vcMonthsMonth)),s=Number(e.dataset.vcYear),r=rt(n.context.dateMin),o=rt(n.context.dateMax),a=i<r.getMonth()&&s<=r.getFullYear(),l=i>o.getMonth()&&s>=o.getFullYear();Be(n,"selectedYear",s),Be(n,"selectedMonth",a?r.getMonth():l?o.getMonth():i)},aue=(n,t,e,i)=>{var s;({year:()=>{if(n.type==="multiple")return rue(n,i);Be(n,"selectedYear",Number(i.dataset.vcYearsYear))},month:()=>
310{if(n.type==="multiple")return oue(n,i);Be(n,"selectedMonth",Number(i.dataset.vcMonthsMonth))}})[e](),{year:()=>{var r;return(r=n.onClickYear)==null?void 0:r.call(n,n,t)},month:()=>{var r;return(r=n.onClickMonth)==null?void 0:r.call(n,n,t)}}[e](),n.context.currentType!==n.type?(Be(n,"currentType",n.type),BT(n),(s=n.context.mainElement.querySelector(`[data-vc="${e}"]`))==null||s.focus()):EM(n,i,e,!0,!0)},lue=(n,t,e)=>{var i;const s=t.target,r=s.closest(`[data-vc="${e}"]`),o={year:()=>TM(n,s),month:()=>P$(n,s)};if(r&&n.onClickTitle&&n.onClickTitle(n,t),r&&n.context.currentType!==e)return o[e]();const a=s.closest(`[data-vc-${e}s-${e}]`);if(a)return aue(n,t,e,a);const l=s.closest('[data-vc="grid"]'),c=s.closest('[data-vc="column"]');(n.context.currentType===e&&r||n.type==="multiple"&&n.context.currentType===e&&l&&!c)&&(Be(n,"currentType",n.type),BT(n),(i=n.context.mainElement.querySelector(`[data-vc="${e}"]`))==null||i.focus())},cue=(n,t)=>{const e={month:n.selectionMonthsMode,year:n.selectionYearsMode};sue.forEach(i=>{e[i]&&t.target&&lue(n,t,i)})},uue=(n,t)=>{if(!n.enableWeekNumbers||!n.onClickWeekNumber)return;const e=t.target.closest("[data-vc-week-number]"),i=n.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!e||!i[0])return;const s=Number(e.innerText),r=Number(e.dataset.vcWeekYear),o=Array.from(i).filter(a=>Number(a.dataset.vcDateWeekNumber)===s);n.onClickWeekNumber(n,s,r,o,t)},due=(n,t)=>{if(!n.onClickWeekDay)return;const e=t.target.closest("[data-vc-week-day]"),i=t.target.closest('[data-vc="column"]'),s=i?i.querySelectorAll("[data-vc-date-week-day]"):n.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!e||!s[0])return;const r=Number(e.dataset.vcWeekDay),o=Array.from(s).filter(a=>Number(a.dataset.vcDateWeekDay)===r);n.onClickWeekDay(n,r,o,t)},F$=n=>{const t=e=>{Zce(n,e),due(n,e),uue(n,e),iue(n,e),cue(n,e)};return n.context.mainElement.addEventListener("click",t),()=>n.context.mainElement.removeEventListener("click",t)},hue=n=>{if(n.type==="multiple"&&(n.displayMonthsCount<=1||n.displayMonthsCount>12))throw new Error(zc.incorrectMonthsCount);if(n.type!=="multiple"&&n.displayMonthsCount>1)throw new Error(zc.incorrectMonthsCount);Be(n,"displayMonthsCount",n.displayMonthsCount?n.displayMonthsCount:n.type==="multiple"?2:1)},fue=()=>{const n=new Date;return new Date(n.getTime()-6e4*n.getTimezoneOffset()).toISOString().substring(0,10)},Su=(n,t)=>n==="today"?fue():n instanceof Date||typeof n=="number"||typeof n=="string"?pl([n])[0]:t,gue=n=>{var t,e,i;const s=Su(n.dateMin,n.dateMin),r=Su(n.dateMax,n.dateMax),o=Su(n.displayDateMin,s),a=Su(n.displayDateMax,r);Be(n,"dateToday",Su(n.dateToday,n.dateToday)),Be(n,"displayDateMin",o?rt(s)>=rt(o)?s:o:s),Be(n,"displayDateMax",a?rt(r)<=rt(a)?r:a:r);const l=n.disableDatesPast&&!n.disableAllDates&&rt(o)<rt(n.context.dateToday);Be(n,"displayDateMin",l||n.disableAllDates?n.context.dateToday:o),Be(n,"displayDateMax",n.disableAllDates?n.context.dateToday:a),Be(n,"disableDates",n.disableDates[0]&&!n.disableAllDates?pl(n.disableDates):n.disableAllDates?[n.context.displayDateMin]:[]),n.context.disableDates.length>1&&n.context.disableDates.sort((c,u)=>+new Date(c)-+new Date(u)),Be(n,"enableDates",n.enableDates[0]?pl(n.enableDates):[]),(t=n.context.enableDates)!=null&&t[0]&&((e=n.context.disableDates)!=null&&e[0])&&Be(n,"disableDates",n.context.disableDates.filter(c=>!n.context.enableDates.includes(c))),n.context.enableDates.length>1&&n.context.enableDates.sort((c,u)=>+new Date(c)-+new Date(u)),(i=n.context.enableDates)!=null&&i[0]&&n.disableAllDates&&(Be(n,"displayDateMin",n.context.enableDates[0]),Be(n,"displayDateMax",n.context.enableDates[n.context.enableDates.length-1])),Be(n,"dateMin",n.displayDisabledDates?s:n.context.displayDateMin),Be(n,"dateMax",n.displayDisabledDates?r:n.context.displayDateMax)},mue=n=>{var t;Be(n,"selectedDates",(t=n.selectedDates)!=null&&t[0]?pl(n.selectedDates):[])},pue=n=>{const t=s=>{const r=new Date(s);Zk(n,r.getMonth(),r.getFullYear())};if(n.displayDateMin&&n.displayDateMin!=="today"&&(e=n.displayDateMin,i=new Date,new Date(e).getTime()>i.getTime())){const s=n.selectedDates.length&&n.selectedDates[0]?pl(n.selectedDates)[0]:n.displayDateMin;return t(rt(Su(s,n.displayDateMin))),!0}var e,i;if(n.displayDateMax&&n.displayDateMax!=="today"&&((s,r)=>new Date(s).getTime()<r.getTime())(n.displayDateMax,new Date)){const s=n.selectedDates.length&&n.selectedDates[0]?pl(n.selectedDates)[0]:n.displayDateMax;return t(rt(Su(s,n.displayDateMax))),!0}return!1},Zk=(n,t,e)=>{Be(n,"selectedMonth",t),Be(n,"selectedYear",e),Be(n,"displayYear",e)},bue=n=>{var t;if(n.enableJumpToSelectedDate&&((t=n.selectedDates)!=null&&t[0])&&n.selectedMonth===void 0&&n.selectedYear===void 0){const s=rt(pl(n.selectedDates)[0]);return void Zk(n,s.getMonth(),s.getFullYear())}if(pue(n))return;const e=n.selectedMonth!==void 0&&Number(n.selectedMonth)>=0&&Number(n.selectedMonth)<12,i=n.selectedYear!==void 0&&Number(n.selectedYear)>=0&&Number(n.selectedYear)<=9999;Zk(n,e?Number(n.selectedMonth):rt(n.context.dateToday).getMonth(),i?Number(n.selectedYear):rt(n.context.dateToday).getFullYear())},wue=n=>{var t,e,i;if(!n.selectionTimeMode)return;if(![12,24].includes(n.selectionTimeMode))throw new Error(zc.incorrectTime);const s=n.selectionTimeMode===12,r=s?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/;let[o,a,l]=(i=(e=(t=n.selectedTime)==null?void 0:t.match(r))==null?void 0:e.slice(1))!=null?i:[];o?s&&!l&&(l="AM"):(o=s?Lb(String(n.timeMinHour)):String(n.timeMinHour),a=String(n.timeMinMinute),l=s?Number(Lb(String(n.timeMinHour)))>=12?"PM":"AM":null),Be(n,"selectedHours",o.padStart(2,"0")),Be(n,"selectedMinutes",a.padStart(2,"0")),Be(n,"selectedKeeping",l),Be(n,"selectedTime",`${n.context.selectedHours}:${n.context.selectedMinutes}${l?` ${l}`:""}`)},N$=n=>{Be(n,"currentType",n.type),hue(n),gue(n),bue(n),mue(n),wue(n)},B$=(n,{year:t,month:e,dates:i,time:s,locale:r},o=!0)=>{var a;const l={year:n.selectedYear,month:n.selectedMonth,dates:n.selectedDates,time:n.selectedTime};n.selectedYear=t?l.year:n.context.selectedYear,n.selectedMonth=e?l.month:n.context.selectedMonth,n.selectedTime=s?l.time:n.context.selectedTime,n.selectedDates=i==="only-first"&&((a=n.context.selectedDates)!=null&&a[0])?[n.context.selectedDates[0]]:i===!0?l.dates:n.context.selectedDates,r&&Be(n,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),N$(n),o&&BT(n),n.selectedYear=l.year,n.selectedMonth=l.month,n.selectedDates=l.dates,n.selectedTime=l.time,n.selectionDatesMode==="multiple-ranged"&&i&&R$(n,null)},vue=n=>{const t=document.createElement("div");return t.className=n.styles.calendar,t.dataset.vc="calendar",t.dataset.vcInput
310="",t.dataset.vcCalendarHidden="",Be(n,"inputModeInit",!0),Be(n,"isShowInInputMode",!1),Be(n,"mainElement",t),document.body.appendChild(n.context.mainElement),B$(n,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),setTimeout(()=>AM(n)),n.onInit&&n.onInit(n),M$(n),F$(n)},yue=n=>O$(n,n.openOnFocus),_ue=n=>{Be(n,"inputElement",n.context.mainElement);const t=()=>{n.context.inputModeInit?setTimeout(()=>AM(n)):vue(n)};n.context.inputElement.addEventListener("click",t);const e=typeof n.openOnFocus=="function"||n.openOnFocus===!0,i=()=>{tce(n)?ice(n):yue(n)&&t()};e&&n.context.inputElement.addEventListener("focus",i);const s=r=>{const o=r.key==="Tab"&&!r.shiftKey,a=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.key);(o||a)&&(l=>{var c;if(!n.context.isShowInInputMode||document.activeElement!==n.context.inputElement)return!1;const u=h=>h.tabIndex>=0&&!h.hasAttribute("disabled")&&h.getAttribute("aria-disabled")!=="true",d=(c=document.createTreeWalker(n.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:h=>u(h)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())!=null?c:u(n.context.mainElement)?n.context.mainElement:null;!d||d.tabIndex<0||(l.preventDefault(),d.focus())})(r)};return n.context.inputElement.addEventListener("keydown",s),()=>{n.context.inputElement.removeEventListener("click",t),e&&n.context.inputElement.removeEventListener("focus",i),n.context.inputElement.removeEventListener("keydown",s)}},Eue=n=>(Be(n,"originalElement",n.context.mainElement.cloneNode(!0)),Be(n,"isInit",!0),n.inputMode?_ue(n):(N$(n),BT(n),n.onInit&&n.onInit(n),M$(n),F$(n))),V$=(n,t)=>{if(!n.context.isInit)throw new Error(zc.notInit);B$(n,gm(gm({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),t),!(n.inputMode&&!n.context.inputModeInit)),n.onUpdate&&n.onUpdate(n)},xM=(n,t)=>{const e=Object.keys(t);for(let i=0;i<e.length;i++){const s=e[i];typeof n[s]!="object"||typeof t[s]!="object"||t[s]instanceof Date||Array.isArray(t[s])?t[s]!==void 0&&(n[s]=t[s]):xM(n[s],t[s])}},Sue=(n,t,e)=>{xM(n,t),n.context.isInit&&V$(n,e)};function Tue(n,t){const e="left";if(!t||!n)return e;const{canShow:i,parentPositions:s}=A$(n,t),r=i.left&&i.right;return(r&&i.bottom?"center":r&&i.top?["top","center"]:Array.isArray(s)?[s[0]==="bottom"?"top":"bottom",...s.slice(1)]:s)||e}const AL=(n,t,e)=>{if(!n)return;const i=e==="auto"?Tue(n,t):e,s={top:-t.offsetHeight,bottom:n.offsetHeight,left:0,center:n.offsetWidth/2-t.offsetWidth/2,right:n.offsetWidth-t.offsetWidth},r=Array.isArray(i)?i[0]:"bottom",o=Array.isArray(i)?i[1]:i;t.dataset.vcPosition=r;const{top:a,left:l}=wM(n),c=a+s[r];let u=l+s[o];const{vw:d}=vM();if(u+t.clientWidth>d){const h=window.innerWidth-document.body.clientWidth;u=d-t.clientWidth-h}else u<0&&(u=0);Object.assign(t.style,{left:`${u}px`,top:`${c}px`})},AM=n=>{if(n.context.isShowInInputMode)return;if(!n.context.currentType)return void n.context.mainElement.click();Be(n,"cleanupHandlers",[]),Be(n,"isShowInInputMode",!0),n.inputMode&&rce(n.context.mainElement),AL(n.context.inputElement,n.context.mainElement,n.positionToInput),n.context.mainElement.removeAttribute("data-vc-calendar-hidden");const t=()=>{AL(n.context.inputElement,n.context.mainElement,n.positionToInput)};window.addEventListener("resize",t),n.context.cleanupHandlers.push(()=>window.removeEventListener("resize",t));const e=s=>{s.key==="Escape"&&qk(n)};document.addEventListener("keydown",e),n.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",e));const i=s=>{s.target===n.context.inputElement||n.context.mainElement.contains(s.target)||qk(n)};document.addEventListener("click",i,{capture:!0}),n.context.cleanupHandlers.push(()=>document.removeEventListener("click",i,{capture:!0})),n.onShow&&n.onShow(n)},xue={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years"},arrowPrev:{month:"Previous month",year:"Previous list of years"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},Aue={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",
310weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"};class Cue{constructor(){Pe(this,"type","default"),Pe(this,"inputMode",!1),Pe(this,"openOnFocus",!0),Pe(this,"positionToInput","left"),Pe(this,"firstWeekday",1),Pe(this,"monthsToSwitch",1),Pe(this,"themeAttrDetect","html[data-theme]"),Pe(this,"locale","en"),Pe(this,"dateToday","today"),Pe(this,"dateMin","1970-01-01"),Pe(this,"dateMax","2470-12-31"),Pe(this,"displayDateMin"),Pe(this,"displayDateMax"),Pe(this,"displayDatesOutside",!0),Pe(this,"displayDisabledDates",!1),Pe(this,"displayMonthsCount"),Pe(this,"disableDates",[]),Pe(this,"disableAllDates",!1),Pe(this,"disableDatesPast",!1),Pe(this,"disableDatesGaps",!1),Pe(this,"disableWeekdays",[]),Pe(this,"disableToday",!1),Pe(this,"enableDates",[]),Pe(this,"enableEdgeDatesOnly",!0),Pe(this,"enableDateToggle",!0),Pe(this,"enableWeekNumbers",!1),Pe(this,"enableMonthChangeOnDayClick",!0),Pe(this,"enableJumpToSelectedDate",!1),Pe(this,"selectionDatesMode","single"),Pe(this,"selectionMonthsMode",!0),Pe(this,"selectionYearsMode",!0),Pe(this,"selectionTimeMode",!1),Pe(this,"selectedDates",[]),Pe(this,"selectedMonth"),Pe(this,"selectedYear"),Pe(this,"selectedHolidays",[]),Pe(this,"selectedWeekends",[0,6]),Pe(this,"selectedTime"),Pe(this,"selectedTheme","system"),Pe(this,"timeMinHour",0),Pe(this,"timeMaxHour",23),Pe(this,"timeMinMinute",0),Pe(this,"timeMaxMinute",59),Pe(this,"timeControls","all"),Pe(this,"timeStepHour",1),Pe(this,"timeStepMinute",1),Pe(this,"sanitizerHTML",t=>t),Pe(this,"onClickDate"),Pe(this,"onClickWeekDay"),Pe(this,"onClickWeekNumber"),Pe(this,"onClickTitle"),Pe(this,"onClickMonth"),Pe(this,"onClickYear"),Pe(this,"onClickArrow"),Pe(this,"onChangeTime"),Pe(this,"onChangeToInput"),Pe(this,"onCreateDateRangeTooltip"),Pe(this,"onCreateDateEls"),Pe(this,"onCreateMonthEls"),Pe(this,"onCreateYearEls"),Pe(this,"onInit"),Pe(this,"onUpdate"),Pe(this,"onDestroy"),Pe(this,"onShow"),Pe(this,"onHide"),Pe(this,"popups",{}),Pe(this,"labels",gm({},xue)),Pe(this,"layouts",{default:"",multiple:"",month:"",year:""}),Pe(this,"styles",gm({},Aue))}}const H$=class Qk extends Cue{constructor(t,e){var i;super(),Pe(this,"init",()=>Eue(this)),Pe(this,"update",s=>V$(this,s)),Pe(this,"destroy",()=>ece(this)),Pe(this,"show",()=>AM(this)),Pe(this,"hide",()=>qk(this)),Pe(this,"set",(s,r)=>Sue(this,s,r)),Pe(this,"context"),this.context=Qle(gm({},this.context),{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),Be(this,"mainElement",typeof t=="string"?(i=Qk.memoizedElements.get(t))!=null?i:this.queryAndMemoize(t):t),e&&xM(this,e)}queryAndMemoize(t){const e=document.querySelector(t);if(!e)throw new Error(zc.notFoundSelector(t));return Qk.memoizedElements.set(t,e),e}};Pe(H$,"memoizedElements",new Map);let kue=H$;function Iue(n){return Number.isSafeInteger(n)&&n>=0}function Pue(n){return n!=null&&typeof n!="function"&&Iue(n.length)}function z$(n){return n}function Nb(n){return n==="__proto__"}function $$(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}function CM(n){var t;return typeof n=="string"||typeof n=="symbol"?n:Object.is((t=n==null?void 0:n.valueOf)==null?void 0:t.call(n),-0)?"-0":String(n)}function kM(n){const t=[],e=n.length;if(e===0)return t;let i=0,s="",r="",o=!1;for(n.charCodeAt(0)===46&&(t.push(""),i++);i<e;){const a=n[i];r?a==="\\"&&i+1<e?(i++,s+=n[i]):a===r?r="":s+=a:o?a==='"'||a==="'"?r=a:a==="]"?(o=!1,t.push(s),s=""):s+=a:a==="["?(o=!0,s&&(t.push(s),s="")):a==="."?s&&(t.push(s),s=""):s+=a,i++}return s&&t.push(s),t}function $c(n,t,e){if(n==null)return e;switch(typeof t){case"string":{if(Nb(t))return e;const i=n[t];return i===void 0?$$(t)?$c(n,kM(t),e):e:i}case"number":case"symbol":{typeof t=="number"&&(t=CM(t));const i=n[t];return i===void 0?e:i}
310default:{if(Array.isArray(t))return Mue(n,t,e);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),Nb(t))return e;const i=n[t];return i===void 0?e:i}}}function Mue(n,t,e){if(t.length===0)return e;let i=n;for(let s=0;s<t.length;s++){if(i==null||Nb(t[s]))return e;i=i[t[s]]}return i===void 0?e:i}function Oue(n){return function(t){return $c(t,n)}}function ys(n){return n!==null&&(typeof n=="object"||typeof n=="function")}function My(n){return n==null||typeof n!="object"&&typeof n!="function"}function Bb(n,t){return n===t||Number.isNaN(n)&&Number.isNaN(t)}function Due(n,t,e){return typeof e!="function"?IM(n,t):eI(n,t,function i(s,r,o,a,l,c){const u=e(s,r,o,a,l,c);return u!==void 0?!!u:eI(s,r,i,c)},new Map)}function eI(n,t,e,i){if(t===n)return!0;switch(typeof t){case"object":return Rue(n,t,e,i);case"function":return Object.keys(t).length>0?eI(n,{...t},e,i):Bb(n,t);default:return ys(n)?typeof t=="string"?t==="":!0:Bb(n,t)}}function Rue(n,t,e,i){if(t==null)return!0;if(Array.isArray(t))return W$(n,t,e,i);if(t instanceof Map)return Lue(n,t,e,i);if(t instanceof Set)return Fue(n,t,e,i);const s=Object.keys(t);if(n==null)return s.length===0;if(s.length===0)return!0;if(i&&i.has(t))return i.get(t)===n;i&&i.set(t,n);try{for(let r=0;r<s.length;r++){const o=s[r];if(!My(n)&&!(o in n)||t[o]===void 0&&n[o]!==void 0||t[o]===null&&n[o]!==null||!e(n[o],t[o],o,n,t,i))return!1}return!0}finally{i&&i.delete(t)}}function Lue(n,t,e,i){if(t.size===0)return!0;if(!(n instanceof Map))return!1;for(const[s,r]of t.entries()){const o=n.get(s);if(e(o,r,s,n,t,i)===!1)return!1}return!0}function W$(n,t,e,i){if(t.length===0)return!0;if(!Array.isArray(n))return!1;const s=new Set;for(let r=0;r<t.length;r++){const o=t[r];let a=!1;for(let l=0;l<n.length;l++){if(s.has(l))continue;const c=n[l];let u=!1;if(e(c,o,r,n,t,i)&&(u=!0),u){s.add(l),a=!0;break}}if(!a)return!1}return!0}function Fue(n,t,e,i){return t.size===0?!0:n instanceof Set?W$([...n],[...t],e,i):!1}function IM(n,t){return Due(n,t,()=>{})}function NE(n){return Object.getOwnPropertySymbols(n).filter(t=>Object.prototype.propertyIsEnumerable.call(n,t))}function pm(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const VT="[object RegExp]",bm="[object String]",Oy="[object Number]",Dy="[object Boolean]",wm="[object Arguments]",HT="[object Symbol]",zT="[object Date]",$T="[object Map]",WT="[object Set]",PM="[object Array]",Nue="[object Function]",UT="[object ArrayBuffer]",ob="[object Object]",Bue="[object Error]",jT="[object DataView]",MM="[object Uint8Array]",OM="[object Uint8ClampedArray]",DM="[object Uint16Array]",RM="[object Uint32Array]",Vue="[object BigUint64Array]",LM="[object Int8Array]",FM="[object Int16Array]",NM="[object Int32Array]",Hue="[object BigInt64Array]",BM="[object Float32Array]",VM="[object Float64Array]";function HM(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function zue(n,t){return Du(n,void 0,n,new Map,t)}function Du(n,t,e,i=new Map,s=void 0){const r=s==null?void 0:s(n,t,e,i);if(r!=null)return r;if(My(n))return n;if(i.has(n))return i.get(n);if(Array.isArray(n)){const o=new Array(n.length);i.set(n,o);for(let a=0;a<n.length;a++)o[a]=Du(n[a],a,e,i,s);return Object.hasOwn(n,"index")&&(o.index=n.index),Object.hasOwn(n,"input")&&(o.input=n.input),o}if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp){const o=new RegExp(n.source,n.flags);return o.lastIndex=n.lastIndex,o}if(n instanceof Map){const o=new Map;i.set(n,o);for(const[a,l]of n)o.set(a,Du(l,a,e,i,s));return o}if(n instanceof Set){const o=new Set;i.set(n,o);for(const a of n)o.add(Du(a,void 0,e,i,s));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(n))return n.subarray();if(HM(n)){const o=new(Object.getPrototypeOf(n)).constructor(n.length);i.set(n,o);for(let a=0;a<n.length;a++)o[a]=Du(n[a],a,e,i,s);return o}if(n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer)return n.slice(0);if(n instanceof DataView){const o=new DataView(n.buffer.slice(0),n.byteOffset,n.byteLength);return i.set(n,o),Tu(o,n,e,i,s),o}if(typeof File<"u"&&n instanceof File){const o=new File([n],n.name,{type:n.type});return i.set(n,o),Tu(o,n,e,i,s),o}if(n instanceof Blob){const o=new Blob([n],{type:n.type});return i.set(n,o),Tu(o,n,e,i,s),o}if(n instanceof Error){const o=new n.constructor;return i.set(n,o),o.message=n.message,o.name=n.name,o.stack=n.stack,o.cause=n.cause,Tu(o,n,e,i,s),o}if(typeof n=="object"&&$ue(n)){const o=Object.create(Object.getPrototypeOf(n));return i.set(n,o),Tu(o,n,e,i,s),o}return n}function Tu(n,t,e=n,i,s){const r=[...Object.keys(t),...NE(t)];for(let o=0;o<r.length;o++){const a=r[o],l=Object.getOwnPropertyDescriptor(n,a);(l==null||l.writable)&&(n[a]=Du(t[a],a,e,i,s))}}function $ue(n){switch(pm(n)){case wm:case PM:case UT:case jT:case Dy:case zT:case BM:case VM:case LM:case FM:case NM:case $T:case Oy:case ob:case VT:case WT:case bm:case HT:case MM:case OM:case DM:case RM:return!0;default:return!1}}function Wue(n){return Du(n,void 0,n,new Map,void 0)}function Uue(n){return n=Wue(n),t=>IM(t,n)}function GT(n,t){return zue(n,(e,i,s,r)=>{const o=t==null?void 0:t(e,i,s,r);if(o!=null)return o;if(typeof n=="object")switch(Object.prototype.toString.call(n)){case Oy:case bm:case Dy:{const a=new n.constructor(n==null?void 0:n.valueOf());return Tu(a,n),a}case wm:{const a={};return Tu(a,n),a.length=n.length,a[Symbol.iterator]=n[Symbol.iterator],a}default:return}})}function _s(n){return GT(n)}const jue=/^(?:0|[1-9]\d*)$/;function U$(n,t=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<t;case"symbol":return!1;case"string":return jue.test(n)}}function tI(n){return n!==null&&typeof n=="object"&&pm(n)==="[object Arguments]"}function Gue(n,t){let e;if(Array.isArray(t)?e=t:typeof t=="string"&&$$(t)&&(n==null?void 0:n[t])==null?e=kM(t):e=[t],e.length===0)return!1;let i=n;for(let s=0;s<e.length;s++){const r=e[s];if((i==null||!Object.hasOwn(i,r))&&!((Array.isArray(i)||tI(i))&&U$(r)&&r<i.length))return!1;i=i[r]}return!0}function Yue(n,t){switch(typeof n){case"object":{Object.is(n==null?void 0:n.valueOf(),-0)&&(n="-0");break}case"number":{n=CM(n);break}}return t=_s(t),function(e){const i=$c(e,n);return i===void 0?Gue(e,n):t===void 0?i===void 0:IM(i,t)}}function que(n){if(n==null)return z$;switch(typeof n){case"function":return n;case"object":return Array.isArray(n)&&n.length===2?Yue(n[0],n[1]):Uue(n);case"string":case"symbol":case"number":return Oue(n)}}function nI(n){return typeof n=="object"&&n!==null}function j$(n){return typeof n=="symbol"||n instanceof Symbol}function Kue(n){return j$(n)?NaN:Number(n)}function Xue(n){return n?(n=Kue(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}function Jue(n){const t=Xue(n),e=t%1;return e?t-e:t}function CL(n){return typeof n=="string"||n instanceof String}const Zue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Que=/^\w*$/;function ede(n,t){return Array.isArray(n)?!1:typeof n=="number"||typeof n=="boolean"||n==null||j$(n)?!0:typeof n=="string"&&(Que.test(n)||!Zue.test(n))||t!=null&&Object.hasOwn(t,n)}function tde(n){return Array.isArray(n)}function dp(n){return n}const nde=(n,t,e)=>{const i=n[t];(!(Object.hasOwn(n,t)&&Bb(i,e))||e===void 0&&!(t in n))&&(n[t]=e)};function ide(n,t,e,i){if(n==null&&!ys(n))return n;const s=ede(t,n)?[t]:Array.isArray(t)?t:typeof t=="string"?kM(t):[t];let r=n;for(let o=0;o<s.length&&r!=null;o++){const a=CM(s[o]);
310if(Nb(a))continue;let l;if(o===s.length-1)l=e(r[a]);else{const c=r[a],u=i==null?void 0:i(c,a,n);l=u!==void 0?u:ys(c)?c:U$(s[o+1])?[]:{}}nde(r,a,l),r=r[a]}return n}function G$(n,t,e){return ide(n,t,()=>e,()=>{})}function sde(n,t,{signal:e,edges:i}={}){let s,r=null;const o=i!=null&&i.includes("leading"),a=i==null||i.includes("trailing"),l=()=>{r!==null&&(n.apply(s,r),s=void 0,r=null)},c=()=>{a&&l(),f()};let u=null;const d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,c()},t)},h=()=>{u!==null&&(clearTimeout(u),u=null)},f=()=>{h(),s=void 0,r=null},p=()=>{h(),l()},v=function(...E){if(e!=null&&e.aborted)return;s=this,r=E;const x=u==null;d(),o&&x&&l()};return v.schedule=d,v.cancel=f,v.flush=p,e==null||e.addEventListener("abort",f,{once:!0}),v}function ph(n,t=0,e={}){typeof e!="object"&&(e={});const{leading:i=!1,trailing:s=!0,maxWait:r}=e,o=Array(2);i&&(o[0]="leading"),s&&(o[1]="trailing");let a,l=null;const c=sde(function(...h){a=n.apply(this,h),l=null},t,{edges:o}),u=function(...h){return r!=null&&(l===null&&(l=Date.now()),Date.now()-l>=r)?(a=n.apply(this,h),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,h),a)},d=()=>(c.flush(),a);return u.cancel=c.cancel,u.flush=d,u}function Vb(n,t=0,e={}){typeof e!="object"&&(e={});const{leading:i=!0,trailing:s=!0}=e;return ph(n,t,{leading:i,trailing:s,maxWait:t})}function Y$(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(Y$).join(",");const t=String(n);return t==="0"&&Object.is(Number(n),-0)?"-0":t}function kL(n){if(!n||typeof n!="object")return!1;const t=Object.getPrototypeOf(n);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(n)==="[object Object]":!1}function q$(n,t,e){return Gp(n,t,void 0,void 0,void 0,void 0,e)}function Gp(n,t,e,i,s,r,o){const a=o(n,t,e,i,s,r);if(a!==void 0)return a;if(typeof n==typeof t)switch(typeof n){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return n===t;case"number":return n===t||Object.is(n,t);case"function":return n===t;case"object":return ab(n,t,r,o)}return ab(n,t,r,o)}function ab(n,t,e,i){if(Object.is(n,t))return!0;let s=pm(n),r=pm(t);if(s===wm&&(s=ob),r===wm&&(r=ob),s!==r)return!1;switch(s){case bm:return n.toString()===t.toString();case Oy:{const l=n.valueOf(),c=t.valueOf();return Bb(l,c)}case Dy:case zT:case HT:return Object.is(n.valueOf(),t.valueOf());case VT:return n.source===t.source&&n.flags===t.flags;case Nue:return n===t}e=e??new Map;const o=e.get(n),a=e.get(t);if(o!=null&&a!=null)return o===t;e.set(n,t),e.set(t,n);try{switch(s){case $T:{if(n.size!==t.size)return!1;for(const[l,c]of n.entries())if(!t.has(l)||!Gp(c,t.get(l),l,n,t,e,i))return!1;return!0}case WT:{if(n.size!==t.size)return!1;const l=Array.from(n.values()),c=Array.from(t.values());for(let u=0;u<l.length;u++){const d=l[u],h=c.findIndex(f=>Gp(d,f,void 0,n,t,e,i));if(h===-1)return!1;c.splice(h,1)}return!0}case PM:case MM:case OM:case DM:case RM:case Vue:case LM:case FM:case NM:case Hue:case BM:case VM:{if(typeof Buffer<"u"&&Buffer.isBuffer(n)!==Buffer.isBuffer(t)||n.length!==t.length)return!1;for(let l=0;l<n.length;l++)if(!Gp(n[l],t[l],l,n,t,e,i))return!1;return!0}case UT:return n.byteLength!==t.byteLength?!1:ab(new Uint8Array(n),new Uint8Array(t),e,i);case jT:return n.byteLength!==t.byteLength||n.byteOffset!==t.byteOffset?!1:ab(new Uint8Array(n),new Uint8Array(t),e,i);case Bue:return n.name===t.name&&n.message===t.message;case ob:{if(!(ab(n.constructor,t.constructor,e,i)||kL(n)&&kL(t)))return!1;const c=[...Object.keys(n),...NE(n)],u=[...Object.keys(t),...NE(t)];if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++){const h=c[d],f=n[h];if(!Object.hasOwn(t,h))return!1;const p=t[h];if(!Gp(f,p,h,n,t,e,i))return!1}return!0}default:return!1}}finally{e.delete(n),e.delete(t)}}function K$(){}function IL(n,t){return q$(n,t,K$)}function rde(n){return typeof Buffer<"u"&&Buffer.isBuffer(n)}function ode(n){const t=n==null?void 0:n.constructor,e=typeof t=="function"?t.prototype:Object.prototype;return n===e}function zM(n){return HM(n)}function ade(n,t){if(n=Jue(n),n<1||!Number.isSafeInteger(n))return[];const e=new Array(n);for(let i=0;i<n;i++)e[i]=typeof t=="function"?t(i):i;return e}function lde(n){if(n==null)return[];switch(typeof n){case"object":case"function":return Pue(n)?ude(n):ode(n)?cde(n):BE(n);default:return BE(Object(n))}}function BE(n){const t=[];for(const e in n)t.push(e);return t}function cde(n){return BE(n).filter(e=>e!=="constructor")}function ude(n){const t=ade(n.length,i=>`${i}`),e=new Set(t);return rde(n)&&(e.add("offset"),e.add("parent")),zM(n)&&(e.add("buffer"),e.add("byteLength"),e.add("byteOffset")),[...t,...BE(n).filter(i=>!e.has(i))]}
310function X$(n,...t){for(let e=0;e<t.length;e++)dde(n,t[e]);return n}function dde(n,t){const e=lde(t);for(let i=0;i<e.length;i++){const s=e[i];(!(s in n)||!Bb(n[s],t[s]))&&(n[s]=t[s])}}function hde(n){if(My(n))return n;const t=pm(n);if(!fde(n))return{};if(tde(n)){const i=Array.from(n);return n.length>0&&typeof n[0]=="string"&&Object.hasOwn(n,"index")&&(i.index=n.index,i.input=n.input),i}if(zM(n)){const i=n,s=i.constructor;return new s(i.buffer,i.byteOffset,i.length)}if(t===UT)return new ArrayBuffer(n.byteLength);if(t===jT){const i=n,s=i.buffer,r=i.byteOffset,o=i.byteLength,a=new ArrayBuffer(o),l=new Uint8Array(s,r,o);return new Uint8Array(a).set(l),new DataView(a)}if(t===Dy||t===Oy||t===bm){const i=n.constructor,s=new i(n.valueOf());return t===bm?mde(s,n):lA(s,n),s}if(t===zT)return new Date(Number(n));if(t===VT){const i=n,s=new RegExp(i.source,i.flags);return s.lastIndex=i.lastIndex,s}if(t===HT)return Object(Symbol.prototype.valueOf.call(n));if(t===$T){const i=n,s=new Map;return i.forEach((r,o)=>{s.set(o,r)}),s}if(t===WT){const i=n,s=new Set;return i.forEach(r=>{s.add(r)}),s}if(t===wm){const i=n,s={};return lA(s,i),s.length=i.length,s[Symbol.iterator]=i[Symbol.iterator],s}const e={};return pde(e,n),lA(e,n),gde(e,n),e}function fde(n){switch(pm(n)){case wm:case PM:case UT:case jT:case Dy:case zT:case BM:case VM:case LM:case FM:case NM:case $T:case Oy:case ob:case VT:case WT:case bm:case HT:case MM:case OM:case DM:case RM:return!0;default:return!1}}function lA(n,t){for(const e in t)Object.hasOwn(t,e)&&(n[e]=t[e])}function gde(n,t){const e=Object.getOwnPropertySymbols(t);for(let i=0;i<e.length;i++){const s=e[i];Object.prototype.propertyIsEnumerable.call(t,s)&&(n[s]=t[s])}}function mde(n,t){const e=t.valueOf().length;for(const i in t)Object.hasOwn(t,i)&&(Number.isNaN(Number(i))||Number(i)>=e)&&(n[i]=t[i])}function pde(n,t){const e=Object.getPrototypeOf(t);e!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(n,e)}function Yo(n){var e;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!((e=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&e.writable)?!1:n.toString()===`[object ${i}]`}let t=n;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t}function bde(n,t){const e={},i=Object.keys(n);for(let s=0;s<i.length;s++){const r=i[s],o=n[r];e[r]=t(o,r,n)}return e}function wde(n,t=z$){return n==null?{}:bde(n,que(t))}function vde(n){if(My(n))return n;if(Array.isArray(n)||HM(n)||n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer)return n.slice(0);const t=Object.getPrototypeOf(n),e=t.constructor;if(n instanceof Date||n instanceof Map||n instanceof Set)return new e(n);if(n instanceof RegExp){const i=new e(n);return i.lastIndex=n.lastIndex,i}if(n instanceof DataView)return new e(n.buffer.slice(0));if(n instanceof Error){const i=new e(n.message);return i.stack=n.stack,i.name=n.name,i.cause=n.cause,i}if(typeof File<"u"&&n instanceof File)return new e([n],n.name,{type:n.type,lastModified:n.lastModified});if(typeof n=="object"){const i=Object.create(t);return Object.assign(i,n)}return n}function yde(n,...t){const e=t.slice(0,-1),i=t[t.length-1];let s=n;for(let r=0;r<e.length;r++){const o=e[r];s=z0(s,o,i,new Map)}return s}function z0(n,t,e,i){if(My(n)&&(n=Object(n)),t==null||typeof t!="object")return n;if(i.has(t))return vde(i.get(t));if(i.set(t,n),Array.isArray(t)){t=t.slice();for(let r=0;r<t.length;r++)t[r]=t[r]??void 0}const s=[...Object.keys(t),...NE(t)];for(let r=0;r<s.length;r++){const o=s[r];if(Nb(o))continue;let a=t[o],l=n[o];if(tI(a)&&(a={...a}),tI(l)&&(l={...l}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=_s(a)),Array.isArray(a))if(typeof l=="object"&&l!=null){const u=[],d=Reflect.ownKeys(l);for(let h=0;h<d.length;h++){const f=d[h];u[f]=l[f]}l=u}else l=[];const c=e(l,a,o,n,t,i);c!=null?n[o]=c:Array.isArray(a)||nI(l)&&nI(a)?n[o]=z0(l,a,e,i):l==null&&Yo(a)?n[o]=z0({},a,e,i):l==null&&zM(a)?n[o]=_s(a):(l===void 0||a!==void 0)&&(n[o]=a)}return n}function $M(n,...t){return yde(n,...t,K$)}function VE(n){return typeof n=="function"}function Wc(n){return nI(n)&&n.nodeType===1&&!Yo(n)}function PL(n,t){if(!Number.isInteger(n)||n<0)throw new Error("n must be a non-negative integer.");let e=0;return(...i)=>{if(++e>=n)return t(...i)}}function iI(n,t,e){return typeof e!="function"&&(e=()=>{}),q$(n,t,(...i)=>
310{const s=e(...i);if(s!==void 0)return!!s;if(n instanceof Map&&t instanceof Map||n instanceof Set&&t instanceof Set)return iI(Array.from(n),Array.from(t),PL(2,e))})}function _de(n){return n.substring(0,1).toUpperCase()+n.substring(1)}function Ede(n){return _de(Y$(n))}/** 311 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 312 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 313 *//** 314 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 315 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 316 */let Ie;try{Ie={window,document}}catch{/* istanbul ignore next -- @preserve */Ie={window:{},document:{}}}function Sde(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const gu=Sde(),Ge={isMac:J$(gu),isWindows:Tde(gu),isGecko:xde(gu),isSafari:Ade(gu),isiOS:Cde(gu),isAndroid:kde(gu),isBlink:Ide(gu),get isMediaForcedColors(){return Mde()},get isMotionReduced(){return Ode()},features:{isRegExpUnicodePropertySupported:Pde()}};function J$(n){return n.indexOf("macintosh")>-1}function Tde(n){return n.indexOf("windows")>-1}function xde(n){return!!n.match(/gecko\/\d+/)}function Ade(n){return n.indexOf(" applewebkit/")>-1&&n.indexOf("chrome")===-1}function Cde(n){return!!n.match(/iphone|ipad/i)||J$(n)&&navigator.maxTouchPoints>0}function kde(n){return n.indexOf("android")>-1}function Ide(n){return n.indexOf("chrome/")>-1&&n.indexOf("edge/")<0}function Pde(){let n=!1;try{n="Ä".search(new RegExp("[\\p{L}]","u"))===0}catch{}return n}function Mde(){return Ie.window.matchMedia?Ie.window.matchMedia("(forced-colors: active)").matches:!1}function Ode(){return Ie.window.matchMedia?Ie.window.matchMedia("(prefers-reduced-motion)").matches:!1}/** 317 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 318 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 319 */function Z$(n,t,e,i){e=e||function(l,c){return l===c};const s=Array.isArray(n)?n:Array.prototype.slice.call(n),r=Array.isArray(t)?t:Array.prototype.slice.call(t),o=Dde(s,r,e);return i?Lde(o,r.length):Rde(r,o)}function Dde(n,t,e){const i=ML(n,t,e);if(i===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=OL(n,i),r=OL(t,i),o=ML(s,r,e),a=n.length-o,l=t.length-o;return{firstIndex:i,lastIndexOld:a,lastIndexNew:l}}function ML(n,t,e){for(let i=0;i<Math.max(n.length,t.length);i++)if(n[i]===void 0||t[i]===void 0||!e(n[i],t[i]))return i;return-1}function OL(n,t){return n.slice(t).reverse()}function Rde(n,t){const e=[],{firstIndex:i,lastIndexOld:s,lastIndexNew:r}=t;return r-i>0&&e.push({index:i,type:"insert",values:n.slice(i,r)}),s-i>0&&e.push({index:i+(r-i),type:"delete",howMany:s-i}),e}function Lde(n,t){const{firstIndex:e,lastIndexOld:i,lastIndexNew:s}=n;if(e===-1)return Array(t).fill("equal");let r=[];return e>0&&(r=r.concat(Array(e).fill("equal"))),s-e>0&&(r=r.concat(Array(s-e).fill("insert"))),i-e>0&&(r=r.concat(Array(i-e).fill("delete"))),s<t&&(r=r.concat(Array(t-s).fill("equal"))),r}function kf(n,t,e){e=e||function(v,E){return v===E};const i=n.length,s=t.length;if(i>200||s>200||i+s>300)return kf.fastDiff(n,t,e,!0);let r,o;if(s<i){const v=n;n=t,t=v,r="delete",o="insert"}else r="insert",o="delete";const a=n.length,l=t.length,c=l-a,u={},d={};function h(v){const E=(d[v-1]!==void 0?d[v-1]:-1)+1,x=d[v+1]!==void 0?d[v+1]:-1,A=E>x?-1:1;u[v+A]&&(u[v]=u[v+A].slice(0)),u[v]||(u[v]=[]),u[v].push(E>x?r:o);let O=Math.max(E,x),I=O-v;for(;I<a&&O<l&&e(n[I],t[O]);)I++,O++,u[v].push("equal");return O}let f=0,p;do{for(p=-f;p<c;p++)d[p]=h(p);for(p=c+f;p>c;p--)d[p]=h(p);d[c]=h(c),f++}while(d[c]!==l);return u[c].slice(1)}kf.fastDiff=Z$;/** 320 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 321 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 322 */function DL(){return function n(){n.called=!0}}class bl{constructor(t,e){y(this,"source");y(this,"name");y(this,"path");y(this,"stop");y(this,"off");y(this,"return");this.source=t,this.name=e,this.path=[],this.stop=DL(),this.off=DL()}}/** 323 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 324 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 325 */const Ai=new Array(256).fill("").map((n,t)=>("0"+t.toString(16)).slice(-2));function is(){const[n,t,e,i]=crypto.getRandomValues(new Uint32Array(4));return"e"+Ai[n>>0&255]+Ai[n>>8&255]+Ai[n>>16&255]+Ai[n>>24&255]+Ai[t>>0&255]+Ai[t>>8&255]+Ai[t>>16&255]+Ai[t>>24&255]+Ai[e>>0&255]+Ai[e>>8&255]+Ai[e>>16&255]+Ai[e>>24&255]+Ai[i>>0&255]+Ai[i>>8&255]+Ai[i>>16&255]+Ai[i>>24&255]}/** 326 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 327 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 328 */const Dc={get(n="normal"){return typeof n!="number"?this[n]||this.normal:n},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function Fde(n,t){const e=Dc.get(t.priority);let i=0,s=n.length;for(;i<s;){const r=i+s>>1;Dc.get(n[r].priority)<e?s=r:i=r+1}n.splice(i,0,t)}/** 329 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 330 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 331 */const Nde="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";
331class ee extends Error{constructor(e,i,s,r){super(Vde(e,s,r));y(this,"context");y(this,"data");this.name="CKEditorError",this.context=i,this.data=s,r&&(this.stack=r.stack)}is(e){return e==="CKEditorError"}static rethrowUnexpectedError(e,i){throw e.is&&e.is("CKEditorError")?e:new ee("unexpected-error",i,void 0,e)}}function Dt(n,t){console.warn(...eW(n,t))}function Bde(n,t){console.error(...eW(n,t))}function Q$(n){return` 332Read more: ${Nde}#error-${n}`}function Vde(n,t,e){const i=new WeakSet,r=t?` ${JSON.stringify(t,(l,c)=>{if(typeof c=="object"&&c!==null){if(i.has(c))return`[object ${c.constructor.name}]`;i.add(c)}return c})}`:"",o=Q$(n),a=e?` 333Original error: ${e.name}: ${e.message}`:"";return n+r+o+a}function eW(n,t){const e=Q$(n);return t?[n,t,e]:[n,e]}const Hde="47.4.0",zde=new Date(2026,0,14);/* istanbul ignore next -- @preserve */if(globalThis.CKEDITOR_VERSION)throw new ee("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=Hde;const nf=Symbol("listeningTo"),sI=Symbol("emitterId"),ca=Symbol("delegations"),$de=Gt(Object);function Gt(n){if(!n)return $de;class t extends n{on(i,s,r){this.listenTo(this,i,s,r)}once(i,s,r){let o=!1;const a=(l,...c)=>{o||(o=!0,l.off(),s.call(this,l,...c))};this.listenTo(this,i,a,r)}off(i,s){this.stopListening(this,i,s)}listenTo(i,s,r,o={}){let a,l;this[nf]||(this[nf]={});const c=this[nf];cA(i)||tW(i);const u=cA(i);(a=c[u])||(a=c[u]={emitter:i,callbacks:{}}),(l=a.callbacks[s])||(l=a.callbacks[s]=[]),l.push(r),Yde(this,i,s,r,o)}stopListening(i,s,r){const o=this[nf];let a=i&&cA(i);const l=o&&a?o[a]:void 0,c=l&&s?l.callbacks[s]:void 0;if(!(!o||i&&!l||s&&!c))if(r)uA(this,i,s,r),c.indexOf(r)!==-1&&(c.length===1?delete l.callbacks[s]:uA(this,i,s,r));else if(c){for(;r=c.pop();)uA(this,i,s,r);delete l.callbacks[s]}else if(l){for(s in l.callbacks)this.stopListening(i,s);delete o[a]}else{for(a in o)this.stopListening(o[a].emitter);delete this[nf]}}fire(i,...s){try{const r=i instanceof bl?i:new bl(this,i),o=r.name;let a=Gde(this,o);if(r.path.push(this),a){a=a.slice();for(let c=0;c<a.length;c++){const u=a[c].callback;if(u.call(this,r,...s),r.off.called&&(delete r.off.called,this._removeEventListener(o,u)),r.stop.called)break}}const l=this[ca];if(l){const c=l.get(o),u=l.get("*");c&&RL(c,r,s),u&&RL(u,r,s)}return r.return}catch(r){/* istanbul ignore next -- @preserve */ee.rethrowUnexpectedError(r,this)}}delegate(...i){return{to:(s,r)=>
333{this[ca]||(this[ca]=new Map),i.forEach(o=>{const a=this[ca].get(o);a?a.set(s,r):this[ca].set(o,new Map([[s,r]]))})}}}stopDelegating(i,s){if(this[ca])if(!i)this[ca].clear();else if(!s)this[ca].delete(i);else{const r=this[ca].get(i);r&&r.delete(s)}}_addEventListener(i,s,r){jde(this,i);const o=rI(this,i),a=Dc.get(r.priority),l={callback:s,priority:a};for(const c of o)Fde(c,l)}_removeEventListener(i,s){const r=rI(this,i);for(const o of r)for(let a=0;a<o.length;a++)o[a].callback==s&&(o.splice(a,1),a--)}}return t}function Wde(n,t){const e=n[nf];return e&&e[t]?e[t].emitter:null}function tW(n,t){n[sI]||(n[sI]=t||is())}function cA(n){return n[sI]}function nW(n){return n._events||Object.defineProperty(n,"_events",{value:{}}),n._events}function Ude(){return{callbacks:[],childEvents:[]}}function jde(n,t){const e=nW(n);if(e[t])return;let i=t,s=null;const r=[];for(;i!==""&&!e[i];)e[i]=Ude(),r.push(e[i]),s&&e[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(i!==""){for(const o of r)o.callbacks=e[i].callbacks.slice();e[i].childEvents.push(s)}}function rI(n,t){const e=nW(n)[t];if(!e)return[];let i=[e.callbacks];for(let s=0;s<e.childEvents.length;s++){const r=rI(n,e.childEvents[s]);i=i.concat(r)}return i}function Gde(n,t){if(!n._events)return null;let e=t;do{const i=n._events[e];if(i&&i.callbacks&&i.callbacks.length)return i.callbacks;const s=e.lastIndexOf(":");e=s>-1?e.substring(0,s):""}while(e);return null}function RL(n,t,e){for(let[i,s]of n){s?typeof s=="function"&&(s=s(t.name)):s=t.name;const r=new bl(t.source,s);r.path=[...t.path],i.fire(r,...e)}}function Yde(n,t,e,i,s){t._addEventListener?t._addEventListener(e,i,s):n._addEventListener.call(t,e,i,s)}function uA(n,t,e,i){t._removeEventListener?t._removeEventListener(e,i):n._removeEventListener.call(t,e,i)}const lb=Symbol("observableProperties"),Hb=Symbol("boundObservables"),cb=Symbol("boundProperties"),mu=Symbol("decoratedMethods"),LL=Symbol("decoratedOriginal"),qde=Ut(Gt());function Ut(n){var e,i,s,r;if(!n)return qde;class t extends n{constructor(){super(...arguments);y(this,e);y(this,i);y(this,s);y(this,r)}set(l,c){if(ys(l)){Object.keys(l).forEach(d=>{this.set(d,l[d])},this);return}dA(this);const u=this[lb];if(l in this&&!u.has(l))throw new ee("observable-set-cannot-override",this);Object.defineProperty(this,l,{enumerable:!0,configurable:!0,get(){return u.get(l)},set(d){const h=u.get(l);let f=this.fire(`set:${l}`,l,d,h);f===void 0&&(f=d),(h!==f||!u.has(l))&&(u.set(l,f),this.fire(`change:${l}`,l,f,h))}}),this[l]=c}bind(...l){if(!l.length||!FL(l))throw new ee("observable-bind-wrong-properties",this);if(new Set(l).size!==l.length)throw new ee("observable-bind-duplicate-properties",this);dA(this);const c=this[cb];l.forEach(d=>{if(c.has(d))throw new ee("observable-bind-rebind",this)});const u=new Map;return l.forEach(d=>{const h={property:d,to:[]};c.set(d,h),u.set(d,h)}),{to:Kde,toMany:Xde,_observable:this,_bindProperties:l,_to:[],_bindings:u}}unbind(...l){if(!this[lb])return;const c=this[cb],u=this[Hb];if(l.length){if(!FL(l))throw new ee("observable-unbind-wrong-properties",this);l.forEach(d=>{const h=c.get(d);h&&(h.to.forEach(([f,p])=>{const v=u.get(f),E=v[p];E.delete(h),E.size||delete v[p],Object.keys(v).length||(u.delete(f),this.stopListening(f,"change"))}),c.delete(d))})}else u.forEach((d,h)=>{this.stopListening(h,"change")}),u.clear(),c.clear()}decorate(l){dA(this);const c=this[l];if(!c)throw new ee("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:l});this.on(l,(u,d)=>{u.return=c.apply(this,d)}),this[l]=function(...u){return this.fire(l,u)},this[l][LL]=c,this[mu]||(this[mu]=[]),this[mu].push(l)}stopListening(l,c,u){if(!l&&this[mu]){for(const d of this[mu])this[d]=this[d][LL];delete this[mu]}super.stopListening(l,c,u)}}return e=lb,i=mu,s=cb,r=Hb,t}function dA(n){n[lb]||(Object.defineProperty(n,lb,{value:new Map}),Object.defineProperty(n,Hb,{value:new Map}),Object.defineProperty(n,cb,{value:new Map}))}function Kde(...n){const t=Zde(...n),e=Array.from(this._bindings.keys()),i=e.length;if(!t.callback&&t.to.length>1)throw new ee("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new ee("observable-bind-to-extra-callback",this);t.to.forEach(s=>{if(s.properties.length&&s.properties.length!==i)throw new ee("observable-bind-to-properties-length",this);s.properties.length||(s.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(e[0]).callback=t.callback),the(this._observable,this._to),ehe(this),this._bindProperties.forEac
333h(s=>{iW(this._observable,s)})}function Xde(n,t,e){if(this._bindings.size>1)throw new ee("observable-bind-to-many-not-one-binding",this);this.to(...Jde(n,t),e)}function Jde(n,t){const e=n.map(i=>[i,t]);return Array.prototype.concat.apply([],e)}function FL(n){return n.every(t=>typeof t=="string")}function Zde(...n){if(!n.length)throw new ee("observable-bind-to-parse-error",null);const t={to:[]};let e;return typeof n[n.length-1]=="function"&&(t.callback=n.pop()),n.forEach(i=>{if(typeof i=="string")e.properties.push(i);else if(typeof i=="object")e={observable:i,properties:[]},t.to.push(e);else throw new ee("observable-bind-to-parse-error",null)}),t}function Qde(n,t,e,i){const s=n[Hb],r=s.get(e),o=r||{};o[i]||(o[i]=new Set),o[i].add(t),r||s.set(e,o)}function ehe(n){let t;n._bindings.forEach((e,i)=>{n._to.forEach(s=>{t=s.properties[e.callback?0:n._bindProperties.indexOf(i)],e.to.push([s.observable,t]),Qde(n._observable,e,s.observable,t)})})}function iW(n,t){const i=n[cb].get(t);let s;i.callback?s=i.callback.apply(n,i.to.map(r=>r[0][r[1]])):(s=i.to[0],s=s[0][s[1]]),Object.prototype.hasOwnProperty.call(n,t)?n[t]=s:n.set(t,s)}function the(n,t){t.forEach(e=>{const i=n[Hb];let s;i.get(e.observable)||n.listenTo(e.observable,"change",(r,o)=>{s=i.get(e.observable)[o],s&&s.forEach(a=>{iW(n,a.property)})})})}/** 334 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 335 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 336 */class nhe{constructor(){y(this,"_replacedElements");this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}/** 337 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 338 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 339 */function oI(n){let t=0;for(const e of n)t++;return t}/** 340 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 341 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 342 */function li(n,t){const e=Math.min(n.length,t.length);for(let i=0;i<e;i++)if(n[i]!=t[i])return i;return n.length==t.length?"same":n.length<t.length?"prefix":"extension"}/** 343 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 344 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 345 */function qs(n){return!!(n&&n[Symbol.iterator])}function Rr(n,t,e={},i=[]){const s=e&&e.xmlns,r=s?n.createElementNS(s,t):n.createElement(t);for(const o in e)r.setAttribute(o,e[o]);(CL(i)||!qs(i))&&(i=[i]);for(let o of i)CL(o)&&(o=n.createTextNode(o)),r.appendChild(o);return r}class sW{constructor(t,e){y(this,"_config");this._config=Object.create(null),e&&this.define(NL(e)),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}*names(){for(const t of Object.keys(this._config))yield t}_setToTarget(t,e,i,s=!1){if(Yo(e)){this._setObjectToTarget(t,e,s);return}const r=e.split(".");e=r.pop();for(const o of r)Yo(t[o])||(t[o]=Object.create(null)),t=t[o];if(Yo(i)){Yo(t[e])||(t[e]=Object.create(null)),t=t[e],this._setObjectToTarget(t,i,s);return}s&&typeof t[e]<"u"||(t[e]=i)}_getFromSource(t,e){const i=e.split(".");e=i.pop();for(const s of i){if(!Yo(t[s])){t=null;break}t=t[s]}return t?NL(t[e]):void 0}_setObjectToTarget(t,e,i){Object.keys(e).forEach(s=>{this._setToTarget(t,s,e[s],i)})}}function NL(n){return GT(n,ihe)}function ihe(n){return Wc(n)||typeof n=="function"?n:void 0}/** 346 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 347 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 348 */function Uc(n){if(n){if(n.defaultView)return n instanceof n.defaultView.Document;if(n.ownerDocument&&n.ownerDocument.defaultView)return n instanceof n.ownerDocument.defaultView.Node}return!1}/** 349 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 350 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 351 */function HE(n){const t=Object.prototype.toString.apply(n);return t=="[object Window]"||t=="[object global]"}const she=Qs(Gt());function Qs(n){if(!n)return she;class t extends n{listenTo(i,s,r,o={}){if(Uc(i)||HE(i)||i instanceof Ie.window.EventTarget){const a={capture:!!o.useCapture,passive:!!o.usePassive},l=this._getProxyEmitter(i,a)||new rhe(i,a);this.listenTo(l,s,r,o)}else super.listenTo(i,s,r,o)}stopListening(i,s,r){if(Uc(i)||HE(i)||i instanceof Ie.window.EventTarget){const o=this._getAllProxyEmitters(i);for(const a of o)this.stopListening(a,s,r)}else super.stopListening(i,s,r)}_getProxyEmitter(i,s){return Wde(this,rW(i,s))}_getAllProxyEmitters(i){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(s=>this._getProxyEmitter(i,s)).filter(s=>!!s)}}return t}class rhe extends Gt(){constructor(e,i){super();y(this,"_domNode");y(this,"_options");y(this,"_domListeners");
351tW(this,rW(e,i)),this._domNode=e,this._options=i}attach(e){if(this._domListeners&&this._domListeners[e])return;const i=this._createDomListener(e);this._domNode.addEventListener(e,i,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=i}detach(e){let i;this._domListeners[e]&&(!(i=this._events[e])||!i.callbacks.length)&&this._domListeners[e].removeListener()}_addEventListener(e,i,s){this.attach(e),Gt().prototype._addEventListener.call(this,e,i,s)}_removeEventListener(e,i){Gt().prototype._removeEventListener.call(this,e,i),this.detach(e)}_createDomListener(e){const i=s=>{this.fire(e,s)};return i.removeListener=()=>{this._domNode.removeEventListener(e,i,this._options),delete this._domListeners[e]},i}}function ohe(n){return n["data-ck-expando"]||(n["data-ck-expando"]=is())}function rW(n,t){let e=ohe(n);for(const i of Object.keys(t).sort())t[i]&&(e+="-"+i);return e}/** 352 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 353 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 354 */function ahe(n){const t=[];let e=n;for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}/** 355 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 356 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 357 */function lhe(n){return n instanceof HTMLTextAreaElement?n.value:n.innerHTML}/** 358 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 359 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 360 */function oW(n){const t=n.ownerDocument.defaultView.getComputedStyle(n);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}/** 361 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 362 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 363 */function aW(n){if(!n.target)return null;const t=n.target.ownerDocument,e=n.clientX,i=n.clientY;let s=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(e,i)?s=t.caretRangeFromPoint(e,i):n.rangeParent&&(s=t.createRange(),s.setStart(n.rangeParent,n.rangeOffset),s.collapse(!0)),s}function lW(n){return!n||!n.parentNode||n.offsetParent===Ie.document.body?null:n.offsetParent}/** 364 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 365 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 366 */function mn(n){return Object.prototype.toString.call(n)=="[object Text]"}/** 367 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 368 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 369 */function YT(n){return Object.prototype.toString.apply(n)=="[object Range]"}const cW=["top","right","bottom","left","width","height"];class tt{constructor(t){y(this,"top");y(this,"right");y(this,"bottom");y(this,"left");y(this,"width");y(this,"height");y(this,"_source");const e=YT(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),aI(t)||e)if(e){const i=tt.getDomRangeRects(t);I_(this,tt.getBoundingRect(i))}else I_(this,t.getBoundingClientRect());else if(HE(t)){const{innerWidth:i,innerHeight:s}=t;I_(this,{top:0,right:i,bottom:s,left:0,width:i,height:s})}else I_(this,t)}clone(){return new tt(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};if(e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0)return null;{const i=new tt(e);return i._source=this._source,i}}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(BL(t))return e;let i=t,s=t.parentNode||t.commonAncestorContainer,r;for(;s&&!BL(s);){const o=che(s)==="visible";i instanceof HTMLElement&&VL(i)==="absolute"&&(r=i);const a=VL(s);if(o||r&&(a==="relative"&&o||a!=="relative")){i=s,s=s.parentNode;continue}const l=new tt(s),c=e.getIntersection(l);if(c)c.getArea()<e.getArea()&&(e=c);else return null;i=s,s=s.parentNode}return e}isEqual(t){for(const e of cW)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!!(e&&e.isEqual(t))}toAbsoluteRect(){const{scrollX:t,scrollY:e}=Ie.window,i=this.clone().moveBy(t,e);if(aI(i._source)){const s=lW(i._source);s&&uhe(i,s)}return i}excludeScrollbarsAndBorders(){const t=this._source;let e,i,s;if(HE(t))e=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHe
369ight-t.document.documentElement.clientHeight,s=t.getComputedStyle(t.document.documentElement).direction;else{const r=oW(t);e=t.offsetWidth-t.clientWidth-r.left-r.right,i=t.offsetHeight-t.clientHeight-r.top-r.bottom,s=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=r.left,this.top+=r.top,this.right-=r.right,this.bottom-=r.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,s==="ltr"?this.right-=e:this.left+=e,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const e=[],i=Array.from(t.getClientRects());if(i.length)for(const s of i)e.push(new tt(s));else{let s=t.startContainer;mn(s)&&(s=s.parentNode);const r=new tt(s.getBoundingClientRect());r.right=r.left,r.width=0,e.push(r)}return e}static getBoundingRect(t){const e={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const s of t)i++,e.left=Math.min(e.left,s.left),e.top=Math.min(e.top,s.top),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom);return i==0?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new tt(e))}}function I_(n,t){for(const e of cW)n[e]=t[e]}function BL(n){return aI(n)?n===n.ownerDocument.body:!1}function aI(n){return n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.getBoundingClientRect=="function"}function VL(n){return n instanceof HTMLElement?n.ownerDocument.defaultView.getComputedStyle(n).position:"static"}function che(n){return n instanceof HTMLElement?n.ownerDocument.defaultView.getComputedStyle(n).overflow:"visible"}function uhe(n,t){const e=new tt(t),i=oW(t);let s=0,r=0;s-=e.left,r-=e.top,s+=t.scrollLeft,r+=t.scrollTop,s-=i.left,r-=i.top,n.moveBy(s,r)}var Zt;let WM=(Zt=class{constructor(t,e){y(this,"_element");y(this,"_callback");Zt._observerInstance||Zt._createObserver(),this._element=t,this._callback=e,Zt._addElementCallback(t,e),Zt._observerInstance.observe(t)}get element(){return this._element}destroy(){Zt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){Zt._elementCallbacks||(Zt._elementCallbacks=new Map);let i=Zt._elementCallbacks.get(t);i||(i=new Set,Zt._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=Zt._getElementCallbacks(t);i&&(i.delete(e),i.size||(Zt._elementCallbacks.delete(t),Zt._observerInstance.unobserve(t))),Zt._elementCallbacks&&!Zt._elementCallbacks.size&&(Zt._observerInstance=null,Zt._elementCallbacks=null)}static _getElementCallbacks(t){return Zt._elementCallbacks?Zt._elementCallbacks.get(t):null}static _createObserver(){Zt._observerInstance=new Ie.window.ResizeObserver(t=>{for(const e of t){const i=Zt._getElementCallbacks(e.target);if(i)for(const s of i)s(e)}})}},y(Zt,"_observerInstance",null),y(Zt,"_elementCallbacks",null),Zt);/** 370 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 371 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 372 */function HL(n,t){n instanceof HTMLTextAreaElement&&(n.value=t),n.innerHTML=t}/** 373 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 374 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 375 */function Ry(n){return t=>t+n}/** 376 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 377 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 378 */function hf(n){let t=0;for(;n.previousSibling;)n=n.previousSibling,t++;return t}/** 379 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 380 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 381 */function uW(n,t,e){n.insertBefore(e,n.childNodes[t]||null)}/** 382 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 383 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 384 */function ub(n){return n&&n.nodeType===Node.COMMENT_NODE}function dhe(n){try{Ie.document.createAttribute(n)}catch{return!1}return!0}function wl(n){return n?mn(n)?wl(n.parentElement):n.getClientRects?!!n.getClientRects().length:!1:!1}function UM({element:n,target:t,positions:e,limiter:i,fitInViewport:s,viewportOffsetConfig:r}){VE(t)&&(t=t()),VE(i)&&(i=i());const o=lW(n),a=dW(r),l=new tt(n),c=zL(t,a);let u;if(!c||!a.getIntersection(c))return null;const d={targetRect:c,elementRect:l,positionedElementAncestor:o,viewportRect:a};if(!i&&!s)u=new hW(e[0],d);else{if(i){const h=zL(i,a);h&&(d.limiterRect=h)}u=hhe(e,d)}return u}function zL(n,t){const e=new tt(n).getVisible();return e?e.getIntersection(t):null}function dW(n){n=Object.assign({top:0,bottom:0,left:0,right:0},n);const t=new tt(Ie.window);return t.top+=n.top,t.height-=n.top,t.bottom-=n.bottom,t.height-=n.bottom,t.left+=n.left,t.right-=n.right,t.width-=n.left+n.right,t}function hhe(n,t){const{elementRect:e}=t,i=e.getArea(),s=n.map(a=>new hW(a,t)).filter(a=>!!a.name);let r=0,o=null;for(const a of s){const{limiterIntersectionArea:l,viewportIntersectionArea:c}=a;if(l===i)return a;const u=c**2+l**2;u>r&&(r=u,o=a)}return o}
384class hW{constructor(t,e){y(this,"name");y(this,"config");y(this,"_positioningFunctionCoordinates");y(this,"_options");y(this,"_cachedRect");y(this,"_cachedAbsoluteRect");const i=t(e.targetRect,e.elementRect,e.viewportRect,e.limiterRect);if(!i)return;const{left:s,top:r,name:o,config:a}=i;this.name=o,this.config=a,this._positioningFunctionCoordinates={left:s,top:r},this._options=e}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const t=this._options.limiterRect;return t?t.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}}/** 385 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 386 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 387 */function $L(n){const t=n.parentNode;t&&t.removeChild(n)}function $0(){const n=Ie.window.visualViewport;if(!n||!(Ge.isiOS||Ge.isSafari))return{left:0,top:0};const t=Math.max(Math.round(n.offsetLeft),0),e=Math.max(Math.round(n.offsetTop),0);return{left:t,top:e}}function fhe({target:n,viewportOffset:t=0,ancestorOffset:e=0,alignToTop:i,forceScroll:s}){const r=jM(n);let o=r,a=null;for(t=phe(t);o;){let l;o==r?l=WL(n):l=WL(a),mhe({parent:l,getRect:()=>hA(n,o),alignToTop:i,ancestorOffset:e,forceScroll:s});let c=hA(n,o);const u=hA(l,o);if(c.height>u.height){const d=c.getIntersection(u);d&&(c=d)}if(ghe({window:o,rect:c,viewportOffset:t,alignToTop:i,forceScroll:s}),o.parent!=o){if(a=o.frameElement,o=o.parent,!a)return}else o=null}}function ghe({window:n,rect:t,alignToTop:e,forceScroll:i,viewportOffset:s}){const r=t.clone().moveBy(0,s.bottom),o=t.clone().moveBy(0,-s.top),a=new tt(n).excludeScrollbarsAndBorders(),l=[o,r],c=e&&i,u=l.every(v=>a.contains(v));let{scrollX:d,scrollY:h}=n;const f=d,p=h;c?h-=a.top-t.top+s.top:u||(gW(o,a)?h-=a.top-t.top+s.top:fW(r,a)&&(e?h+=t.top-a.top-s.top:h+=t.bottom-a.bottom+s.bottom)),u||(mW(t,a)?d-=a.left-t.left+s.left:pW(t,a)&&(d+=t.right-a.right+s.right)),(d!=f||h!==p)&&n.scrollTo(d,h)}function mhe({parent:n,getRect:t,alignToTop:e,forceScroll:i,ancestorOffset:s=0,limiterElement:r}){const o=jM(n),a=e&&i;let l,c,u;const d=r||o.document.body;for(;n!=d;)c=t(),l=new tt(n).excludeScrollbarsAndBorders(),u=l.contains(c),a?n.scrollTop-=l.top-c.top+s:u||(gW(c,l)?n.scrollTop-=l.top-c.top+s:fW(c,l)&&(e?n.scrollTop+=c.top-l.top-s:n.scrollTop+=c.bottom-l.bottom+s)),u||(mW(c,l)?n.scrollLeft-=l.left-c.left+s:pW(c,l)&&(n.scrollLeft+=c.right-l.right+s)),n=n.parentNode}function fW(n,t){return n.bottom>t.bottom}function gW(n,t){return n.top<t.top}function mW(n,t){return n.left<t.left}function pW(n,t){return n.right>t.right}function jM(n){return YT(n)?n.startContainer.ownerDocument.defaultView:n.ownerDocument.defaultView}function WL(n){if(YT(n)){let t=n.commonAncestorContainer;return mn(t)&&(t=t.parentNode),t}else return n.parentNode}function hA(n,t){const e=jM(n),i=new tt(n);if(e===t)return i;{let s=e;for(;s!=t;){const r=s.frameElement,o=new tt(r).excludeScrollbarsAndBorders();i.moveBy(o.left,o.top),s=s.parent}}return i}function phe(n){return typeof n=="number"?{top:n,bottom:n,left:n,right:n}:n}const bhe={ctrl:"â",cmd:"â",alt:"â¥",shift:"â§"},whe={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},UL={37:"â",38:"â",39:"â",40:"â",9:"â¥",33:"Page Up",34:"Page Down"},ft=She(),vhe=Object.fromEntries(Object.entries(ft).map(([n,t])=>{let e;return t in UL?e=UL[t]:e=n.charAt(0).toUpperCase()+n.slice(1),[t,e]}));function vm(n){let t;if(typeof n=="string"){if(t=ft[n.toLowerCase()],!t)throw new ee("keyboard-unknown-key",null,{key:n})}else t=n.keyCode+(n.altKey?ft.alt:0)+(n.ctrlKey?ft.ctrl:0)+(n.shiftKey?ft.shift:0)+(n.metaKey?ft.cmd:0);return t}function GM(n){return typeof n=="string"&&(n=The(n)),n.map(t=>typeof t=="string"?_he(t):t).reduce((t,e)=>e+t,0)}function zE(n,t){let e=GM(n);const i=t?t==="Mac":Ge.isMac||Ge.isiOS;return Object.entries(i?bhe:whe).reduce((o,[a,l])=>(e&ft[a]&&(e&=~ft[a],o+=l),o),"")+(e?vhe[e]:"")}function yhe(n){return n==ft.arrowright||n==ft.arrowleft||n==ft.arrowup||n==ft.arrowdown}function YM(n,t){const e=t==="ltr";switch(n){case ft.arrowleft:return e?"left":"right";case ft.arrowright:return e?"right":"left";case ft.arrowup:return"up";case ft.arrowdown:return"down"}}function _he(n){if(n.endsWith("!"))return vm(n.slice(0,-1));const t=vm(n);
387return(Ge.isMac||Ge.isiOS)&&t==ft.ctrl?ft.cmd:t}function Ehe(n,t){const e=YM(n,t);return e==="down"||e==="right"}function She(){const n={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){const e=String.fromCharCode(t);n[e.toLowerCase()]=t}for(let t=48;t<=57;t++)n[t-48]=t;for(let t=112;t<=123;t++)n["f"+(t-111)]=t;return Object.assign(n,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),n}function The(n){return n.split("+").map(t=>t.trim())}/** 388 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 389 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 390 */const xhe=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function jL(n){return xhe.includes(n)?"rtl":"ltr"}/** 391 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 392 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 393 */function bn(n){return Array.isArray(n)?n:[n]}/* istanbul ignore else -- @preserve */Ie.window.CKEDITOR_TRANSLATIONS||(Ie.window.CKEDITOR_TRANSLATIONS={});function Ahe(n,t,e=1,i){if(typeof e!="number")throw new ee("translation-service-quantity-not-a-number",null,{quantity:e});const s=i||Ie.window.CKEDITOR_TRANSLATIONS,r=Ihe(s);r===1&&(n=Object.keys(s)[0]);const o=t.id||t.string;if(r===0||!khe(n,o,s))return e!==1?t.plural:t.string;const a=s[n].dictionary,l=s[n].getPluralForm||(d=>d===1?0:1),c=a[o];if(typeof c=="string")return c;const u=Number(l(e));return c[u]}function Che(n){return Array.isArray(n)?n.reduce((t,e)=>$M(t,e)):n}function khe(n,t,e){return!!e[n]&&!!e[n].dictionary[t]}function Ihe(n){return Object.keys(n).length}class Phe{constructor({uiLanguage:t="en",contentLanguage:e,translations:i}={}){y(this,"uiLanguage");y(this,"uiLanguageDirection");y(this,"contentLanguage");y(this,"contentLanguageDirection");y(this,"t");y(this,"translations");this.uiLanguage=t,this.contentLanguage=e||this.uiLanguage,this.uiLanguageDirection=jL(this.uiLanguage),this.contentLanguageDirection=jL(this.contentLanguage),this.translations=Che(i),this.t=(s,r)=>this._t(s,r)}_t(t,e=[]){e=bn(e),typeof t=="string"&&(t={string:t});const s=!!t.plural?e[0]:1,r=Ahe(this.uiLanguage,t,s,this.translations);return Mhe(r,e)}}function Mhe(n,t){return n.replace(/%(\d+)/g,(e,i)=>i<t.length?t[i]:e)}class er extends Gt(){constructor(e={},i={}){super();y(this,"_items");y(this,"_itemMap");y(this,"_idProperty");y(this,"_bindToCollection");y(this,"_bindToExternalToInternalMap");y(this,"_bindToInternalToExternalMap");y(this,"_skippedIndexesFromExternal");const s=qs(e);if(s||(i=e),this._items=[],this._itemMap=new Map,this._idProperty=i.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],s)for(const r of e)this._items.push(r),this._itemMap.set(this._getItemIdBeforeAdding(r),r)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,i){return this.addMany([e],i)}addMany(e,i){if(i===void 0)i=this._items.length;else if(i>this._items.length||i<0)throw new ee("collection-add-item-invalid-index",this);let s=0;for(const r of e){const o=this._getItemIdBeforeAdding(r),a=i+s;this._items.splice(a,0,r),this._itemMap.set(o,r),this.fire("add",r,a),s++}return this.fire("change",{added:e,removed:[],index:i}),this}get(e){let i;if(typeof e=="string")i=this._itemMap.get(e);else if(typeof e=="number")i=this._items[e];else throw new ee("collection-get-invalid-arg",this);return i||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const i=this._idProperty,s=e[i];return s&&this._itemMap.has(s)}}getIndex(e){let i;return typeof e=="string"?i=this._itemMap.get(e):i=e,i?this._items.indexOf(i):-1}remove(e){const[i,s]=this._remove(e);return this.fire("change",{added:[],removed:[i],index:s}),i}map(e,i){return this._items.map(e,i)}
vendor: 4,807 bytes, lines 393-396
393forEach(e,i){this._items.forEach(e,i)}find(e,i){return this._items.find(e,i)}filter(e,i){return this._items.filter(e,i)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new ee("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:i=>{this._setUpBindToBinding(s=>new i(s))},using:i=>{typeof i=="function"?this._setUpBindToBinding(i):this._setUpBindToBinding(s=>s[i])}}}_setUpBindToBinding(e){const i=this._bindToCollection,s=(r,o,a)=>{const l=i._bindToCollection==this,c=i._bindToInternalToExternalMap.get(o);if(l&&c)this._bindToExternalToInternalMap.set(o,c),this._bindToInternalToExternalMap.set(c,o);else{const u=e(o);if(!u){this._skippedIndexesFromExternal.push(a);return}let d=a;for(const h of this._skippedIndexesFromExternal)a>h&&d--;for(const h of i._skippedIndexesFromExternal)d>=h&&d++;this._bindToExternalToInternalMap.set(o,u),this._bindToInternalToExternalMap.set(u,o),this.add(u,d);for(let h=0;h<i._skippedIndexesFromExternal.length;h++)d<=i._skippedIndexesFromExternal[h]&&i._skippedIndexesFromExternal[h]++}};for(const r of i)s(null,r,i.getIndex(r));this.listenTo(i,"add",s),this.listenTo(i,"remove",(r,o,a)=>{const l=this._bindToExternalToInternalMap.get(o);l&&this.remove(l),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((c,u)=>(a<u&&c.push(u-1),a>u&&c.push(u),c),[])})}_getItemIdBeforeAdding(e){const i=this._idProperty;let s;if(i in e){if(s=e[i],typeof s!="string")throw new ee("collection-add-invalid-id",this);if(this.get(s))throw new ee("collection-add-item-already-exists",this)}else e[i]=s=is();return s}_remove(e){let i,s,r,o=!1;const a=this._idProperty;if(typeof e=="string"?(s=e,r=this._itemMap.get(s),o=!r,r&&(i=this._items.indexOf(r))):typeof e=="number"?(i=e,r=this._items[i],o=!r,r&&(s=r[a])):(r=e,s=r[a],i=this._items.indexOf(r),o=i==-1||!this._itemMap.get(s)),o)throw new ee("collection-remove-404",this);this._items.splice(i,1),this._itemMap.delete(s);const l=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(l),this.fire("remove",r,i),[r,i]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}/** 394 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 395 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 396 */function $i(n){const t=n.next();return t.done?null:t.value}class fi extends Qs(Ut()){constructor(){super();y(this,"_elements",new Set);y(this,"_externalViews",new Set);y(this,"_blurTimeout",null);this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(YL(e))this._addElement(e);else if(GL(e))this._addView(e);else{if(!e.element)throw new ee("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){YL(e)?this._removeElement(e):GL(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new ee("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>{const i=this.externalViews.find(s=>Ohe(e,s));i?this._focus(i.element):this._focus(e)},{useCapture:!0}),this.listenTo(e,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()}),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){this.elements.find(s=>s.contains(document.activeElement))||this.externalViews.find(s=>s.focusTracker.isFocused&&!s.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function GL(n){return"focusTracker"in n&&n.focusTracker instanceof fi}function YL(n){return Wc(n)}function Ohe(n,t){return qL(n,t)?!0:!!t.focusTracker.externalViews.find(e=>qL(n,e))}function qL(n,t){return!!t.element&&t.element.contains(document.activeElement)&&n.c
396ontains(t.element)}class rs{constructor(){y(this,"_listener");this._listener=new(Qs())}listenTo(t){this._listener.listenTo(t,"keydown",(e,i)=>{this._listener.fire("_keydown:"+vm(i),i)})}set(t,e,i={}){const s=GM(t),r=i.priority;this._listener.listenTo(this._listener,"_keydown:"+s,(o,a)=>{i.filter&&!i.filter(a)||(e(a,()=>{a.preventDefault(),a.stopPropagation(),o.stop()}),o.return=!0)},{priority:r})}press(t){return!!this._listener.fire("_keydown:"+vm(t),t)}stopListening(t){this._listener.stopListening(t)}destroy(){this.stopListening()}}/** 397 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 398 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 399 */function Dhe(n){const t=new Map;for(const e in n)t.set(e,n[e]);return t}function Qo(n){return qs(n)?new Map(n):Dhe(n)}/** 400 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 401 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 402 */function KL(n,t,e){const i=n.length,s=t.length;for(let r=i-1;r>=e;r--)n[r+s]=n[r];for(let r=0;r<s;r++)n[e+r]=t[r]}/** 403 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 404 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 405 */function qM(n,t){let e;function i(...s){i.cancel(),e=setTimeout(()=>n(...s),t)}return i.cancel=()=>{clearTimeout(e)},i}/** 406 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 407 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 408 */function KM(n){try{if(!n.startsWith("ey"))return null;const t=atob(n.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}/** 409 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 410 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 411 */function Rhe(){const n=[];for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;n[t]=e}return n}function Lhe(n){const t=Array.isArray(n)?n:[n],e=Rhe();let i=-1;const s=t.map(r=>Array.isArray(r)?r.join(""):String(r)).join("");for(let r=0;r<s.length;r++){const o=s.charCodeAt(r);i=i>>>8^e[(i^o)&255]}return i=(i^-1)>>>0,i.toString(16).padStart(8,"0")}/** 412 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 413 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 414 */function Fhe(n){return!!n&&n.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(n)}function Nhe(n){return!!n&&n.length==1&&/[\ud800-\udbff]/.test(n)}function Bhe(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}function XM(n,t){return Nhe(n.charAt(t-1))&&Bhe(n.charAt(t))}function JM(n,t){return Fhe(n.charAt(t))}const Vhe=Hhe();function bW(n,t){const e=String(n).matchAll(Vhe);return Array.from(e).some(i=>i.index<t&&t<i.index+i[0].length)}function Hhe(){const n=[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u],t=/\p{Regional_Indicator}{2}/u.source,e="(?:"+n.map(s=>s.source).join("|")+")",i=`${t}|${e}(?:â${e})*`;return new RegExp(i,"ug")}function XL(n){if(!n)return null;const t=zhe(n);return t?KM(t):null}function zhe(n){const t=n.split(".");return t.length!=3?null:t[1]}/** 415 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 416 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 417 */function $he(n,t){return(n.removeFeatures||[]).includes(t)}/** 418 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 419 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 420 */const hp=new WeakMap;let JL=!1;function wW({view:n,element:t,text:e,isDirectHost:i=!0,keepOnFocus:s=!1}){const r=n.document;hp.has(r)||(hp.set(r,new Map),r.registerPostFixer(a=>fA(hp.get(r),a)),r.on("change:isComposing",()=>{n.change(a=>fA(hp.get(r),a))},{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",(a,l,c)=>o(c)),t.placeholder?o(t.placeholder):e&&o(e),e&&Yhe();function o(a){const l={text:a,isDirectHost:i,keepOnFocus:s,hostElement:i?t:null};hp.get(r).set(t,l),n.change(c=>fA([[t,l]],c))}}function Whe(n,t){return t.hasClass("ck-placeholder")?!1:(n.addClass("ck-placeholder",t),!0)}function vW(n,t){return t.hasClass("ck-placeholder")?(n.removeClass("ck-placeholder",t),!0):!1}function Uhe(n,t){if(!n.isAttached()||jhe(n))return!1;const e=n.document,s=e.selection.anchor;return e.isComposing&&s&&s.parent===n?!1:t||!e.isFocused?!0:!!s&&s.parent!==n}function jhe(n){for(const t of n.getChildren())if(!t.is("uiElement"))return!0;return!1}function fA(n,t){const e=[];let i=!1;for(const[s,r]of n)r.isDirectHost&&(e.push(s),ZL(t,s,r)&&(i=!0));for(const[s,r]of n){if(r.isDirectHost)continue;const o=Ghe(s);o!==r.hostElement&&r.hostElement&&(t.removeAttribute("data-placeholder",r.hostElement),vW(t,r.hostElement),r.hostElement=null,i=!0),o&&(e.includes(o)||(r.hostElement=o,ZL(t,s,r)&&(i=!0)))}return i}function ZL(n,t,e){const{text:i,isDirectHost:s,hostElement:r}=e;let o=!1;return r.getAttribute("data-placeholder")!==i&&(n.setAttribute("data-placeholder",i,r),o=!0),(s||t.childCount==1)&&Uhe(r,e.keepOnFocus)?Whe(n,r)&&(o=!0):vW(n,r)&&(o=!0),o}function Ghe(n){if(n.childCount){const t=n.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}function Yhe(){JL||Dt("enableViewPlaceholder-deprecated-text-option"),JL=!0}/** 421 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 422 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 423 */class xh{is(){throw new Error("is() method is abstract")}}class Ah extends Gt(xh){constructor(e){super();y(this,"document");y(this,"parent");this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new ee("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let i=this;for(;i.parent;)e.unshift(i.index),i=i.parent;return e}getAncestors(e={}){const i=[];let s=e.includeSelf?this:this.parent;for(;s;)i[e.parentFirst?"push":"unshift"](s),s=s.parent;return i}getCommonAncestor(e,i={}){const s=this.getAncestors(i),r=e.getAncestors(i);let o=0;for(;s[o]==r[o]&&s[o];)o++;return o===0?null:s[o-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const i=this.getPath(),s=e.getPath(),r=li(i,s);switch(r){case"prefix":return!0;case"extension":return!1;default:return i[r]<s[r]}}isAfter(e){return this==e||this.root!==e.root?!1:!this.isBefore(e)}_remove(){this.parent._removeChildren(this.index)}
423_fireChange(e,i,s){this.fire(`change:${e}`,i,s),this.parent&&this.parent._fireChange(e,i,s)}toJSON(){const e={path:this.getPath(),type:"Node"};return this!==this.root&&this.root.is("rootElement")&&(e.root=this.root.toJSON()),e}}Ah.prototype.is=function(n){return n==="node"||n==="view:node"};class zn extends Ah{constructor(e,i){super(e);y(this,"_textData");this._textData=i}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof zn?this===e||this.data===e.data:!1}toJSON(){const e=super.toJSON();return e.type="Text",e.data=this.data,e}_clone(){return new zn(this.document,this.data)}}zn.prototype.is=function(n){return n==="$text"||n==="view:$text"||n==="text"||n==="view:text"||n==="node"||n==="view:node"};class Sa extends xh{constructor(e,i,s){super();y(this,"textNode");y(this,"data");y(this,"offsetInText");if(this.textNode=e,i<0||i>e.data.length)throw new ee("view-textproxy-wrong-offsetintext",this);if(s<0||i+s>e.data.length)throw new ee("view-textproxy-wrong-length",this);this.data=e.data.substring(i,i+s),this.offsetInText=i}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const i=[];let s=e.includeSelf?this.textNode:this.parent;for(;s!==null;)i[e.parentFirst?"push":"unshift"](s),s=s.parent;return i}}Sa.prototype.is=function(n){return n==="$textProxy"||n==="view:$textProxy"||n==="textProxy"||n==="view:textProxy"};class $E{constructor(){y(this,"_consumables",new Map)}add(t,e){let i;if(t.is("$text")||t.is("documentFragment")){this._consumables.set(t,!0);return}this._consumables.has(t)?i=this._consumables.get(t):(i=new qhe(t),this._consumables.set(t,i)),i.add(e?Yp(e):t._getConsumables())}test(t,e){const i=this._consumables.get(t);return i===void 0?null:t.is("$text")||t.is("documentFragment")?i:i.test(Yp(e))}consume(t,e){if(t.is("$text")||t.is("documentFragment"))return this.test(t,e)?(this._consumables.set(t,!1),!0):!1;const i=this._consumables.get(t);return i===void 0?!1:i.consume(Yp(e))}revert(t,e){const i=this._consumables.get(t);i!==void 0&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(Yp(e)))}static createFrom(t,e){if(e||(e=new $E),t.is("$text"))e.add(t);else if(t.is("element")||t.is("documentFragment")){e.add(t);for(const i of t.getChildren())$E.createFrom(i,e)}return e}}class qhe{constructor(t){y(this,"element");y(this,"_canConsumeName",null);y(this,"_attributes",new Map);this.element=t}add(t){t.name&&(this._canConsumeName=!0);for(const[e,i]of t.attributes)if(i){let s=this._attributes.get(e);(!s||typeof s=="boolean")&&(s=new Map,this._attributes.set(e,s)),s.set(i,!0)}else{if(e=="style"||e=="class")throw new ee("viewconsumable-invalid-attribute",this);this._attributes.set(e,!0)}}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const[e,i]of t.attributes){const s=this._attributes.get(e);if(s===void 0)return null;if(s===!1)return!1;if(s!==!0){if(i){const r=s.get(i);if(r===void 0)return null;if(!r)return!1}else for(const r of s.values())if(!r)return!1}}return!0}consume(t){if(!this.test(t))return!1;t.name&&(this._canConsumeName=!1);for(const[e,i]of t.attributes){const s=this._attributes.get(e);if(typeof s=="boolean")for(const[r]of this.element._getConsumables(e,i).attributes)this._attributes.set(r,!1);else if(i)for(const[,r]of this.element._getConsumables(e,i).attributes)s.set(r,!1);else for(const r of s.keys())s.set(r,!1)}return!0}revert(t){t.name&&(this._canConsumeName=!0);for(const[e,i]of t.attributes){const s=this._attributes.get(e);if(s===!1){this._attributes.set(e,!0);continue}if(!(s===void 0||s===!0))if(i)s.get(i)===!1&&s.set(i,!0);else for(const r of s.keys())s.set(r,!0)}}}function Yp(n){const t=[];return"attributes"in n&&n.attributes&&gA(t,n.attributes),"classes"in n&&n.classes&&gA(t,n.classes,"class"),"styles"in n&&n.styles&&gA(t,n.styles,"style"),{name:n.name||!1,attributes:t}}function gA(n,t,e){if(typeof t=="string"){n.push(e?[e,t]:[t]);return}for(const i of t)Array.isArray(i)?n.push(i):n.push(e?[e,i]:[i])}class ym{constructor(...t){y(this,"_patterns",[]);this.add(...t)}add(...t){for(let e of t)(typeof e=="string"||e instanceof RegExp)&&(e={name:e}),this._patterns.push(e)}match(...t){for(const e of t)for(const i of this._patterns){const s=this._isElementMatching(e,i);if(s)return{element:e,pattern:i,match:s}}return null}matchAll(...t){const e=[];for(const i of t)for(const s of this._patterns){const r=this._isElementMatching(i,s);r&&e.push({element:i,pattern:s,match:r})}return e.length>0?e:null}getElementName(){if(this._patterns.length!==1)return null;const t=this._patterns[0],e=t.name;return typeof t!="function"&&e&&!(e instanceof RegExp)?e:null}_isElementMatching(t,e){if(typeof e=="function"){const r=e(t);return!r||typeof r!="object"?r:Yp(r)}const i={};if(e.name&&(i.name=Khe(e.name,t.name),!i.name))return null;const s=[];return e.attributes&&!Xhe(e.attributes,t,s)||e.classes&&!Jhe(e.classes,t,s)||e.styles&&
423!Zhe(e.styles,t,s)?null:(s.length&&(i.attributes=s),i)}}function WE(n,t){return n===!0||n===t||n instanceof RegExp&&!!String(t).match(n)}function Khe(n,t){return n instanceof RegExp?!!t.match(n):n===t}function ZM(n,t){if(Array.isArray(n))return n.map(i=>typeof i!="object"||i instanceof RegExp?t?[t,i,!0]:[i,!0]:((i.key===void 0||i.value===void 0)&&Dt("matcher-pattern-missing-key-or-value",i),t?[t,i.key,i.value]:[i.key,i.value]));if(typeof n!="object"||n instanceof RegExp)return[t?[t,n,!0]:[n,!0]];const e=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.push(t?[t,i,n[i]]:[i,n[i]]);return e}function Xhe(n,t,e){let i;return typeof n=="object"&&!(n instanceof RegExp)&&!Array.isArray(n)?(n.style!==void 0&&Dt("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Dt("matcher-pattern-deprecated-attributes-class-key",n)):i=["class","style"],t._collectAttributesMatch(ZM(n),e,i)}function Jhe(n,t,e){return t._collectAttributesMatch(ZM(n,"class"),e)}function Zhe(n,t,e){return t._collectAttributesMatch(ZM(n,"style"),e)}class db{constructor(t){y(this,"_styles");y(this,"_cachedStyleNames",null);y(this,"_cachedExpandedStyleNames",null);y(this,"_styleProcessor");this._styles={},this._styleProcessor=t}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(t){this.clear();const e=efe(t);for(const[i,s]of e)this._styleProcessor.toNormalizedForm(i,s,this._styles);return this}has(t){if(this.isEmpty)return!1;const i=this._styleProcessor.getReducedForm(t,this._styles).find(([s])=>s===t);return Array.isArray(i)}set(t,e){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,ys(t))for(const[i,s]of Object.entries(t))this._styleProcessor.toNormalizedForm(i,s,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e={};for(const i of bn(t)){const s=lI(i),r=$c(this._styles,s);if(r)W0(e,s,r);else{const o=this.getAsString(i);o!==void 0&&this._styleProcessor.toNormalizedForm(i,o,e)}}Object.keys(e).length&&(yW(this._styles,e),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!ys(this._styles[t]))return this._styles[t];const i=this._styleProcessor.getReducedForm(t,this._styles).find(([s])=>s===t);if(Array.isArray(i))return i[1]}getStyleNames(t=!1){return this.isEmpty?[]:t?(this._cachedExpandedStyleNames||(this._cachedExpandedStyleNames=this._styleProcessor.getStyleNames(this._styles)),this._cachedExpandedStyleNames):(this._cachedStyleNames||(this._cachedStyleNames=this.getStylesEntries().map(([e])=>e)),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(t){if(this.size!==t.size)return!1;for(const e of this.getStyleNames())if(!t.has(e)||t.getAsString(e)!==this.getAsString(e))return!1;return!0}getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_clone(){const t=new this.constructor(this._styleProcessor);return t.set(this.getNormalized()),t}_getTokensMatch(t,e){const i=[];
423for(const s of this.getStyleNames(!0))if(WE(t,s)){if(e===!0){i.push(s);continue}const r=this.getAsString(s);WE(e,r)&&i.push(s)}return i.length?i:void 0}_getConsumables(t){const e=[];if(t){e.push(t);for(const i of this._styleProcessor.getRelatedStyles(t))e.push(i)}else for(const i of this.getStyleNames()){for(const s of this._styleProcessor.getRelatedStyles(i))e.push(s);e.push(i)}return e}_canMergeFrom(t){for(const e of t.getStyleNames())if(this.has(e)&&this.getAsString(e)!==t.getAsString(e))return!1;return!0}_mergeFrom(t){for(const e of t.getStyleNames())this.has(e)||this.set(e,t.getAsString(e))}_isMatching(t){for(const e of t.getStyleNames())if(!this.has(e)||this.getAsString(e)!==t.getAsString(e))return!1;return!0}}class Qhe{constructor(){y(this,"_normalizers");y(this,"_extractors");y(this,"_reducers");y(this,"_consumables");this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(ys(e)){W0(i,lI(t),e);return}if(this._normalizers.has(t)){const s=this._normalizers.get(t),{path:r,value:o}=s(e);W0(i,r,o)}else W0(i,t,e)}getNormalized(t,e){if(!t)return $M({},e);if(e[t]!==void 0)return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if(typeof i=="string")return $c(e,i);const s=i(t,e);if(s)return s}return $c(e,lI(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);return i===void 0?[]:this._reducers.has(t)?this._reducers.get(t)(i):[[t,i]]}getStyleNames(t){const e=new Set;for(const i of this._consumables.keys()){const s=this.getNormalized(i,t);s&&(typeof s!="object"||Object.keys(s).length)&&e.add(i)}for(const i of Object.keys(t))e.add(i);return Array.from(e)}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function efe(n){let t=null,e=0,i=0,s=null;const r=new Map;if(n==="")return r;n.charAt(n.length-1)!=";"&&(n=n+";");for(let o=0;o<n.length;o++){const a=n.charAt(o);if(t===null)switch(a){case":":s||(s=n.substr(e,o-e),i=o+1);break;case'"':case"'":t=a;break;case";":{const l=n.substr(i,o-i);s&&r.set(s.trim(),l.trim()),s=null,e=o+1;break}}else a===t&&(t=null)}return r}function lI(n){return n.replace("-",".")}function W0(n,t,e){let i=e;ys(e)&&(i=$M({},$c(n,t),e)),G$(n,t,i)}function yW(n,t){for(const e of Object.keys(t))n[e]!==null&&!Array.isArray(n[e])&&typeof n[e]=="object"&&typeof t[e]=="object"?(yW(n[e],t[e]),Object.keys(n[e]).length||delete n[e]):delete n[e]}class mA{constructor(){y(this,"_set",new Set)}get isEmpty(){return this._set.size==0}get size(){return this._set.size}has(t){return this._set.has(t)}keys(){return Array.from(this._set.keys())}setTo(t){this.clear();for(const e of t.split(/\s+/))e&&this._set.add(e);return this}set(t){for(const e of bn(t))e&&this._set.add(e)}remove(t){for(const e of bn(t))this._set.delete(e)}clear(){this._set.clear()}toString(){return Array.from(this._set).join(" ")}isSimilar(t){if(this.size!==t.size)return!1;for(const e of this.keys())if(!t.has(e))return!1;return!0}_clone(){const t=new this.constructor;return t._set=new Set(this._set),t}_getTokensMatch(t){const e=[];if(t===!0){for(const i of this._set.keys())e.push(i);return e}if(typeof t=="string"){for(const i of t.split(/\s+/))if(this._set.has(i))e.push(i);else return;return e}for(const i of this._set.keys())i.match(t)&&e.push(i);return e.length?e:void 0}_getConsumables(t){return t?[t]:this.keys()}_canMergeFrom(){return!0}_mergeFrom(t){for(const e of t._set.keys())this._set.has(e)||this._set.add(e)}_isMatching(t){for(const e of t._set.keys())if(!this._set.has(e))return!1;return!0}}class co extends Ah{constructor(e,i,s,r){super(e);y(this,"name");y(this,"_unsafeAttributesToRender",[]);y(this,"_attrs");y(this,"_children");y(this,"_customProperties",new Map);this.name=i,this._attrs=this._parseAttributes(s),this._children=[],r&&this._insertChild(0,r)}get _classes(){return this._attrs.get("class")}get _styles(){return this._attrs.get("style")}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes&&(yield"class"),this._styles&&(yield"style");for(const e of this._attrs.keys())e!="class"&&e!="style"&&(yield e)}*getAttributes(){for(const[e,i]of this._attrs.entries())yield[e,String(i)]}getAttribute(e){return this._attrs.has(e)?String(this._attrs.get(e)):void 0}hasAttribute(e,i){return this._attrs.has(e)?i!==void 0?zh(this.name,e)||fp(this.name,e)?this._attrs.get(e).has(i):this._attrs.get(e)===i:!0:!1}isSimilar(e){if(!(e instanceof co))return!1;if(this===e)return!0;
423if(this.name!=e.name||this._attrs.size!==e._attrs.size)return!1;for(const[i,s]of this._attrs){const r=e._attrs.get(i);if(r===void 0)return!1;if(typeof s=="string"||typeof r=="string"){if(r!==s)return!1}else if(!s.isSimilar(r))return!1}return!0}hasClass(...e){for(const i of e)if(!this._classes||!this._classes.has(i))return!1;return!0}getClassNames(){const e=this._classes?this._classes.keys():[],i=e[Symbol.iterator]();return Object.assign(e,{next:i.next.bind(i)})}getStyle(e){return this._styles&&this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles&&this._styles.getNormalized(e)}getStyleNames(e){return this._styles?this._styles.getStyleNames(e):[]}hasStyle(...e){for(const i of e)if(!this._styles||!this._styles.has(i))return!1;return!0}findAncestor(...e){const i=new ym(...e);let s=this.parent;for(;s&&!s.is("documentFragment");){if(i.match(s))return s;s=s.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=this._classes?this._classes.keys().sort().join(","):"",i=this._styles&&String(this._styles),s=Array.from(this._attrs).filter(([r])=>r!="style"&&r!="class").map(r=>`${r[0]}="${r[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(i?` style="${i}"`:"")+(s==""?"":` ${s}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}toJSON(){const e=super.toJSON();if(e.name=this.name,e.type="Element",this._attrs.size&&(e.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){e.children=[];for(const i of this._children)e.children.push(i.toJSON())}return e}_clone(e=!1){const i=[];if(e)for(const r of this.getChildren())i.push(r._clone(e));const s=new this.constructor(this.document,this.name,this._attrs,i);return s._customProperties=new Map(this._customProperties),s.getFillerOffset=this.getFillerOffset,s._unsafeAttributesToRender=this._unsafeAttributesToRender,s}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,i){this._fireChange("children",this,{index:e});let s=0;const r=tfe(this.document,i);for(const o of r)o.parent!==null&&o._remove(),o.parent=this,o.document=this.document,this._children.splice(e,0,o),e++,s++;return s}_removeChildren(e,i=1){this._fireChange("children",this,{index:e});for(let s=e;s<e+i;s++)this._children[s].parent=null;return this._children.splice(e,i)}_setAttribute(e,i,s=!0){if(this._fireChange("attributes",this),zh(this.name,e)||fp(this.name,e)){let r=this._attrs.get(e);r||(r=zh(this.name,e)?new db(this.document.stylesProcessor):new mA,this._attrs.set(e,r)),s?r.setTo(String(i)):zh(this.name,e)?Array.isArray(i)?r.set(i[0],i[1]):r.set(i):r.set(typeof i=="string"?i.split(/\s+/):i)}else this._attrs.set(e,String(i))}_removeAttribute(e,i){if(this._fireChange("attributes",this),i!==void 0&&(zh(this.name,e)||fp(this.name,e))){const s=this._attrs.get(e);return s?(fp(this.name,e)&&typeof i=="string"&&(i=i.split(/\s+/)),s.remove(i),s.isEmpty?this._attrs.delete(e):!1):!1}return this._attrs.delete(e)}_addClass(e){this._setAttribute("class",e,!1)}_removeClass(e){this._removeAttribute("class",e)}_setStyle(e,i){typeof e!="string"?this._setAttribute("style",e,!1):this._setAttribute("style",[e,i],!1)}_removeStyle(e){this._removeAttribute("style",e)}_collectAttributesMatch(e,i,s){for(const[r,o,a]of e){let l=!1,c=!1;for(const[u,d]of this._attrs)if(!(s&&s.includes(u)||!WE(r,u)))if(l=!0,typeof d=="string"){if(WE(o,d))i.push([u]),c=!0;else if(!(r instanceof RegExp))return!1}else{const h=d._getTokensMatch(o,a||!0);if(h){c=!0;for(const f of h)i.push([u,f])}else if(!(r instanceof RegExp))return!1}if(!l||!c)return!1}return!0}_getConsumables(e,i){const s=[];if(e){const r=this._attrs.get(e);if(r!==void 0)if(typeof r=="string")s.push([e]);else for(const o of r._getConsumables(i))s.push([e,o])}else for(const[r,o]of this._attrs)if(typeof o=="string")s.push([r]);else for(const a of o._getConsumables())s.push([r,a]);return{name:!e,attributes:s}}_canMergeAttributesFrom(e){if(this.name!=e.name)return!1;for(const[i,s]of e._attrs){const r=this._attrs.get(i);if(r!==void 0){if(typeof r=="string"||typeof s=="string"){if(r!==s)return!1}else if(!r._canMergeFrom(s))return!1}}return!0}_mergeAttributesFrom(e){this._fireChange("attributes",this);for(const[i,s]of e._attrs){const r=this._attrs.get(i);r===void 0||typeof r=="string"||typeof s=="string"?this._setAttribute(i,s):r._mergeFrom(s)}}_canSubtractAttributesOf(e){if(this.name!=e.name)return!1;for(const[i,s]of e._attrs){const r=this._attrs.get(i);if(r===void 0)return!1;if(typeof r=="string"||typeof s=="string"){if(r!==s)return!1}else if(!r._isMatching(s))return!1}return!0}_subtractAttributesOf(e){this._fireChange("attributes",this);for(const[i,s]of e._attrs){const r=this._attrs.get(i);typeof r=="string"||typeof s=="string"?this._attrs.delete(i):(r.remove(s.keys()),r.isEmpty&&this._attrs.delete(i))}}_setCustomProperty(e,i){this._customProperties.set(e,i)}_removeCustomProperty(e){return this._customProperties.delete(e)}_parseAttributes(e){const i=Qo(e);for(const[s,r]of i)if(r===null)i.delete(s);else if(zh(this.name,s)){const o=r instanceof db?r._clone():new db(this.document.stylesProcessor).setTo(String(r));i.set(s,o)}else if(fp(this.name,s)){const o=r instanceof mA?r._clone():new mA().setTo(String(r));i.set(s,o)}else typeof r!="string"&&i.set(s,String(r));return i}}co.prototype.is=function(n,t){return t?t===this.name&&(n==="element"||n==="view:element"):n==="element"||n==="view:element"||n==="node"||n==="view:node"};function tfe(n,t){if(typeof t=="string")return[new zn(n,t)];qs(t)||(t=[t]);const e=[];for(const i of t)typeof i=="string"?e.push(new zn(n,i)):i instanceof Sa?e.push(new zn(n,i.data)):e.push(i);return e}function fp(n,t){return t=="class"||n=="a"&&t=="rel"}function zh(n,t){return t=="style"}class zb extends co{constructor(t,e,i,s){super(t,e,i,s),this.getFillerOffset=nfe}toJSON(){const t=super.toJSON();return t.type="ContainerElement",t}}zb.prototype.is=function(n,t){return t?t===this.name&&(n==="containerElement"||n==="view:containerElement"||n==="element"||n==="view:element"):n==="containerElement"||n==="view:containerElement"||n==="element"||n==="view:element"||n==="node"||n==="view:node"};function nfe(){const n=[...this.getChildren()],t=n[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const e of n)if(!e.is("uiElement"))return null;return this.childCount}class qT extends Ut(zb){constructor(t,e,i,s){super(t,e,i,s),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",r=>r&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}destroy(){this.stopListening()}toJSON(){const t=super.toJSON();return t.type="EditableElement",t.isReadOnly=this.isReadOnly,t.isFocused=this.isFocused,t}}qT.prototype.is=function(n,t){return t?t===this.name&&(n==="editableElement"||n==="view:editableElement"||n==="containerElement"||n==="view:containerElement"||n==="element"||n==="view:element"):n==="editableElement"||n==="view:editableElement"||n==="containerElement"||n==="view:containerElement"||n==="element"||n==="view:element"||n==="node"||n==="view:node"};const QL=Symbol("rootName");class _W extends qT{constructor(t,e){super(t,e),this.rootName="main"}get rootName(){return this.getCustomProperty(QL)}set rootName(t){this._setCustomProperty(QL,t)}toJSON(){return this.rootName}set _name(t){this.name=t}}_W.prototype.is=function(n,t){return t?t===this.name&&(n==="rootElement"||n==="view:rootElement"||n==="editableElement"||n==="view:editableElement"||n==="containerElement"||n==="view:containerElement"||n==="element"||n==="view:element"):n==="rootElement"||n==="view:rootElement"||n==="editableElement"||n==="view:editableElement"||n==="containerElement"||n==="view:containerElement"||n==="element"||n==="view:element"||n==="node"||n==="view:node"};class Ru{constructor(t={}){y(this,"direction");y(this,"boundaries");y(this,"singleCharacters");y(this,"shallow");y(this,"ignoreElementEnd");y(this,"_position");y(this,"_boundaryStartParent");y(this,"_boundaryEndParent");
vendor: 8,565 bytes, line 423
423if(!t.boundaries&&!t.startPosition)throw new ee("view-tree-walker-no-start-position",null);if(t.direction&&t.direction!="forward"&&t.direction!="backward")throw new ee("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this._position=Ee._createAt(t.startPosition):this._position=Ee._createAt(t.boundaries[t.direction=="backward"?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(t){let e,i;do i=this.position,e=this.next();while(!e.done&&t(e.value));e.done||(this._position=i)}jumpTo(t){this._boundaryStartParent&&t.isBefore(this.boundaries.start)?t=this.boundaries.start:this._boundaryEndParent&&t.isAfter(this.boundaries.end)&&(t=this.boundaries.end),this._position=t.clone()}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(i.parent===null&&t.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let s;if(i&&i.is("view:$text")){if(t.isAtEnd)return this._position=Ee._createAfter(i),this._next();s=i.data[t.offset]}else s=i.getChild(t.offset);if(typeof s=="string"){let r;this.singleCharacters?r=1:r=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset;const o=new Sa(i,t.offset,r);return t.offset+=r,this._position=t,this._formatReturnValue("text",o,e,t,r)}if(s&&s.is("view:element")){if(!this.shallow)t=new Ee(s,0);else{if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}return this._position=t,this._formatReturnValue("elementStart",s,e,t,1)}if(s&&s.is("view:$text")){if(this.singleCharacters)return t=new Ee(s,0),this._position=t,this._next();let r=s.data.length,o;return s==this._boundaryEndParent?(r=this.boundaries.end.offset,o=new Sa(s,0,r),t=Ee._createAfter(o)):(o=new Sa(s,0,s.data.length),t.offset++),this._position=t,this._formatReturnValue("text",o,e,t,r)}return t=Ee._createAfter(i),this._position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(i.parent===null&&t.offset===0)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let s;if(i.is("view:$text")){if(t.isAtStart)return this._position=Ee._createBefore(i),this._previous();s=i.data[t.offset-1]}else s=i.getChild(t.offset-1);if(typeof s=="string"){let r;if(this.singleCharacters)r=1;else{const a=i===this._boundaryStartParent?this.boundaries.start.offset:0;r=t.offset-a}t.offset-=r;const o=new Sa(i,t.offset,r);return this._position=t,this._formatReturnValue("text",o,e,t,r)}if(s&&s.is("view:element"))return this.shallow?(t.offset--,this._position=t,this._formatReturnValue("elementStart",s,e,t,1)):(t=new Ee(s,s.childCount),this._position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",s,e,t));if(s&&s.is("view:$text")){if(this.singleCharacters)return t=new Ee(s,s.data.length),this._position=t,this._previous();let r=s.data.length,o;if(s==this._boundaryStartParent){const a=this.boundaries.start.offset;o=new Sa(s,a,s.data.length-a),r=o.data.length,t=Ee._createBefore(o)}else o=new Sa(s,0,s.data.length),t.offset--;return this._position=t,this._formatReturnValue("text",o,e,t,r)}return t=Ee._createBefore(i),this._position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,s,r){return e.is("view:$textProxy")&&(e.offsetInText+e.data.length==e.textNode.data.length&&(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))?(s=Ee._createAfter(e.textNode),this._position=s):i=Ee._createAfter(e.textNode)),e.offsetInText===0&&(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))?(s=Ee._createBefore(e.textNode),this._position=s):i=Ee._createBefore(e.textNode))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:s,length:r}}}}class Ee extends xh{constructor(e,i){super();y(this,"parent");y(this,"offset");this.parent=e,this.offset=i}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof qT);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const i=Ee._createAt(this),s=i.offset+e;return i.offset=s<0?0:s,i}getLastMatchingPosition(e,i={}){i.startPosition=this;const s=new Ru(i);return s.skip(e),s.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const i=this.getAncestors(),s=e.getAncestors();let r=0;for(;i[r]==s[r]&&i[r];)r++;return r===0?null:i[r-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const i=this.parent.is("node")?this.parent.getPath():[],s=e.parent.is("node")?e.parent.getPath():[];i.push(this.offset),s.push(e.offset);const r=li(i,s);switch(r){case"prefix":return"before";case"extension":return"after";default:return i[r]<s[r]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Ru(e)}clone(){return new Ee(this.parent,this.offset)}toJSON(){return{parent:this.parent.toJSON(),offset:this.offset}}static _createAt(e,i){if(e instanceof Ee)return new this(e.parent,e.offset);{const s=e;if(i=="end")i=s.is("$text")?s.data.length:s.childCount;else{if(i=="before")return this._createBefore(s);if(i=="after")return this._createAfter(s);if(i!==0&&!i)throw new ee("view-createpositionat-offset-required",s)}return new Ee(s,i)}}static _createAfter(e){if(e.is("$textProxy"))return new Ee(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new ee("view-position-after-root",e,{root:e});return new Ee(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new Ee(e.textNode,e.offsetInText);if(!e.parent)throw new ee("view-position-before-root",e,{root:e});return new Ee(e.parent,e.index)}}Ee.prototype.is=function(n){return n==="position"||n==="view:position"};class Je extends xh{constructor(e,i=null){super();y(this,"start");y(this,"end");this.start=e.clone(),this.end=i?i.clone():e.clone()}*[Symbol.iterator](){yield*new Ru({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(P_,{direction:"backward"}),i=this.end.getLastMatchingPosition(P_);return e.parent.is("$text")&&e.isAtStart&&(e=Ee._createBefore(e.parent)),i.parent.is("$text")&&i.isAtEnd&&(i=Ee._createAfter(i.parent)),new Je(e,i)}getTrimmed(){let e=this.start.getLastMatchingPosition(P_);if(e.isAfter(this.end)||e.isEqual(this.end))return new Je(e,e);let i=this.end.getLastMatchingPosition(P_,{direction:"backward"});const s=e.nodeAfter,r=i.nodeBefore;return s&&s.is("$text")&&(e=new Ee(s,0)),r&&r.is("$text")&&(i=new Ee(r,r.data.length)),new Je(e,i)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,i=!1){e.isCollapsed&&(i=!1);const s=this.containsPosition(e.start)||i&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||i&&this.end.isEqual(e.end);return s&&r}getDifference(e){const i=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&i.push(new Je(this.start,e.start)),this.containsPosition(e.end)&&i.push(new Je(e.end,this.end))):i.push(this.clone()),i}getIntersection(e){if(this.isIntersecting(e)){let i=this.start,s=this.end;return this.containsPosition(e.start)&&(i=e.start),this.containsPosition(e.end)&&(s=e.end),new Je(i,s)}return null}getWalker(e={}
423){return e.boundaries=this,new Ru(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,i=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(i=this.end.parent.previousSibling),e&&e.is("element")&&e===i?e:null}clone(){return new Je(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const i=new Ru(e);for(const s of i)yield s.item}*getPositions(e={}){e.boundaries=this;const i=new Ru(e);yield i.position;for(const s of i)yield s.nextPosition}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}static _createFromParentsAndOffsets(e,i,s,r){return new this(new Ee(e,i),new Ee(s,r))}static _createFromPositionAndShift(e,i){const s=e,r=e.getShiftedBy(i);return i>0?new this(s,r):new this(r,s)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const i=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(Ee._createBefore(e),i)}}Je.prototype.is=function(n){return n==="range"||n==="view:range"};function P_(n){return!!(n.item.is("attributeElement")||n.item.is("uiElement"))}class so extends Gt(xh){constructor(...e){super();y(this,"_ranges");y(this,"_lastRangeBackward");y(this,"_isFake");y(this,"_fakeSelectionLabel");this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const i of this._ranges)(!e||i.start.isBefore(e.start))&&(e=i);return e?e.clone():null}getLastRange(){let e=null;for(const i of this._ranges)(!e||i.end.isAfter(e.end))&&(e=i);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake||this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel||this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const i of this._ranges){let s=!1;for(const r of e._ranges)if(i.isEqual(r)){s=!0;break}if(!s)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const i=oI(this.getRanges()),s=oI(e.getRanges());if(i!=s)return!1;if(i==0)return!0;for(let r of this.getRanges()){r=r.getTrimmed();let o=!1;for(let a of e.getRanges())if(a=a.getTrimmed(),r.start.isEqual(a.start)&&r.end.isEqual(a.end)){o=!0;break}if(!o)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...e){let[i,s,r]=e;if(typeof s=="object"&&(r=s,s=void 0),i===null)this._setRanges([]),this._setFakeOptions(r);else if(i instanceof so||i instanceof QM)this._setRanges(i.getRanges(),i.isBackward),this._setFakeOptions({fake:i.isFake,label:i.fakeSelectionLabel});else if(i instanceof Je)this._setRanges([i],r&&r.backward),this._setFakeOptions(r);else if(i instanceof Ee)this._setRanges([new Je(i)]),this._setFakeOptions(r);else if(i instanceof Ah){const o=!!r&&!!r.backward;let a;if(s===void 0)throw new ee("view-selection-setto-required-second-parameter",this);s=="in"?a=Je._createIn(i):s=="on"?a=Je._createOn(i):a=new Je(Ee._createAt(i,s)),this._setRanges([a],o),this._setFakeOptions(r)}else if(qs(i))this._setRanges(i,r&&r.backward),this._setFakeOptions(r);else throw new ee("view-selection-setto-not-selectable",this);this.fire("change")}setFocus(e,i){if(this.anchor===null)throw new ee("view-selection-setfocus-no-ranges",this);const s=Ee._createAt(e,i);if(s.compareWith(this.focus)=="same")return;const r=this.anchor;this._ranges.pop(),s.compareWith(r)=="before"?this._addRange(new Je(s,r),!0):this._addRange(new Je(r,s)),this.fire("change")}toJSON(){const e={ranges:Array.from(this.getRanges()).map(i=>i.toJSON())};return this.isBackward&&(e.isBackward=!0),this.isFake&&(e.isFake=!0),e}_setRanges(e,i=!1){e=Array.from(e),this._ranges=[];for(const s of e)this._addRange(s);this._lastRangeBackward=!!i}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,i=!1){if(!(e instanceof Je))throw new ee("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!i}_pushRange(e){for(const i of this._ranges)if(e.isIntersecting(i))throw new ee("view-selection-range-intersects",this,{addedRange:e,intersectingRange:i});this._ranges.push(new Je(e.start,e.end))}}so.prototype.is=function(n){return n==="selection"||n==="view:selection"};class QM extends Gt(xh){constructor(...e){super();y(this,"_selection");this._selection=new so,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,i){this._selection.setFocus(e,i)}}QM.prototype.is=function(n){return n==="selection"||n=="documentSelection"||n=="view:selection"||n=="view:documentSelection"};class Ch extends bl{constructor(e,i,s){super(e,i);y(this,"startRange");y(this,"_eventPhase");y(this,"_currentTarget");this.startRange=s,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const pA=Symbol("bubblingEmitter"),bA=Symbol("bubblingCallbacks"),wA=Symbol("bubblingContexts");function ife(n){class t extends n{fire(i,...s){try{const r=i instanceof bl?i:new bl(this,i),o=vA(this),a=tF(this);if(gp(r,"capturing",this),M_(o,"$capture",r,...s))return r.return;const l=r.startRange||this.selection.getFirstRange(),c=l?l.getContainedElement():null,u=c?rfe(a,c):!1;let d=c||ofe(l);if(gp(r,"atTarget",d),!u){if(M_(o,"$text",r,...s))return r.return;gp(r,"bubbling",d)}for(;d;){if(d.is("element")&&M_(o,d,r,...s))return r.return;d=d.parent,gp(r,"bubbling",d)}return gp(r,"bubbling",this),M_(o,"$document",r,...s),r.return}catch(r){/* istanbul ignore next -- @preserve */ee.rethrowUnexpectedError(r,this)}}_addEventListener(i,s,r){const o=bn(r.context||"$document"),a=vA(this),l=eF(this);for(const u of o)typeof u=="function"&&tF(this).add(u);const c=sfe(this,o,s);l.set(s,c),this.listenTo(a,i,c,r)}_removeEventListener(i,s){const r=vA(this),o=eF(this),a=o.get(s);a&&(o.delete(s),this.stopListening(r,i,a))}}return t}function gp(n,t,e){n instanceof Ch&&(n._eventPhase=t,n._currentTarget=e)}function M_(n,t,e,...i){return n.fire(e,{currentTarget:t,eventArgs:i}
423),!!e.stop.called}function sfe(n,t,e){return function(i,s){const{currentTarget:r,eventArgs:o}=s;if(typeof r=="string"){t.includes(r)&&e.call(n,i,...o);return}if(r.is("rootElement")&&t.includes("$root")){e.call(n,i,...o);return}if(t.includes(r.name)){e.call(n,i,...o);return}for(const a of t)if(typeof a=="function"&&a(r)){e.call(n,i,...o);return}}}function vA(n){return n[pA]||(n[pA]=new(Gt())),n[pA]}function eF(n){return n[bA]||(n[bA]=new Map),n[bA]}function tF(n){return n[wA]||(n[wA]=new Set),n[wA]}function rfe(n,t){for(const e of n)if(e(t))return!0;return!1}function ofe(n){if(!n)return null;const t=n.start.parent,e=n.end.parent,i=t.getPath(),s=e.getPath();return i.length>s.length?t:e}class EW extends ife(Ut()){constructor(e){super();y(this,"selection");y(this,"roots");y(this,"stylesProcessor");y(this,"_postFixers",new Set);this.selection=new QM,this.roots=new er({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let i=!1;do for(const s of this._postFixers)if(i=s(e),i)break;while(i)}}const nF=10;class oh extends co{constructor(e,i,s,r){super(e,i,s,r);y(this,"_priority",nF);y(this,"_id",null);y(this,"_clonesGroup",null);this.getFillerOffset=afe}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new ee("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){const e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){const i=super._clone(e);return i._priority=this._priority,i._id=this._id,i}_canMergeAttributesFrom(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canSubtractAttributesOf(e)}}y(oh,"DEFAULT_PRIORITY",nF);oh.prototype.is=function(n,t){return t?t===this.name&&(n==="attributeElement"||n==="view:attributeElement"||n==="element"||n==="view:element"):n==="attributeElement"||n==="view:attributeElement"||n==="element"||n==="view:element"||n==="node"||n==="view:node"};function afe(){if(yA(this))return null;let n=this.parent;for(;n&&n.is("attributeElement");){if(yA(n)>1)return null;n=n.parent}return!n||yA(n)>1?null:this.childCount}function yA(n){return Array.from(n.getChildren()).filter(t=>!t.is("uiElement")).length}class eO extends co{constructor(t,e,i,s){super(t,e,i,s),this.getFillerOffset=lfe}toJSON(){const t=super.toJSON();return t.type="EmptyElement",t}_insertChild(t,e){if(e&&(e instanceof Ah||Array.from(e).length>0))throw new ee("view-emptyelement-cannot-add",[this,e]);return 0}}eO.prototype.is=function(n,t){return t?t===this.name&&(n==="emptyElement"||n==="view:emptyElement"||n==="element"||n==="view:element"):n==="emptyElement"||n==="view:emptyElement"||n==="element"||n==="view:element"||n==="node"||n==="view:node"};function lfe(){return null}class KT extends co{constructor(t,e,i,s){super(t,e,i,s),this.getFillerOffset=ufe}_insertChild(t,e){if(e&&(e instanceof Ah||Array.from(e).length>0))throw new ee("view-uielement-cannot-add",[this,e]);return 0}render(t,e){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const i of this.getAttributeKeys())e.setAttribute(i,this.getAttribute(i));return e}toJSON(){const t=super.toJSON();return t.type="UIElement",t}}KT.prototype.is=function(n,t){return t?t===this.name&&(n==="uiElement"||n==="view:uiElement"||n==="element"||n==="view:element"):n==="uiElement"||n==="view:uiElement"||n==="element"||n==="view:element"||n==="node"||n==="view:node"};function cfe(n){n.document.on("arrowKey",(t,e)=>dfe(t,e,n.domConverter),{priority:"low"})}function ufe(){return null}function dfe(n,t,e){if(t.keyCode==ft.arrowright){const i=t.domTarget.ownerDocument.defaultView.getSelection(),s=i.rangeCount==1&&i.getRangeAt(0).collapsed;if(s||t.shiftKey){const r=i.focusNode,o=i.focusOffset,a=e.domPositionToView(r,o);if(a===null)return;let l=!1;const c=a.getLastMatchingPosition(u=>(u.item.is("uiElement")&&(l=!0),!!(u.item.is("uiElement")||u.item.is("attributeElement"))));if(l){const u=e.viewPositionToDom(c);s?i.collapse(u.parent,u.offset):i.extend(u.parent,u.offset)}}}}class tO extends co{constructor(t,e,i,s){super(t,e,i,s),this.getFillerOffset=hfe}toJSON(){const t=super.toJSON();return t.type="RawElement",t}_insertChild(t,e){if(e&&(e instanceof Ah||Array.from(e).length>0))throw new ee("view-rawelement-cannot-add",[this,e]);return 0}render(t,e){}}tO.prototype.is=function(n,t){return t?t===this.name&&(n==="rawElement"||n==="view:rawElement"||n==="element"||n==="view:element"):n==="rawElement"||n==="view:rawElement"||n===this.name||n==="view:"+this.name||n==="element"||n==="view:element"||n==="node"||n==="view:node"};function hfe(){return null}class ah extends Gt(xh){constructor(e,i){super();y(this,"document");y(this,"_children",[]);y(this,"_customProperties",new Map);this.document=e,i&&this._insertChild(0,i)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){const e=[];for(const i of this._children)e.push(i.toJSON());return e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,i){this._fireChange("children",this,{index:e});let s=0;const r=ffe(this.document,i);for(const o of r)o.parent!==null&&o._remove(),o.parent=this,this._children.splice(e,0,o),e++,s++;return s}_removeChildren(e,i=1){this._fireChange("children",this,{index:e});for(let s=e;s<e+i;s++)this._children[s].parent=null;return this._children.splice(e,i)}_fireChange(e,i,s){this.fire(`change:${e}`,i,s)}_setCustomProperty(e,i){this._customProperties.set(e,i)}_removeCustomProperty(e){return this._customProperties.delete(e)}}ah.prototype.is=function(n){return n==="documentFragment"||n==="view:documentFragment"};function ffe(n,t){return typeof t=="string"?[new zn(n,t)]:(qs(t)||(t=[t]),Array.from(t).map(e=>typeof e=="string"?new zn(n,e):e instanceof Sa?new zn(n,e.data):e))}class SW{constructor(t){y(this,"document");y(this,"_cloneGroups",new Map);y(this,"_slotFactory",null);this.document=t}setSelection(...t){this.document.selection._setTo(...t)}setSelectionFocus(t,e){this.document.selection._setFocus(t,e)}createDocumentFragment(t){return new ah(this.document,t)}createText(t){return new zn(this.document,t)}createAttributeElement(t,e,i={}){const s=new oh(this.document,t,e);return typeof i.priority=="number"&&(s._priority=i.priority),i.id&&(s._id=i.id),i.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),s}createContainerElement(t,e,i={},s={}){let r;bfe(i)?s=i:r=i;const o=new zb(this.document,t,e,r);return s.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...s.renderUnsafeAttributes),o}createEditableElement(t,e,i={}){const s=new qT(this.document,t,e);return i.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),s}createEmptyElement(t,e,i={}){const s=new eO(this.document,t,e);return i.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),s}createUIElement(t,e,i){const s=new KT(this.document,t,e);return i&&(s.render=i),s}createRawElement(t,e,i,s={}){const r=new tO(this.document,t,e);return i&&(r.render=i),s.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...s.renderUnsafeAttributes),r}setAttribute(t,e,i,s){s!==void 0?s._setAttribute(t,e,i):i._setAttribute(t,e)}removeAttribute(t,e,i){i!==void 0?i._removeAttribute(t,e):e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){Yo(t)&&i===void 0?e._setStyle(t):i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof Ee?this._breakAttributes(t):this._breakAttributesRange(t)}
423breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new ee("view-writer-break-non-container-element",this.document);if(!e.parent)throw new ee("view-writer-break-root",this.document);if(t.isAtStart)return Ee._createBefore(e);if(!t.isAtEnd){const i=e._clone(!1);this.insert(Ee._createAfter(e),i);const s=new Je(t,Ee._createAt(e,"end")),r=new Ee(i,0);this.move(s,r)}return Ee._createAfter(e)}mergeAttributes(t){const e=t.offset,i=t.parent;if(i.is("$text"))return t;if(i.is("attributeElement")&&i.childCount===0){const o=i.parent,a=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new Ee(o,a))}const s=i.getChild(e-1),r=i.getChild(e);if(!s||!r)return t;if(s.is("$text")&&r.is("$text"))return sF(s,r);if(s.is("attributeElement")&&r.is("attributeElement")&&s.isSimilar(r)){const o=s.childCount;return s._appendChild(r.getChildren()),r._remove(),this._removeFromClonedElementsGroup(r),this.mergeAttributes(new Ee(s,o))}return t}mergeContainers(t){const e=t.nodeBefore,i=t.nodeAfter;if(!e||!i||!e.is("containerElement")||!i.is("containerElement"))throw new ee("view-writer-merge-containers-invalid-position",this.document);const s=e.getChild(e.childCount-1),r=s instanceof zn?Ee._createAt(s,"end"):Ee._createAt(e,"end");return this.move(Je._createIn(i),Ee._createAt(e,"end")),this.remove(Je._createOn(i)),r}insert(t,e){e=qs(e)?[...e]:[e],TW(e,this.document);const i=e.reduce((o,a)=>{const l=o[o.length-1],c=!a.is("uiElement");return!l||l.breakAttributes!=c?o.push({breakAttributes:c,nodes:[a]}):l.nodes.push(a),o},[]);let s=null,r=t;for(const{nodes:o,breakAttributes:a}of i){const l=this._insertNodes(r,o,a);s||(s=l.start),r=l.end}return s?new Je(s,r):new Je(t)}remove(t){const e=t instanceof Je?t:Je._createOn(t);if(mp(e,this.document),e.isCollapsed)return new ah(this.document);const{start:i,end:s}=this._breakAttributesRange(e,!0),r=i.parent,o=s.offset-i.offset,a=r._removeChildren(i.offset,o);for(const c of a)this._removeFromClonedElementsGroup(c);const l=this.mergeAttributes(i);return e.start=l,e.end=l.clone(),new ah(this.document,a)}clear(t,e){mp(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const s of i){const r=s.item;let o;if(r.is("element")&&e.isSimilar(r))o=Je._createOn(r);else if(!s.nextPosition.isAfter(t.start)&&r.is("$textProxy")){const a=r.getAncestors().find(l=>l.is("element")&&e.isSimilar(l));a&&(o=Je._createIn(a))}o&&(o.end.isAfter(t.end)&&(o.end=t.end),o.start.isBefore(t.start)&&(o.start=t.start),this.remove(o))}}move(t,e){let i;if(e.isAfter(t.end)){e=this._breakAttributes(e,!0);const s=e.parent,r=s.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=s.childCount-r}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof oh))throw new ee("view-writer-wrap-invalid-attribute",this.document);if(mp(t,this.document),t.isCollapsed){let i=t.start;i.parent.is("element")&&!gfe(i.parent)&&(i=i.getLastMatchingPosition(r=>r.item.is("uiElement"))),i=this._wrapPosition(i,e);const s=this.document.selection;return s.isCollapsed&&s.getFirstPosition().isEqual(t.start)&&this.setSelection(i),new Je(i)}else return this._wrapRange(t,e)}unwrap(t,e){if(!(e instanceof oh))throw new ee("view-writer-unwrap-invalid-attribute",this.document);if(mp(t,this.document),t.isCollapsed)return t;const{start:i,end:s}=this._breakAttributesRange(t,!0),r=i.parent,o=this._unwrapChildren(r,i.offset,s.offset,e),a=this.mergeAttributes(o.start);a.isEqual(o.start)||o.end.offset--;const l=this.mergeAttributes(o.end);return new Je(a,l)}rename(t,e){const i=new zb(this.document,t,e.getAttributes());return this.insert(Ee._createAfter(e),i),this.move(Je._createIn(e),Ee._createAt(i,0)),this.remove(Je._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return Ee._createAt(t,e)}createPositionAfter(t){return Ee._createAfter(t)}createPositionBefore(t){return Ee._createBefore(t)}createRange(t,e){return new Je(t,e)}createRangeOn(t){return Je._createOn(t)}createRangeIn(t){return Je._createIn(t)}createSelection(...t){return new so(...t)}createSlot(t="children"){if(!this._slotFactory)throw new ee("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,t)}_registerSlotFactory(t){this._slotFactory=t}_clearSlotFactory(){this._slotFactory=null}
423_insertNodes(t,e,i){let s;if(i?s=cI(t):s=t.parent.is("$text")?t.parent.parent:t.parent,!s)throw new ee("view-writer-invalid-position-container",this.document);let r;i?r=this._breakAttributes(t,!0):r=t.parent.is("$text")?_A(t):t;const o=s._insertChild(r.offset,e);for(const u of e)this._addToClonedElementsGroup(u);const a=r.getShiftedBy(o),l=this.mergeAttributes(r);l.isEqual(r)||a.offset--;const c=this.mergeAttributes(a);return new Je(l,c)}_wrapChildren(t,e,i,s){let r=e;const o=[];for(;r<i;){const l=t.getChild(r),c=l.is("$text"),u=l.is("attributeElement");if(u&&l._canMergeAttributesFrom(s))l._mergeAttributesFrom(s),o.push(new Ee(t,r));else if(c||!u||mfe(s,l)){const d=s._clone();l._remove(),d._appendChild(l),t._insertChild(r,d),this._addToClonedElementsGroup(d),o.push(new Ee(t,r))}else this._wrapChildren(l,0,l.childCount,s);r++}let a=0;for(const l of o){if(l.offset-=a,l.offset==e)continue;this.mergeAttributes(l).isEqual(l)||(a++,i--)}return Je._createFromParentsAndOffsets(t,e,t,i)}_unwrapChildren(t,e,i,s){let r=e;const o=[];for(;r<i;){const l=t.getChild(r);if(!l.is("attributeElement")){r++;continue}if(l.isSimilar(s)){const c=l.getChildren(),u=l.childCount;l._remove(),t._insertChild(r,c),this._removeFromClonedElementsGroup(l),o.push(new Ee(t,r),new Ee(t,r+u)),r+=u,i+=u-1;continue}if(l._canSubtractAttributesOf(s)){l._subtractAttributesOf(s),o.push(new Ee(t,r),new Ee(t,r+1)),r++;continue}this._unwrapChildren(l,0,l.childCount,s),r++}let a=0;for(const l of o){if(l.offset-=a,l.offset==e||l.offset==i)continue;this.mergeAttributes(l).isEqual(l)||(a++,i--)}return Je._createFromParentsAndOffsets(t,e,t,i)}_wrapRange(t,e){const{start:i,end:s}=this._breakAttributesRange(t,!0),r=i.parent,o=this._wrapChildren(r,i.offset,s.offset,e),a=this.mergeAttributes(o.start);a.isEqual(o.start)||o.end.offset--;const l=this.mergeAttributes(o.end);return new Je(a,l)}_wrapPosition(t,e){if(e.isSimilar(t.parent))return iF(t.clone());t.parent.is("$text")&&(t=_A(t));const i=this.createAttributeElement("_wrapPosition-fake-element");i._priority=Number.POSITIVE_INFINITY,i.isSimilar=()=>!1,t.parent._insertChild(t.offset,i);const s=new Je(t,t.getShiftedBy(1));this.wrap(s,e);const r=new Ee(i.parent,i.index);i._remove();const o=r.nodeBefore,a=r.nodeAfter;return o&&o.is("view:$text")&&a&&a.is("view:$text")?sF(o,a):iF(r)}_breakAttributesRange(t,e=!1){const i=t.start,s=t.end;if(mp(t,this.document),t.isCollapsed){const l=this._breakAttributes(t.start,e);return new Je(l,l)}const r=this._breakAttributes(s,e),o=r.parent.childCount,a=this._breakAttributes(i,e);return r.offset+=r.parent.childCount-o,new Je(a,r)}_breakAttributes(t,e=!1){const i=t.offset,s=t.parent;if(t.parent.is("emptyElement"))throw new ee("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new ee("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new ee("view-writer-cannot-break-raw-element",this.document);if(!e&&s.is("$text")&&uI(s.parent)||uI(s))return t.clone();if(s.is("$text"))return this._breakAttributes(_A(t),e);const r=s.childCount;if(i==r){const o=new Ee(s.parent,s.index+1);return this._breakAttributes(o,e)}else if(i===0){const o=new Ee(s.parent,s.index);return this._breakAttributes(o,e)}else{const o=s.index+1,a=s._clone();s.parent._insertChild(o,a),this._addToClonedElementsGroup(a);const l=s.childCount-i,c=s._removeChildren(i,l);a._appendChild(c);const u=new Ee(s.parent,o);return this._breakAttributes(u,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const s of t.getChildren())this._addToClonedElementsGroup(s);const e=t.id;if(!e)return;let i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const s of t.getChildren())this._removeFromClonedElementsGroup(s);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function gfe(n){return Array.from(n.getChildren()).some(t=>!t.is("uiElement"))}function cI(n){let t=n.parent;for(;!uI(t);){if(!t)return;t=t.parent}return t}function mfe(n,t){return n.priority<t.priority?!0:n.priority>t.priority?!1:n.getIdentity()<t.getIdentity()}function iF(n){const t=n.nodeBefore;if(t&&t.is("$text"))return new Ee(t,t.data.length);const e=n.nodeAfter;return e&&e.is("$text")?new Ee(e,0):n}function _A(n){if(n.offset==n.parent.data.length)return new Ee(n.parent.parent,n.parent.index+1);if(n.offset===0)return new Ee(n.parent.parent,n.parent.index);const t=n.parent.data.slice(n.offset);return n.parent._data=n.parent.data.slice(0,n.offset),n.parent.parent._insertChild(n.parent.index+1,new zn(n.root.document,t)),new Ee(n.parent.parent,n.parent.index+1)}function sF(n,t){const e=n.data.length;return n._data+=t.data,t._remove(),new Ee(n,e)}const pfe=[zn,oh,zb,eO,tO,KT];function TW(n,t){for(const e of n){if(!pfe.some(i=>e instanceof i))throw new ee("view-writer-insert-invalid-node-type",t);e.is("$text")||TW(e.getChildren(),t)}}function uI(n){return n&&(n.is("containerElement")||n.is("documentFragment"))}function mp(n,t){const e=cI(n.start),i=cI(n.end);if(!e||!i||e!==i)throw new ee("view-writer-invalid-range-container",t)}function bfe(n){return Yo(n)}const xW=n=>n.createTextNode("Â "),AW=n=>{const t=n.createElement("span");return t.dataset.ckeFiller="true",t.innerText="Â ",t},CW=n=>{const t=n.createElement("br");return t.dataset.ckeFiller="true",t},Us=7,$b="â ".repeat(Us);function Qi(n){return typeof n=="string"?n.substr(0,Us)===$b:mn(n)&&n.data.substr(0,Us)===$b}function ff(n){return n.data.length==Us&&Qi(n)}function rF(n){const t=typeof n=="string"?n:n.data;return Qi(n)?t.slice(Us):t}function wfe(n){n.document.on("arrowKey",vfe,{priority:"low"})}function vfe(n,t){if(t.keyCode==ft.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(e.rangeCount==1&&e.getRangeAt(0).collapsed){const i=e.getRangeAt(0).startContainer,s=e.getRangeAt(0).startOffset;Qi(i)&&s<=Us&&e.collapse(i,0)}}}class yfe extends Ut(){constructor(e,i){super();y(this,"domDocuments",new Set);y(this,"domConverter");y(this,"markedAttributes",new Set);y(this,"markedChildren",new Set);y(this,"markedTexts",new Set);y(this,"selection");y(this,"_inlineFiller",null);y(this,"_fakeSelectionContainer",null);this.domConverter=e,this.selection=i,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),Ge.isBlink&&!Ge.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()})}markToSync(e,i){if(e==="text")this.domConverter.mapViewToDom(i.parent)&&this.markedTexts.add(i);else{if(!this.domConverter.mapViewToDom(i))return;if(e==="attributes")this.markedAttributes.add(i);else if(e==="children")this.markedChildren.add(i);else throw new ee("view-renderer-unknown-type",this)}}
vendor: 4,282 bytes, line 423
423render(){if(this.isComposing&&!Ge.isAndroid)return;let e=null;const i=Ge.isBlink&&!Ge.isAndroid?!this.isSelecting:!0;for(const s of this.markedChildren)this._updateChildrenMappings(s);i?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=Ee._createBefore(e.parent)));for(const s of this.markedAttributes)this._updateAttrs(s);for(const s of this.markedChildren)this._updateChildren(s,{inlineFillerPosition:e});for(const s of this.markedTexts)!this.markedChildren.has(s.parent)&&this.domConverter.mapViewToDom(s.parent)&&this._updateText(s,{inlineFillerPosition:e});if(i)if(e){const s=this.domConverter.viewPositionToDom(e),r=s.parent.ownerDocument;Qi(s.parent)?this._inlineFiller=s.parent:this._inlineFiller=oF(r,s.parent,s.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const i=this.domConverter.mapViewToDom(e);if(!i)return;const s=Array.from(i.childNodes),r=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),o=this._diffNodeLists(s,r),a=this._findUpdateActions(o,s,r,Efe);if(a.indexOf("update")!==-1){const l={equal:0,insert:0,delete:0};for(const c of a)if(c==="update"){const u=l.equal+l.insert,d=l.equal+l.delete,h=e.getChild(u);h&&!h.is("uiElement")&&!h.is("rawElement")&&this._updateElementMappings(h,s[d]),$L(r[u]),l.equal++}else l[c]++}}_updateElementMappings(e,i){this.domConverter.unbindDomElement(i),this.domConverter.bindElements(i,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?Ee._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),i=this.domConverter.viewPositionToDom(e);return!!(i&&mn(i.parent)&&Qi(i.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Qi(e))throw new ee("view-renderer-filler-was-lost",this);ff(e)?e.remove():e.data=e.data.substr(Us),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),i=e.parent,s=e.offset;if(!this.domConverter.mapViewToDom(i.root)||!i.is("element")||!_fe(i))return!1;const r=e.nodeBefore,o=e.nodeAfter;return!(r instanceof zn||o instanceof zn||s===i.getFillerOffset()&&(!r||!r.is("element","br"))||Ge.isAndroid&&(r||o))}_updateText(e,i){const s=this.domConverter.findCorrespondingDomText(e);let o=this.domConverter.viewToDom(e).data;const a=i.inlineFillerPosition;a&&a.parent==e.parent&&a.offset==e.index&&(o=$b+o),this._updateTextNode(s,o)}_updateAttrs(e){const i=this.domConverter.mapViewToDom(e);if(i){for(const s of Array.from(i.attributes)){const r=s.name;e.hasAttribute(r)||this.domConverter.removeDomElementAttribute(i,r)}for(const s of e.getAttributeKeys())this.domConverter.setDomElementAttribute(i,s,e.getAttribute(s),e)}}_updateChildren(e,i){const s=this.domConverter.mapViewToDom(e);if(!s)return;if(Ge.isAndroid){let h=null;for(const f of Array.from(s.childNodes)){if(h&&mn(h)&&mn(f)){s.normalize();break}h=f}}const r=i.inlineFillerPosition,o=s.childNodes,a=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));r&&r.parent===e&&oF(s.ownerDocument,a,r.offset);const l=this._diffNodeLists(o,a),c=this._findUpdateActions(l,o,a,Sfe);let u=0;const d=new Set;for(const h of c)h==="delete"?(d.add(o[u]),$L(o[u])):(h==="equal"||h==="update")&&u++;u=0;for(const h of c)h==="insert"?(uW(s,u,a[u]),u++):h==="update"?(this._updateTextNode(o[u],a[u].data),u++):h==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(a[u])),u++);for(const h of d)h.parentNode||this.domConverter.unbindDomElement(h)}_diffNodeLists(e,i){return e=Afe(e,this._fakeSelectionContainer),kf(e,i,Tfe.bind(null,this.domConverter))}
423_findUpdateActions(e,i,s,r){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let o=[],a=[],l=[];const c={equal:0,insert:0,delete:0};for(const u of e)u==="insert"?l.push(s[c.equal+c.insert]):u==="delete"?a.push(i[c.equal+c.delete]):(o=o.concat(kf(a,l,r).map(d=>d==="equal"?"update":d)),o.push("equal"),a=[],l=[]),c[u]++;return o.concat(kf(a,l,r).map(u=>u==="equal"?"update":u))}_updateTextNode(e,i){const s=e.data;s!=i&&(Ge.isAndroid&&this.isComposing&&s.replace(/\u00A0/g," ")==i.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,i))}_updateTextNodeInternal(e,i){const s=Z$(e.data,i);for(const r of s)r.type==="insert"?e.insertData(r.index,r.values.join("")):e.deleteData(r.index,r.howMany)}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const i of e.getChildren())this._markDescendantTextToSync(i)}}_updateSelection(){if(Ge.isBlink&&!Ge.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0){this._removeDomSelection(),this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection();return}this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&Ge.isAndroid||this._updateDomSelection(e)}_updateFakeSelection(e){const i=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=Cfe(i));const s=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(s,this.selection),!this._fakeSelectionNeedsUpdate(e))return;(!s.parentElement||s.parentElement!=e)&&e.appendChild(s),s.textContent=this.selection.fakeSelectionLabel||"Â ";const r=i.getSelection(),o=i.createRange();r.removeAllRanges(),o.selectNodeContents(s),r.addRange(o)}_updateDomSelection(e){const i=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(i))return;const s=this.domConverter.viewPositionToDom(this.selection.anchor),r=this.domConverter.viewPositionToDom(this.selection.focus);i.setBaseAndExtent(s.parent,s.offset,r.parent,r.offset),Ge.isGecko&&xfe(r,i)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const i=e&&this.domConverter.domSelectionToView(e);return!(i&&this.selection.isEqual(i)||!this.selection.isCollapsed&&this.selection.isSimilar(i))}_fakeSelectionNeedsUpdate(e){const i=this._fakeSelectionContainer,s=e.ownerDocument.getSelection();return!i||i.parentElement!==e||s.anchorNode!==i&&!i.contains(s.anchorNode)?!0:i.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const i=e.getSelection();if(i.rangeCount){const s=e.activeElement,r=this.domConverter.mapDomToView(s);s&&r&&i.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function _fe(n){if(n.getAttribute("contenteditable")=="false")return!1;const t=n.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||t.getAttribute("contenteditable")=="true"}function oF(n,t,e){const i=t instanceof Array?t:t.childNodes,s=i[e];if(mn(s))return s.data=$b+s.data,s;{const r=n.createTextNode($b);return Array.isArray(t)?i.splice(e,0,r):uW(t,e,r),r}}function Efe(n,t){return Uc(n)&&Uc(t)&&!mn(n)&&!mn(t)&&!ub(n)&&!ub(t)&&n.tagName.toLowerCase()===t.tagName.toLowerCase()}function Sfe(n,t){return Uc(n)&&Uc(t)&&mn(n)&&mn(t)}function Tfe(n,t,e){return t===e?!0:mn(t)&&mn(e)?t.data===e.data:!!(n.isBlockFiller(t)&&n.isBlockFiller(e))}function xfe(n,t){let e=n.parent,i=n.offset;if(mn(e)&&ff(e)&&(i=hf(e)+1,e=e.parentNode),e.nodeType!=Node.ELEMENT_NODE||i!=e.childNodes.length-1)return;const s=e.childNodes[i];s&&s.tagName=="BR"&&t.addRange(t.getRangeAt(0))}function Afe(n,t){const e=Array.from(n);return e.length==0||!t||e[e.length-1]==t&&e.pop(),e}function Cfe(n){const t=n.createElement("div");
vendor: 4,249 bytes, line 423
423return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent="Â ",t}const kfe=CW(Ie.document),Ife=xW(Ie.document),Pfe=AW(Ie.document),O_="data-ck-unsafe-attribute-",aF="data-ck-unsafe-element";class kW{constructor(t,{blockFillerMode:e,renderingMode:i="editing"}={}){y(this,"document");y(this,"renderingMode");y(this,"blockFillerMode");y(this,"preElements");y(this,"blockElements");y(this,"inlineObjectElements");y(this,"unsafeElements");y(this,"_domDocument");y(this,"_domToViewMapping",new WeakMap);y(this,"_viewToDomMapping",new WeakMap);y(this,"_fakeSelectionMapping",new WeakMap);y(this,"_rawContentElementMatcher",new ym);y(this,"_inlineObjectElementMatcher",new ym);y(this,"_elementsWithTemporaryCustomProperties",new Set);this.document=t,this.renderingMode=i,this.blockFillerMode=e||(i==="editing"?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?Ie.document:Ie.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new so(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const i of t.children)this.unbindDomElement(i)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}shouldRenderAttribute(t,e,i){return this.renderingMode==="data"?!0:(t=t.toLowerCase(),t.startsWith("on")||t==="srcdoc"&&e.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i)?!1:i==="img"&&(t==="src"||t==="srcset")||i==="source"&&t==="srcset"?!0:!e.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(t,e){if(this.renderingMode==="data"){t.innerHTML=e;return}const i=new DOMParser().parseFromString(e,"text/html"),s=i.createDocumentFragment(),r=i.body.childNodes;for(;r.length>0;)s.appendChild(r[0]);const o=i.createTreeWalker(s,NodeFilter.SHOW_ELEMENT),a=[];let l;for(;l=o.nextNode();)a.push(l);for(const c of a){for(const d of c.getAttributeNames())this.setDomElementAttribute(c,d,c.getAttribute(d));const u=c.tagName.toLowerCase();this._shouldRenameElement(u)&&(dF(u),c.replaceWith(this._createReplacementDomElement(u,c)))}for(;t.firstChild;)t.firstChild.remove();t.append(s)}viewToDom(t,e={}){if(t.is("$text")){const i=this._processDataFromViewText(t);return this._domDocument.createTextNode(i)}else{const i=t;if(this.mapViewToDom(i))if(i.getCustomProperty("editingPipeline:doNotReuseOnce"))this._elementsWithTemporaryCustomProperties.add(i);else return this.mapViewToDom(i);let s;if(i.is("documentFragment"))s=this._domDocument.createDocumentFragment(),e.bind&&this.bindDocumentFragments(s,i);else{if(i.is("uiElement"))return i.name==="$comment"?s=this._domDocument.createComment(i.getCustomProperty("$rawContent")):s=i.render(this._domDocument,this),e.bind&&this.bindElements(s,i),s;this._shouldRenameElement(i.name)?(dF(i.name),s=this._createReplacementDomElement(i.name)):i.hasAttribute("xmlns")?s=this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):s=this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(s,this),e.bind&&this.bindElements(s,i);for(const r of i.getAttributeKeys())this.setDomElementAttribute(s,r,i.getAttribute(r),i)}if(e.withChildren!==!1)for(const r of this.viewChildrenToDom(i,e))s instanceof HTMLTemplateElement?s.content.appendChild(r):s.appendChild(r);return s}}setDomElementAttribute(t,e,i,s){const r=this.shouldRenderAttribute(e,i,t.tagName.toLowerCase())||s&&s.shouldRenderUnsafeAttribute(e);
423if(r||Dt("domconverter-unsafe-attribute-detected",{domElement:t,key:e,value:i}),!dhe(e)){Dt("domconverter-invalid-attribute-detected",{domElement:t,key:e,value:i});return}t.hasAttribute(e)&&!r?t.removeAttribute(e):t.hasAttribute(O_+e)&&r&&t.removeAttribute(O_+e),t.setAttribute(r?e:O_+e,i)}removeDomElementAttribute(t,e){e!=aF&&(t.removeAttribute(e),t.removeAttribute(O_+e))}*viewChildrenToDom(t,e={}){const i=t.getFillerOffset&&t.getFillerOffset();let s=0;for(const r of t.getChildren()){i===s&&(yield this._getBlockFiller());const o=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!$i(r.getAttributes());if(o&&this.renderingMode=="data")if(r.is("rawElement")){const a=this._domDocument.createElement(r.name);r.render(a,this),yield*[...a.childNodes]}else yield*this.viewChildrenToDom(r,e);else o&&Dt("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,e);s++}i===s&&(yield this._getBlockFiller())}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),s=this._domDocument.createRange();return s.setStart(e.parent,e.offset),s.setEnd(i.parent,i.offset),s}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let s=t.offset;return Qi(i)&&(s+=Us),i.data&&s>i.data.length&&(s=i.data.length),{parent:i,offset:s}}else{let i,s,r;if(t.offset===0){if(i=this.mapViewToDom(e),!i)return null;r=i.childNodes[0]}else{const a=t.nodeBefore;if(s=a.is("$text")?this.findCorrespondingDomText(a):this.mapViewToDom(a),!s)return null;i=s.parentNode,r=s.nextSibling}if(mn(r)&&Qi(r))return{parent:r,offset:Us};const o=s?hf(s)+1:0;return{parent:i,offset:o}}}domToView(t,e={}){const i=[],s=this._domToView(t,e,i),r=s.next().value;return!r||(s.next(),this._processDomInlineNodes(null,i,e),this.blockFillerMode=="br"&&cF(r))||r.is("$text")&&r.data.length==0?null:r}*domChildrenToView(t,e={},i=[]){let s=[];t instanceof HTMLTemplateElement?s=[...t.content.childNodes]:s=[...t.childNodes];for(let r=0;r<s.length;r++){const o=s[r],a=this._domToView(o,e,i),l=a.next().value;l!==null&&(this._isBlockViewElement(l)&&this._processDomInlineNodes(t,i,e),this.blockFillerMode=="br"&&cF(l)||(yield l),a.next())}this._processDomInlineNodes(t,i,e)}domSelectionToView(t){if(Lfe(t))return new so([]);if(t.rangeCount===1){let s=t.getRangeAt(0).startContainer;mn(s)&&(s=s.parentNode);const r=this.fakeSelectionToView(s);if(r)return r}const e=this.isDomSelectionBackward(t),i=[];for(let s=0;s<t.rangeCount;s++){const r=t.getRangeAt(s),o=this.domRangeToView(r);o&&i.push(o)}return new so(i,{backward:e})}domRangeToView(t){const e=this.domPositionToView(t.startContainer,t.startOffset),i=this.domPositionToView(t.endContainer,t.endOffset);return e&&i?new Je(e,i):null}domPositionToView(t,e=0){if(this.isBlockFiller(t))return this.domPositionToView(t.parentNode,hf(t));const i=this.mapDomToView(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return Ee._createBefore(i);if(mn(t)){if(ff(t))return this.domPositionToView(t.parentNode,hf(t));const s=this.findCorrespondingViewText(t);let r=e;return s?(Qi(t)&&(r-=Us,r=r<0?0:r),new Ee(s,r)):null}else{if(e===0){const s=this.mapDomToView(t);if(s)return new Ee(s,0)}else{const s=t.childNodes[e-1];if(mn(s)&&ff(s)||s&&this.isBlockFiller(s))return this.domPositionToView(s.parentNode,hf(s));const r=mn(s)?this.findCorrespondingViewText(s):this.mapDomToView(s);if(r&&r.parent)return new Ee(r.parent,r.index+1)}return null}}mapDomToView(t){return this.getHostViewElement(t)||this._domToViewMapping.get(t)}findCorrespondingViewText(t){if(ff(t))return null;const e=this.getHostViewElement(t);if(e)return e;const i=t.previousSibling;if(i){if(!this.isElement(i))return null;const s=this.mapDomToView(i);if(s){const r=s.nextSibling;return r instanceof zn?r:null}}else{const s=this.mapDomToView(t.parentNode);if(s){const r=s.getChild(0);return r instanceof zn?r:null}}return null}mapViewToDom(t){return this._viewToDomMapping.get(t)}findCorrespondingDomText(t){const e=t.previousSibling;return e&&this.mapViewToDom(e)?this.mapViewToDom(e).nextSibling:!e&&t.parent&&this.mapViewToDom(t.parent)?this.mapViewToDom(t.parent).childNodes[0]:null}focus(t){const e=this.mapViewToDom(t);if(!e||e.ownerDocument.activeElement===e)return;const{scrollX:i,scrollY:s}=Ie.window,r=[];lF(e,o=>{const{scrollLeft:a,scrollTop:l}=o;r.push([a,l])}),e.focus({preventScroll:!0}),lF(e,o=>{const[a,l]=r.shift();o.scrollLeft=a,o.scrollTop=l}),Ie.window.scrollTo(i,s)}_clearDomSelection(){const t=this.mapViewToDom(this.document.selection.editableElement);if(!t)return;const e=t.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(e);i&&i.rangeCount>0&&e.removeAllRanges()}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(t){return this.blockFillerMode=="br"?t.isEqualNode(kfe):uF(t,this.blockElements)?!0:t.isEqualNode(Pfe)||Ofe(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=this._domDocument.createRange();try{e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset)}catch{return!1}const i=e.collapsed;return e.detach(),i}getHostViewElement(t){const e=ahe(t);for(e.pop();e.length;){const i=e.pop(),s=this._domToViewMapping.get(i);if(s&&(s.is("uiElement")||s.is("rawElement")))return s}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}registerInlineObjectMatcher(t){this._inlineObjectElementMatcher.add(t)}_clearTemporaryCustomProperties(){for(const t of this._elementsWithTemporaryCustomProperties)t._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return xW(this._domDocument);case"markedNbsp":return AW(this._domDocument);case"br":return CW(this._domDocument)}}_isDomSelectionPositionCorrect(t,e){if(mn(t)&&Qi(t)&&e<Us||this.isElement(t)&&Qi(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!(i&&(i.is("uiElement")||i.is("rawElement")))}*_domToView(t,e,i){if(this.blockFillerMode!="br"&&uF(t,this.blockElements))return null;const s=this.getHostViewElement(t);if(s)return s;if(ub(t)&&e.skipComments)return null;if(mn(t)){if(ff(t))return null;{const r=t.data;if(r==="")return null;const o=new zn(this.document,r);return i.push(o),o}}else{let r=this.mapDomToView(t);if(r)return this._isInlineObjectElement(r)&&i.push(r),r;if(this.isDocumentFragment(t))r=new ah(this.document),e.bind&&this.bindDocumentFragments(t,r);else{r=this._createViewElement(t,e),e.bind&&this.bindElements(t,r);const a=t.attributes;if(a)for(let l=a.length,c=0;c<l;c++)r._setAttribute(a[c].name,a[c].value);if(this._isViewElementWithRawContent(r,e))return r._setCustomProperty("$rawContent",t.innerHTML),this._isBlockViewElement(r)||i.push(r),r;if(ub(t))return r._setCustomProperty("$rawContent",t.data),r}yield r;const o=[];if(e.withChildren!==!1)for(const a of this.domChildrenToView(t,e,o))r._appendChild(a);if(this._isInlineObjectElement(r))i.push(r),this._processDomInlineNodes(null,o,e);else for(const a of o)i.push(a)}}_processDomInlineNodes(t,e,i){if(!e.length||t&&!this.isDocumentFragment(t)&&!this._isBlockDomElement(t))return;let s=!1;for(let r=0;r<e.length;r++){const o=e[r];if(!o.is("$text")){s=!1;continue}let a,l=!1;if(this._isPreFormatted(o))a=rF(o.data);
vendor: 10,489 bytes, line 423
423else{a=o.data.replace(/[ \n\t\r]{1,}/g," "),l=/[^\S\u00A0]/.test(a.charAt(a.length-1));const c=r>0?e[r-1]:null,u=r+1<e.length?e[r+1]:null,d=!c||c.is("element")&&c.name=="br"||s,h=u?!1:!Qi(o.data);i.withChildren!==!1&&(d&&(a=a.replace(/^ /,"")),h&&(a=a.replace(/ $/,""))),a=rF(a),this.blockFillerMode!="br"&&o.parent&&(Rfe(o.parent,a)?(a="",o.parent.parent&&(o.parent.parent._setCustomProperty("$hasBlockFiller",!0),o.parent._remove())):Dfe(o.parent,a,this.blockElements)&&(a="",o.parent._setCustomProperty("$hasBlockFiller",!0))),a=a.replace(/ \u00A0/g," ");const f=u&&u.is("element")&&u.name!="br",p=u&&u.is("$text")&&u.data.charAt(0)==" ";(/[ \u00A0]\u00A0$/.test(a)||!u||f||p)&&(a=a.replace(/\u00A0$/," ")),(d||c&&c.is("element")&&c.name!="br")&&(a=a.replace(/^\u00A0/," "))}a.length==0&&o.parent?(o._remove(),e.splice(r,1),r--):(o._data=a,s=l)}e.length=0}_processDataFromViewText(t){let e=t.data;if(this._isPreFormatted(t))return e;if(e.charAt(0)==" "){const i=this._getTouchingInlineViewNode(t,!1);(i&&i.is("$textProxy")&&this._nodeEndsWithSpace(i)||!i)&&(e="Â "+e.substr(1))}if(e.charAt(e.length-1)==" "){const i=this._getTouchingInlineViewNode(t,!0),s=i&&i.is("$textProxy")&&i.data.charAt(0)==" ";(e.charAt(e.length-2)==" "||!i||s)&&(e=e.substr(0,e.length-1)+"Â ")}return e.replace(/ {2}/g," Â ")}_nodeEndsWithSpace(t){if(this._isPreFormatted(t))return!1;const e=this._processDataFromViewText(t);return e.charAt(e.length-1)==" "}_isPreFormatted(t){if(Mfe(t,this.preElements))return!0;for(const e of t.getAncestors({parentFirst:!0}))if(!(!e.is("element")||!e.hasStyle("white-space")||e.getStyle("white-space")==="inherit"))return["pre","pre-wrap","break-spaces"].includes(e.getStyle("white-space"));return!1}_getTouchingInlineViewNode(t,e){const i=new Ru({startPosition:e?Ee._createAfter(t):Ee._createBefore(t),direction:e?"forward":"backward"});for(const{item:s}of i){if(s.is("$textProxy"))return s;if(s.is("element")&&s.getCustomProperty("dataPipeline:transparentRendering"))continue;if(s.is("element","br"))return null;if(this._isInlineObjectElement(s))return s;if(s.is("containerElement")||this._isBlockViewElement(s))return null}return null}_isBlockDomElement(t){return this.isElement(t)&&this.blockElements.includes(t.tagName.toLowerCase())}_isBlockViewElement(t){return t.is("element")&&this.blockElements.includes(t.name)}_isInlineObjectElement(t){return t.is("element")?t.name=="br"||this.inlineObjectElements.includes(t.name)||!!this._inlineObjectElementMatcher.match(t):!1}_createViewElement(t,e){if(ub(t))return new KT(this.document,"$comment");const i=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();return new co(this.document,i)}_isViewElementWithRawContent(t,e){return e.withChildren!==!1&&t.is("element")&&!!this._rawContentElementMatcher.match(t)}_shouldRenameElement(t){const e=t.toLowerCase();return this.renderingMode==="editing"&&this.unsafeElements.includes(e)}_createReplacementDomElement(t,e){const i=this._domDocument.createElement("span");if(i.setAttribute(aF,t),e){for(;e.firstChild;)i.appendChild(e.firstChild);for(const s of e.getAttributeNames())i.setAttribute(s,e.getAttribute(s))}return i}}function Mfe(n,t){return n.getAncestors().some(e=>e.is("element")&&t.includes(e.name))}function lF(n,t){let e=n;for(;e;)t(e),e=e.parentElement}function Ofe(n,t){return n.isEqualNode(Ife)&&IW(n,t)&&n.parentNode.childNodes.length===1}function IW(n,t){const e=n.parentNode;return!!e&&!!e.tagName&&t.includes(e.tagName.toLowerCase())}function Dfe(n,t,e){return t=="Â "&&n&&n.is("element")&&n.childCount==1&&e.includes(n.name)}function Rfe(n,t){return t=="Â "&&n&&n.is("element","span")&&n.childCount==1&&n.hasAttribute("data-cke-filler")}function cF(n){return n.is("element","br")&&n.hasAttribute("data-cke-filler")}function uF(n,t){return n.tagName==="BR"&&IW(n,t)&&n.parentNode.childNodes.length===1}function dF(n){n==="script"&&Dt("domconverter-unsafe-script-element-detected"),n==="style"&&Dt("domconverter-unsafe-style-element-detected")}function Lfe(n){if(!Ge.isGecko||!n.rangeCount)return!1;const t=n.getRangeAt(0).startContainer;try{Object.prototype.toString.call(t)}catch{return!0}return!1}class ia extends Qs(){constructor(e){super();y(this,"view");y(this,"document");y(this,"_isEnabled",!1);this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=e.parentNode),!e||e.nodeType!==1?!1:e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}class bh{constructor(t,e,i){y(this,"view");y(this,"document");y(this,"domEvent");y(this,"domTarget");this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,X$(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class sa extends ia{constructor(){super(...arguments);y(this,"useCapture",!1);y(this,"usePassive",!1)}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(s=>{this.listenTo(e,s,(r,o)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(o.target)&&this.onDomEvent(o)},{useCapture:this.useCapture,usePassive:this.usePassive})})}stopObserving(e){this.stopListening(e)}fire(e,i,s){this.isEnabled&&this.document.fire(e,new bh(this.view,i,s))}}class Ffe extends sa{constructor(){super(...arguments);y(this,"domEventType",["keydown","keyup"])}onDomEvent(e){const i={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return vm(this)}};this.fire(e.type,e,i)}}class Nfe extends ia{constructor(e){super(e);y(this,"_fireSelectionChangeDoneDebounced");this._fireSelectionChangeDoneDebounced=ph(i=>{this.document.fire("selectionChangeDone",i)},200)}observe(){const e=this.document;e.on("arrowKey",(i,s)=>{e.selection.isFake&&this.isEnabled&&s.preventDefault()},{context:"$capture"}),e.on("arrowKey",(i,s)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(s.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const i=this.document.selection,s=new so(i.getRanges(),{backward:i.isBackward,fake:!1});(e==ft.arrowleft||e==ft.arrowup)&&s.setTo(s.getFirstPosition()),(e==ft.arrowright||e==ft.arrowdown)&&s.setTo(s.getLastPosition());const r={oldSelection:i,newSelection:s,domSelection:null};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}let PW=class extends ia{constructor(e){super(e);y(this,"domConverter");y(this,"_config");y(this,"_domElements");y(this,"_mutationObserver");this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const i of this._domElements)this._mutationObserver.observe(i,this._config)}}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(e.length===0)return;const i=this.domConverter,s=new Set,r=new Set;for(const a of e){const l=i.mapDomToView(a.target);l&&(l.is("uiElement")||l.is("rawElement")||a.type==="childList"&&!this._isBogusBrMutation(a)&&r.add(l))}for(const a of e){const l=i.mapDomToView(a.target);if(!(l&&(l.is("uiElement")||l.is("rawElement")))&&a.type==="characterData"){const c=i.findCorrespondingViewText(a.target);c&&!r.has(c.parent)?s.add(c):!c&&Qi(a.target)&&r.add(i.mapDomToView(a.target.parentNode))}}const o=[];for(const a of s)o.push({type:"text",node:a});for(const a of r){const l=i.mapViewToDom(a),c=Array.from(a.getChildren()),u=Array.from(i.domChildrenToView(l,{withChildren:!1}));iI(c,u,Bfe)||o.push({type:"children",node:a})}o.length&&this.document.fire("mutations",{mutations:o})}_isBogusBrMutation(e){let i=null;return e.nextSibling===null&&e.removedNodes.length===0&&e.addedNodes.length==1&&(i=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),i&&i.is("element","br")}};function Bfe(n,t){if(!Array.isArray(n))return n===t?!0:n.is("$text")&&t.is("$text")?n.data===t.data:!1}class UE extends sa{constructor(e){super(e);y(this,"_renderTimeoutId",null);y(this,"_isFocusChanging",!1);y(this,"domEventType",["focus","blur"]);this.useCapture=!0;const i=this.document;i.on("focus",()=>this._handleFocus()),i.on("blur",(s,r)=>this._handleBlur(r)),i.on("beforeinput",()=>{i.isFocused||this._handleFocus()},{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this._renderTimeoutId=null,this.flush(),this.view.change(()=>{})},50)}_handleBlur(e){const i=this.document.selection.editableElement;(i===null||i===e.target)&&(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change(()=>{}))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class Vfe extends ia{constructor(e){super(e);y(this,"mutationObserver");y(this,"focusObserver");y(this,"selection");y(this,"domConverter");y(this,"_documents",new WeakSet);y(this,"_fireSelectionChangeDoneDebounced");y(this,"_clearInfiniteLoopInterval");y(this,"_documentIsSelectingInactivityTimeoutDebounced");y(this,"_loopbackCounter",0);y(this,"_pendingSelectionChange",new Set);this.mutationObserver=e.getObserver(PW),this.focusObserver=e.getObserver(UE),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=ph(i=>{this.document.fire("selectionChangeDone",i)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=ph(()=>this.document.isSelecting=!1,5e3),this.view.document.on("change:isFocused",(i,s,r)=>{if(r&&this._pendingSelectionChange.size){for(const o of Array.from(this._pe
423ndingSelectionChange))this._handleSelectionChange(o);this._pendingSelectionChange.clear()}})}observe(e){const i=e.ownerDocument,s=()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},r=()=>{this.document.isSelecting&&(this._handleSelectionChange(i),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",s,{priority:"highest"}),this.listenTo(e,"keydown",r,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",r,{priority:"highest",useCapture:!0}),!this._documents.has(i)&&(this.listenTo(i,"mouseup",r,{priority:"highest",useCapture:!0}),this.listenTo(i,"selectionchange",()=>{this.document.isComposing&&!Ge.isAndroid||(this._handleSelectionChange(i),this._documentIsSelectingInactivityTimeoutDebounced())}),this.listenTo(this.view.document,"compositionstart",()=>{this._handleSelectionChange(i)},{priority:"lowest"}),this._documents.add(i))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const i=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const s=this.domConverter.domSelectionToView(i);if(s.rangeCount==0){this.view.hasDomSelection=!1;return}if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.view.document.isFocused&&!this.view.document.isReadOnly){this._pendingSelectionChange.add(e);return}if(this._pendingSelectionChange.delete(e),!(this.selection.isEqual(s)&&this.domConverter.isDomSelectionCorrect(i))){if(++this._loopbackCounter>60){this._reportInfiniteLoop();return}if(!Hfe(s))this.view.forceRender();else if(this.selection.isSimilar(s))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:s,domSelection:i};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}}_clearInfiniteLoop(){this._loopbackCounter=0}}function Hfe(n){return Array.from(n.getRanges()).flatMap(t=>[t.start.root,t.end.root]).every(t=>t&&t.is("rootElement"))}class zfe extends sa{constructor(e){super(e);y(this,"domEventType",["compositionstart","compositionupdate","compositionend"]);const i=this.document;i.on("compositionstart",()=>{i.isComposing=!0}),i.on("compositionend",()=>{i.isComposing=!1})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}/** 424 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 425 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 426 */class MW{constructor(t,e={}){y(this,"_files");y(this,"_native");this._files=e.cacheFiles?hF(t):null,this._native=t}get files(){return this._files||(this._files=hF(this._native)),this._files}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}setDragImage(t,e,i){this._native.setDragImage(t,e,i)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function hF(n){const t=Array.from(n.files||[]),e=Array.from(n.items||[]);return t.length?t:e.filter(i=>i.kind==="file").map(i=>i.getAsFile())}class $fe extends sa{constructor(){super(...arguments);y(this,"domEventType","beforeinput")}onDomEvent(e){const i=e.getTargetRanges(),s=this.view,r=s.document;let o=null,a=null,l=[];if(e.dataTransfer&&(o=new MW(e.dataTransfer)),e.data!==null?a=e.data:o&&(a=o.getData("text/plain")),r.selection.isFake)l=Array.from(r.selection.getRanges()),e.preventDefault();else if(i.length)l=i.map(c=>{let u=s.domConverter.domPositionToView(c.startContainer,c.startOffset);const d=s.domConverter.domPositionToView(c.endContainer,c.endOffset);if(u&&Qi(c.startContainer)&&c.startOffset<Us){e.preventDefault();let h=Us-c.startOffset;u=u.getLastMatchingPosition(f=>!!(f.item.is("attributeElement")||f.item.is("uiElement")||f.item.is("$textProxy")&&h--),{direction:"backward",singleCharacters:!0})}if(Wfe(c.endContainer,c.endOffset)&&e.preventDefault(),u)return s.createRange(u,d);if(d)return s.createRange(d)}).filter(c=>!!c);else if(Ge.isAndroid){const c=e.target.ownerDocument.defaultView.getSelection();l=Array.from(s.domConverter.domSelectionToView(c).getRanges())}if(Ge.isAndroid&&e.inputType=="insertCompositionText"&&a&&a.endsWith(` 427`)){this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[s.createRange(l[0].end)]});return}if(["insertText","insertReplacementText"].includes(e.inputType)&&a&&a.includes(` 428`)){const c=a.split(/\n{1,2}/g);let u=l;e.preventDefault();for(let d=0;d<c.length;d++){const h=c[d];h!=""&&(this.fire(e.type,e,{data:h,dataTransfer:o,targetRanges:u,inputType:e.inputType,isComposing:e.isComposing}),u=[r.selection.getFirstRange()]),d+1<c.length&&(this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:u}),u=[r.selection.getFirstRange()])}return}this.fire(e.type,e,{data:a,dataTransfer:o,targetRanges:l,inputType:e.inputType,isComposing:e.isComposing})}}function Wfe(n,t){for(;n.parentNode;){if(mn(n)){if(t!=n.data.length)return!1}
428else if(t!=n.childNodes.length)return!1;if(t=hf(n)+1,n=n.parentNode,t<n.childNodes.length&&Qi(n.childNodes[t]))return!0}return!1}class Ufe extends ia{constructor(t){super(t),this.document.on("keydown",(e,i)=>{if(this.isEnabled&&yhe(i.keyCode)){const s=new Ch(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(s,i),s.stop.called&&e.stop()}})}observe(){}stopObserving(){}}class jfe extends ia{constructor(t){super(t);const e=this.document;e.on("keydown",(i,s)=>{if(!this.isEnabled||s.keyCode!=ft.tab||s.ctrlKey)return;const r=new Ch(e,"tab",e.selection.getFirstRange());e.fire(r,s),r.stop.called&&i.stop()})}observe(){}stopObserving(){}}class Gfe extends Ut(){constructor(e){super();y(this,"document");y(this,"domConverter");y(this,"domRoots",new Map);y(this,"_renderer");y(this,"_initialDomRootAttributes",new WeakMap);y(this,"_observers",new Map);y(this,"_writer");y(this,"_ongoingChange",!1);y(this,"_postFixersInProgress",!1);y(this,"_renderingDisabled",!1);y(this,"_hasChangedSinceTheLastRendering",!1);this.document=new EW(e),this.domConverter=new kW(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new yfe(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new SW(this.document),this.addObserver(PW),this.addObserver(UE),this.addObserver(Vfe),this.addObserver(Ffe),this.addObserver(Nfe),this.addObserver(zfe),this.addObserver(Ufe),this.addObserver($fe),this.addObserver(jfe),wfe(this),cfe(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0}),Ge.isiOS&&this.listenTo(this.document,"blur",(i,s)=>{this.domConverter.mapDomToView(s.domEvent.relatedTarget)||this.domConverter._clearDomSelection()}),this.listenTo(this.document,"mutations",(i,{mutations:s})=>{s.forEach(r=>this._renderer.markToSync(r.type,r.node))},{priority:"low"}),this.listenTo(this.document,"mutations",()=>{this.forceRender()},{priority:"lowest"})}attachDomRoot(e,i="main"){const s=this.document.getRoot(i);s._name=e.tagName.toLowerCase();const r={};for(const{name:a,value:l}of Array.from(e.attributes))r[a]=l,a==="class"?this._writer.addClass(l.split(" "),s):s.hasAttribute(a)||this._writer.setAttribute(a,l,s);this._initialDomRootAttributes.set(e,r);const o=()=>{this._writer.setAttribute("contenteditable",(!s.isReadOnly).toString(),s),s.isReadOnly?this._writer.addClass("ck-read-only",s):this._writer.removeClass("ck-read-only",s)};o(),this.domRoots.set(i,e),this.domConverter.bindElements(e,s),this._renderer.markToSync("children",s),this._renderer.markToSync("attributes",s),this._renderer.domDocuments.add(e.ownerDocument),s.on("change:children",(a,l)=>this._renderer.markToSync("children",l)),s.on("change:attributes",(a,l)=>this._renderer.markToSync("attributes",l)),s.on("change:text",(a,l)=>this._renderer.markToSync("text",l)),s.on("change:isReadOnly",()=>this.change(o)),s.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const a of this._observers.values())a.observe(e,i)}detachDomRoot(e){const i=this.domRoots.get(e);Array.from(i.attributes).forEach(({name:r})=>i.removeAttribute(r));const s=this._initialDomRootAttributes.get(i);for(const r in s)i.setAttribute(r,s[r]);this.domRoots.delete(e),this.domConverter.unbindDomElement(i);for(const r of this._observers.values())r.stopObserving(i)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let i=this._observers.get(e);if(i)return i;i=new e(this),this._observers.set(e,i);for(const[s,r]of this.domRoots)i.observe(r,s);return i.enable(),i}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:i,viewportOffset:s=20,ancestorOffset:r=20}={}){const o=this.document.selection.getFirstRange();if(!o)return;
vendor: 1,154 bytes, line 428
428const a=_s({alignToTop:e,forceScroll:i,viewportOffset:s,ancestorOffset:r});typeof s=="number"&&(s={top:s,bottom:s,left:s,right:s});const l={target:this.domConverter.viewRangeToDom(o),viewportOffset:s,ancestorOffset:r,alignToTop:e,forceScroll:i};this.fire("scrollToTheSelection",l,a),fhe(l)}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new ee("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const i=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),i}catch(i){/* istanbul ignore next -- @preserve */ee.rethrowUnexpectedError(i,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(UE).flush(),this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}
428createPositionAt(e,i){return Ee._createAt(e,i)}createPositionAfter(e){return Ee._createAfter(e)}createPositionBefore(e){return Ee._createBefore(e)}createRange(e,i){return new Je(e,i)}createRangeOn(e){return Je._createOn(e)}createRangeIn(e){return Je._createIn(e)}createSelection(...e){return new so(...e)}_disableRendering(e){this._renderingDisabled=e,e==!1&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}/** 429 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 430 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 431 */class Xc{is(){throw new Error("is() method is abstract")}}class to extends Xc{constructor(e,i,s){super();y(this,"textNode");y(this,"data");y(this,"offsetInText");if(this.textNode=e,i<0||i>e.offsetSize)throw new ee("model-textproxy-wrong-offsetintext",this);if(s<0||i+s>e.offsetSize)throw new ee("model-textproxy-wrong-length",this);this.data=e.data.substring(i,i+s),this.offsetInText=i}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const i=[];let s=e.includeSelf?this:this.parent;for(;s;)i[e.parentFirst?"push":"unshift"](s),s=s.parent;return i}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}to.prototype.is=function(n){return n==="$textProxy"||n==="model:$textProxy"||n==="textProxy"||n==="model:textProxy"};class rl{constructor(t){y(this,"direction");y(this,"boundaries");y(this,"singleCharacters");y(this,"shallow");y(this,"ignoreElementEnd");y(this,"_position");y(this,"_boundaryStartParent");y(this,"_boundaryEndParent");y(this,"_visitedParent");if(!t||!t.boundaries&&!t.startPosition)throw new ee("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if(e!="forward"&&e!="backward")throw new ee("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this._position=t.startPosition.clone():this._position=me._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(t){let e,i,s,r;do s=this.position,r=this._visitedParent,{done:e,value:i}=this.next();while(!e&&t(i));e||(this._position=s,this._visitedParent=r)}jumpTo(t){this._boundaryStartParent&&t.isBefore(this.boundaries.start)?t=this.boundaries.start:this._boundaryEndParent&&t.isAfter(this.boundaries.end)&&(t=this.boundaries.end),this._position=t.clone(),this._visitedParent=t.parent}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(i.parent===null&&e.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const s=hb(e,i),r=s||OW(e,i,s);if(r&&r.is("model:element")){if(!this.shallow)e.path.push(0),this._visitedParent=r;else{if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}return this._position=e,pu("elementStart",r,t,e,1)}if(r&&r.is("model:$text")){let o;if(this.singleCharacters)o=1;else{let c=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offset<c&&(c=this.boundaries.end.offset),o=c-e.offset}const a=e.offset-r.startOffset,l=new to(r,a,o);return e.offset+=o,this._position=e,pu("text",l,t,e,o)}return e.path.pop(),e.offset++,this._position=e,this._visitedParent=i.parent,this.ignoreElementEnd?this._next():pu("elementEnd",i,t,e)}_previous(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(i.parent===null&&e.offset===0)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};const s=e.parent,r=hb(e,s),o=r||DW(e,s,r);if(o&&o.is("model:element"))return e.offset--,this.shallow?(this._position=e,pu("elementStart",o,t,e,1)):(e.path.push(o.maxOffset),this._position=e,this._visitedParent=o,this.ignoreElementEnd?this._previous():pu("elementEnd",o,t,e));if(o&&o.is("model:$text")){let a;if(this.singleCharacters)a=1;else{let u=o.startOffset;this._boundaryStartParent==i&&this.boundaries.start.offset>u&&(u=this.boundaries.start.offset),a=e.offset-u}const l=e.offset-o.startOffset,c=new to(o,l-a,a);return e.offset-=a,this._position=e,pu("text",c,t,e,a)}return e.path.pop(),this._position=e,this._visitedParent=i.parent,pu("elementStart",i,t,e,1)}}function pu(n,t,e,i,s){return{done:!1,value:{type:n,item:t,previousPosition:e,nextPosition:i,length:s}}}class me extends Xc{constructor(e,i,s="toNone"){super();y(this,"root");y(this,"path");y(this,"stickiness");if(!e.is("element")&&!e.is("documentFragment"))throw new ee("model-position-root-invalid",e);if(!Array.isArray(i)||i.length===0)throw new ee("model-position-path-incorrect-format",e,{path:i});e.is("rootElement")?i=i.slice():(i=[...e.getPath(),...i],e=e.root),this.root=e,this.path=i,this.stickiness=s}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let i=0;i<this.path.length-1;i++)if(e=e.getChildAtOffset(this.path[i]),!e)throw new ee("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new ee("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return hb(this,this.parent)}get nodeAfter(){const e=this.parent;return OW(this,e,hb(this,e))}get nodeBefore(){const e=this.parent;return DW(this,e,hb(this,e))}get isAtStart(){return this.offset===0}get isAtEnd(){return this.offset==this.parent.maxOffset}isValid(){if(this.offset<0)return!1;let e=this.root;for(let i=0;i<this.path.length-1;i++)if(e=e.getChildAtOffset(this.path[i]),!e)return!1;return this.offset<=e.maxOffset}compareWith(e){if(this.root!=e.root)return"different";const i=li(this.path,e.path);switch(i){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[i]<e.path[i]?"before":"after"}}
431getLastMatchingPosition(e,i={}){i.startPosition=this;const s=new rl(i);return s.skip(e),s.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const i=this.parent;return i.is("element")?i.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];const i=li(this.path,e.path),s=typeof i=="string"?Math.min(this.path.length,e.path.length):i;return this.path.slice(0,s)}getCommonAncestor(e){const i=this.getAncestors(),s=e.getAncestors();let r=0;for(;i[r]==s[r]&&i[r];)r++;return r===0?null:i[r-1]}getShiftedBy(e){const i=this.clone(),s=i.offset+e;return i.offset=s<0?0:s,i}isAfter(e){return this.compareWith(e)=="after"}isBefore(e){return this.compareWith(e)=="before"}isEqual(e){return this.compareWith(e)=="same"}isTouching(e){if(this.root!==e.root)return!1;const i=Math.min(this.path.length,e.path.length);for(let s=0;s<i;s++){const r=this.path[s]-e.path[s];if(r<-1||r>1)return!1;if(r===1)return fF(e,this,s);if(r===-1)return fF(this,e,s)}return this.path.length===e.path.length?!0:this.path.length>e.path.length?dI(this.path,i):dI(e.path,i)}hasSameParentAs(e){if(this.root!==e.root)return!1;const i=this.getParentPath(),s=e.getParentPath();return li(i,s)=="same"}getTransformedByOperation(e){let i;switch(e.type){case"insert":i=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":i=this._getTransformedByMoveOperation(e);break;case"split":i=this._getTransformedBySplitOperation(e);break;case"merge":i=this._getTransformedByMergeOperation(e);break;default:i=me._createAt(this);break}return i}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const i=e.movedRange;return i.containsPosition(this)||i.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const i=e.movedRange,s=i.containsPosition(this)||i.start.isEqual(this);let r;return s?(r=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(r=r._getTransformedByDeletion(e.deletionPosition,1))):this.isEqual(e.deletionPosition)?r=me._createAt(e.deletionPosition):r=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),r}_getTransformedByDeletion(e,i){const s=me._createAt(this);if(this.root!=e.root)return s;if(li(e.getParentPath(),this.getParentPath())=="same"){if(e.offset<this.offset){if(e.offset+i>this.offset)return null;s.offset-=i}}else if(li(e.getParentPath(),this.getParentPath())=="prefix"){const r=e.path.length-1;if(e.offset<=this.path[r]){if(e.offset+i>this.path[r])return null;s.path[r]-=i}}return s}_getTransformedByInsertion(e,i){const s=me._createAt(this);if(this.root!=e.root)return s;if(li(e.getParentPath(),this.getParentPath())=="same")(e.offset<this.offset||e.offset==this.offset&&this.stickiness!="toPrevious")&&(s.offset+=i);else if(li(e.getParentPath(),this.getParentPath())=="prefix"){const r=e.path.length-1;e.offset<=this.path[r]&&(s.path[r]+=i)}return s}_getTransformedByMove(e,i,s){if(i=i._getTransformedByDeletion(e,s),e.isEqual(i))return me._createAt(this);const r=this._getTransformedByDeletion(e,s);return r===null||e.isEqual(this)&&this.stickiness=="toNext"||e.getShiftedBy(s).isEqual(this)&&this.stickiness=="toPrevious"?this._getCombined(e,i):r._getTransformedByInsertion(i,s)}_getCombined(e,i){const s=e.path.length-1,r=me._createAt(i);return r.stickiness=this.stickiness,r.offset=r.offset+this.path[s]-e.offset,r.path=[...r.path,...this.path.slice(s+1)],r}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,i,s="toNone"){if(e.is("model:position"))return new me(e.root,e.path,e.stickiness);{const r=e;if(i=="end")i=r.maxOffset;
431else{if(i=="before")return this._createBefore(r,s);if(i=="after")return this._createAfter(r,s);if(i!==0&&!i)throw new ee("model-createpositionat-offset-required",[this,e])}if(!r.is("element")&&!r.is("documentFragment"))throw new ee("model-position-parent-incorrect",[this,e]);const o=r.getPath();return o.push(i),new this(r.root,o,s)}}static _createAfter(e,i){if(!e.parent)throw new ee("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,i)}static _createBefore(e,i){if(!e.parent)throw new ee("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,i)}static fromJSON(e,i){if(e.root==="$graveyard"){const s=new me(i.graveyard,e.path);return s.stickiness=e.stickiness,s}if(!i.getRoot(e.root))throw new ee("model-position-fromjson-no-root",i,{rootName:e.root});return new me(i.getRoot(e.root),e.path,e.stickiness)}}me.prototype.is=function(n){return n==="position"||n==="model:position"};function hb(n,t){const e=t.getChildAtOffset(n.offset);return e&&e.is("$text")&&e.startOffset<n.offset?e:null}function OW(n,t,e){return e!==null?null:t.getChildAtOffset(n.offset)}function DW(n,t,e){return e!==null?null:t.getChild(t.offsetToIndex(n.offset)-1)}function fF(n,t,e){return!(e+1===n.path.length||!dI(t.path,e+1)||!Yfe(n,e+1))}function dI(n,t){for(;t<n.length;){if(n[t]!==0)return!1;t++}return!0}function Yfe(n,t){let e=n.parent,i=n.path.length-1,s=0;for(;i>=t;){if(n.path[i]+s!==e.maxOffset)return!1;s=1,i--,e=e.parent}return!0}class oe extends Xc{constructor(e,i){super();y(this,"start");y(this,"end");this.start=me._createAt(e),this.end=i?me._createAt(i):me._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new rl({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){const e=this.start.getParentPath(),i=this.end.getParentPath();return li(e,i)=="same"}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,i=!1){e.isCollapsed&&(i=!1);const s=this.containsPosition(e.start)||i&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||i&&this.end.isEqual(e.end);return s&&r}containsItem(e){const i=me._createBefore(e);return this.containsPosition(i)||this.start.isEqual(i)}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const i=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&i.push(new oe(this.start,e.start)),this.containsPosition(e.end)&&i.push(new oe(e.end,this.end))):i.push(new oe(this.start,this.end)),i}getIntersection(e){if(this.isIntersecting(e)){let i=this.start,s=this.end;return this.containsPosition(e.start)&&(i=e.start),this.containsPosition(e.end)&&(s=e.end),new oe(i,s)}return null}getJoined(e,i=!1){let s=this.isIntersecting(e);if(s||(this.start.isBefore(e.start)?s=i?this.end.isTouching(e.start):this.end.isEqual(e.start):s=i?e.end.isTouching(this.start):e.end.isEqual(this.start)),!s)return null;let r=this.start,o=this.end;return e.start.isBefore(r)&&(r=e.start),e.end.isAfter(o)&&(o=e.end),new oe(r,o)}getMinimalFlatRanges(){const e=[],i=this.start.getCommonPath(this.end).length,s=me._createAt(this.start);let r=s.parent;for(;s.path.length>i+1;){const o=r.maxOffset-s.offset;o!==0&&e.push(new oe(s,s.getShiftedBy(o))),s.path=s.path.slice(0,-1),s.offset++,r=r.parent}for(;s.path.length<=this.end.path.length;){const o=this.end.path[s.path.length-1],a=o-s.offset;a!==0&&e.push(new oe(s,s.getShiftedBy(a))),s.offset=o,s.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new rl(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const i=new rl(e);for(const s of i)yield s.item}*getPositions(e={}){e.boundaries=this;const i=new rl(e);yield i.position;for(const s of i)yield s.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new oe(this.start,this.end)]}getTransformedByOperations(e){const i=[new oe(this.start,this.end)];for(const s of e)for(let r=0;r<i.length;r++){const o=i[r].getTransformedByOperation(s);i.splice(r,1,...o),r+=o.length-1}for(let s=0;s<i.length;s++){const r=i[s];for(let o=s+1;o<i.length;o++){const a=i[o];(r.containsRange(a)||a.containsRange(r)||r.isEqual(a))&&i.splice(o,1)}}return i}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,i=this.end.nodeBefore;return e&&e.is("element")&&e===i?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,i=!1){return this._getTransformedByInsertion(e.position,e.howMany,i)}_getTransformedByMoveOperation(e,i=!1){const s=e.sourcePosition,r=e.howMany,o=e.targetPosition;return this._getTransformedByMove(s,o,r,i)}_getTransformedBySplitOperation(e){const i=this.start._getTransformedBySplitOperation(e);let s=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(s=this.end.getShiftedBy(1)),i.root!=s.root&&(s=this.end.getShiftedBy(-1)),new oe(i,s)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new oe(this.start);let i=this.start._getTransformedByMergeOperation(e),s=this.end._getTransformedByMergeOperation(e);return i.root!=s.root&&(s=this.end.getShiftedBy(-1)),i.isAfter(s)?(e.sourcePosition.isBefore(e.targetPosition)?(i=me._createAt(s),i.offset=0):(e.deletionPosition.isEqual(i)||(s=e.deletionPosition),i=e.targetPosition),new oe(i,s)):new oe(i,s)}_getTransformedByInsertion(e,i,s=!1){if(s&&this.containsPosition(e))return[new oe(this.start,e),new oe(e.getShiftedBy(i),this.end._getTransformedByInsertion(e,i))];{const r=new oe(this.start,this.end);return r.start=r.start._getTransformedByInsertion(e,i),r.end=r.end._getTransformedByInsertion(e,i),[r]}}_getTransformedByMove(e,i,s,r=!1){if(this.isCollapsed){const h=this.start._getTransformedByMove(e,i,s);return[new oe(h)]}const o=oe._createFromPositionAndShift(e,s),a=i._getTransformedByDeletion(e,s);if(this.containsPosition(i)&&!r&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const h=this.start._getTransformedByMove(e,i,s),f=this.end._getTransformedByMove(e,i,s);return[new oe(h,f)]}let l;const c=this.getDifference(o);let u=null;const d=this.getIntersection(o);if(c.length==1?u=new oe(c[0].start._getTransformedByDeletion(e,s),c[0].end._getTransformedByDeletion(e,s)):c.length==2&&(u=new oe(this.start,this.end._getTransformedByDeletion(e,s))),u?l=u._getTransformedByInsertion(a,s,d!==null||r):l=[],d){const h=new oe(d.start._getCombined(o.start,a),d.end._getCombined(o.start,a));l.length==2?l.splice(1,0,h):l.push(h)}return l}_getTransformedByDeletion(e,i){let s=this.start._getTransformedByDeletion(e,i),r=this.end._getTransformedByDeletion(e,i);return s==null&&r==null?null:(s==null&&(s=e),r==null&&(r=e),new oe(s,r))}static _createFromPositionAndShift(e,i){const s=e,r=e.getShiftedBy(i);return i>0?new this(s,r):new this(r,s)}static _createIn(e){return new this(me._createAt(e,0),me._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(me._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0)throw new ee("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const i=e[0];e.sort((o,a)=>o.start.isAfter(a.start)?1:-1);const s=e.indexOf(i),r=new this(i.start,i.end);for(let o=s-1;o>=0&&e[o].end.isEqual(r.start);o--)r.start=me._createAt(e[o].start);for(let o=s+1;o<e.length&&e[o].start.isEqual(r.end);o++)r.end=me._createAt(e[o].end);return r}static fromJSON(e,i){return new this(me.fromJSON(e.start,i),me.fromJSON(e.end,i))}}oe.prototype.is=function(n){return n==="range"||n==="model:range"};class RW extends Gt(){constructor(){super();y(this,"_modelToViewMapping",new WeakMap);y(this,"_viewToModelMapping",new WeakMap);y(this,"_viewToModelLengthCallbacks",new Map);y(this,"_markerNameToElements",new Map);y(this,"_elementToMarkerNames",new Map);y(this,"_deferredBindingRemovals",new Map);y(this,"_unboundMarkerNames",new Set);y(this,"_cache",new qfe);this.on("modelToViewPosition",(e,i)=>{if(i.viewPosition)return;const s=this._modelToViewMapping.get(i.modelPosition.parent);if(!s)throw new ee("mapping-model-position-view-parent-not-found",this,{modelPosition:i.modelPosition});i.viewPosition=this.findPositionIn(s,i.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,i)=>{if(i.modelPosition)return;const s=this.findMappedViewAncestor(i.viewPosition),r=this._viewToModelMapping.get(s),o=this._toModelOff
431set(i.viewPosition.parent,i.viewPosition.offset,s);i.modelPosition=me._createAt(r,o)},{priority:"low"})}bindElements(e,i){this._modelToViewMapping.set(e,i),this._viewToModelMapping.set(i,e)}unbindViewElement(e,i={}){const s=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const r of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(r);i.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(s)==e&&this._modelToViewMapping.delete(s))}unbindModelElement(e){const i=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(i)==e&&this._viewToModelMapping.delete(i)&&this._cache.stopTracking(i)}bindElementToMarker(e,i){const s=this._markerNameToElements.get(i)||new Set;s.add(e);const r=this._elementToMarkerNames.get(e)||new Set;r.add(i),this._markerNameToElements.set(i,s),this._elementToMarkerNames.set(e,r)}unbindElementFromMarkerName(e,i){const s=this._markerNameToElements.get(i);s&&(s.delete(e),s.size==0&&this._markerNameToElements.delete(i));const r=this._elementToMarkerNames.get(e);r&&(r.delete(i),r.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,i]of this._deferredBindingRemovals)e.root==i&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new oe(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Je(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const i={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",i),i.modelPosition}toViewPosition(e,i={}){const s={modelPosition:e,mapper:this,isPhantom:i.isPhantom};return this.fire("modelToViewPosition",s),s.viewPosition}markerNameToElements(e){const i=this._markerNameToElements.get(e);if(!i)return null;const s=new Set;for(const r of i)if(r.is("attributeElement"))for(const o of r.getElementsWithSameId())s.add(o);else s.add(r);return s}registerViewToModelLength(e,i){this._viewToModelLengthCallbacks.set(e,i)}findMappedViewAncestor(e){let i=e.parent;for(;!this._viewToModelMapping.has(i);)i=i.parent;return i}_toModelOffset(e,i,s){if(s!=e){const o=this._toModelOffset(e.parent,e.index,s),a=this._toModelOffset(e,i,e);return o+a}if(e.is("$text"))return i;let r=0;for(let o=0;o<i;o++)r+=this.getModelLength(e.getChild(o));return r}getModelLength(e){const i=[e];let s=0;for(;i.length>0;){const r=i.pop(),o=r.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(r.name);if(o)s+=o(r);else if(this._viewToModelMapping.has(r))s+=1;else if(r.is("$text"))s+=r.data.length;else{if(r.is("uiElement"))continue;for(const a of r.getChildren())i.push(a)}}return s}findPositionIn(e,i){if(i===0)return this._moveViewPositionToTextNode(new Ee(e,0));if(this._viewToModelLengthCallbacks.size==0&&this._viewToModelMapping.has(e)){const r=this._cache.getClosest(e,i);return this._findPositionStartingFrom(r.viewPosition,r.modelOffset,i,e,!0)}else return this._findPositionStartingFrom(new Ee(e,0),0,i,e,!1)}_findPositionStartingFrom(e,i,s,r,o){let a=e.parent,l=e.offset;if(a.is("$text"))return new Ee(a,s-i);let c,u=i,d=0;for(;u<s;){if(c=a.getChild(l),!c){if(a==r)throw new ee("mapping-model-offset-not-found",this,{modelOffset:s,viewContainer:r});l=a.parent.getChildIndex(a)+1,a=a.parent,o&&this._cache.save(a,l,r,u);continue}o?d=this._getModelLengthAndCache(c,r,u):d=this.getModelLength(c),u+=d,l++}let h=new Ee(a,l);if(o)for(;h.isAtEnd&&h.parent!==r&&h.parent.parent;){const f=h.parent.parent,p=f.getChildIndex(h.parent)+1;this._cache.save(f,p,r,u),h=new Ee(f,p)}return u==s?this._moveViewPositionToTextNode(h):this._findPositionStartingFrom(new Ee(c,0),u-d,s,r,o)}
431_getModelLengthAndCache(e,i,s){let r=0;if(this._viewToModelMapping.has(e))r=1;else if(e.is("$text"))r=e.data.length;else if(!e.is("uiElement"))for(const o of e.getChildren())r+=this._getModelLengthAndCache(o,i,s+r);return this._cache.save(e.parent,e.index+1,i,s+r),r}_moveViewPositionToTextNode(e){const i=e.nodeBefore,s=e.nodeAfter;return i&&i.is("view:$text")?new Ee(i,i.data.length):s&&s.is("view:$text")?new Ee(s,0):e}}class qfe extends Gt(){constructor(){super(...arguments);y(this,"_cachedMapping",new WeakMap);y(this,"_nodeToCacheListIndex",new WeakMap);y(this,"_invalidateOnChildrenChangeCallback",(e,i,s)=>{this._clearCacheInsideParent(i,s.index)});y(this,"_invalidateOnTextChangeCallback",(e,i)=>{this._clearCacheAfter(i)})}save(e,i,s,r){const o=this._cachedMapping.get(s),a=o.cacheMap.get(r);if(a){const d=e.getChild(i-1),h=a.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(a.viewPosition.nodeBefore):0;this._nodeToCacheListIndex.set(d,h);return}const c={viewPosition:new Ee(e,i),modelOffset:r};o.maxModelOffset=r>o.maxModelOffset?r:o.maxModelOffset,o.cacheMap.set(r,c);let u=o.cacheList.length-1;for(;u>=0&&o.cacheList[u].modelOffset>r;)u--;if(o.cacheList.splice(u+1,0,c),i>0){const d=e.getChild(i-1);this._nodeToCacheListIndex.set(d,u+1)}}getClosest(e,i){const s=this._cachedMapping.get(e);let r;if(s)if(i>s.maxModelOffset)r=s.cacheList[s.cacheList.length-1];else{const o=s.cacheMap.get(i);o?r=o:r=this._findInCacheList(s.cacheList,i)}else r=this.startTracking(e);return{modelOffset:r.modelOffset,viewPosition:r.viewPosition.clone()}}startTracking(e){const s={viewPosition:new Ee(e,0),modelOffset:0},r={maxModelOffset:0,cacheList:[s],cacheMap:new Map([[0,s]])};return this._cachedMapping.set(e,r),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),s}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,i){if(i==0)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{const s=e.getChild(i-1);this._clearCacheAfter(s)}}_clearCacheAll(e){const i=this._cachedMapping.get(e);i.maxModelOffset>0&&(i.maxModelOffset=0,i.cacheList.length=1,i.cacheMap.clear(),i.cacheMap.set(0,i.cacheList[0]))}_clearCacheAfter(e){const i=this._nodeToCacheListIndex.get(e);if(i===void 0){const r=e.parent;this._cachedMapping.has(r)||this._clearCacheInsideParent(r.parent,r.index);return}let s=e.parent;for(;!this._cachedMapping.has(s);)s=s.parent;this._clearCacheFromCacheIndex(s,i)}_clearCacheFromCacheIndex(e,i){i===0&&(i=1);const s=this._cachedMapping.get(e),r=s.cacheList[i-1];if(!r)return;s.maxModelOffset=r.modelOffset;const o=s.cacheList.splice(i);for(const a of o){s.cacheMap.delete(a.modelOffset);const l=a.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(l)}}_findInCacheList(e,i){let s=0,r=e.length-1,o=r-s>>1,a=e[o];for(;s<r;)a.modelOffset<i?s=o+1:r=o-1,o=s+(r-s>>1),a=e[o];return a.modelOffset<=i?a:e[o-1]}}class Kfe{constructor(){y(this,"_consumable",new Map);y(this,"_textProxyRegistry",new Map)}add(t,e){e=D_(e),t instanceof to&&(t=this._getSymbolForTextProxy(t)),this._consumable.has(t)||this._consumable.set(t,new Map),this._consumable.get(t).set(e,!0)}consume(t,e){return e=D_(e),t instanceof to&&(t=this._getSymbolForTextProxy(t)),this.test(t,e)?(this._consumable.get(t).set(e,!1),!0):!1}test(t,e){e=D_(e),t instanceof to&&(t=this._getSymbolForTextProxy(t));const i=this._consumable.get(t);if(i===void 0)return null;const s=i.get(e);return s===void 0?null:s}revert(t,e){e=D_(e),t instanceof to&&(t=this._getSymbolForTextProxy(t));const i=this.test(t,e);return i===!1?(this._consumable.get(t).set(e,!0),!0):i===!0?!1:null}verifyAllConsumed(t){const e=[];for(const[i,s]of this._consumable)for(const[r,o]of s){const a=r.split(":")[0];o&&t==a&&e.push({event:r,item:i.name||i.description})}if(e.length)throw new ee("conversion-model-consumable-not-consumed",null,{items:e})}_getSymbolForTextProxy(t){let e=null;const i=this._textProxyRegistry.get(t.startOffset);if(i){const s=i.get(t.endOffset);s&&(e=s.get(t.parent))}return e||(e=this._addSymbolForTextProxy(t)),e}_addSymbolForTextProxy(t){const e=t.startOffset,i=t.endOffset,s=t.parent,r=Symbol("$textProxy:"+t.data);let o,a;return o=this._textProxyRegistry.get(e),o||(o=new Map,this._textProxyRegistry.set(e,o)),a=o.get(i),a||(a=new Map,o.set(i,a)),a.set(s,r),r}}function D_(n){const t=n.split(":");return t[0]=="insert"?t[0]:t[0]=="addMarker"||t[0]=="removeMarker"?n:t.length>1?t[0]+":"+t[1]:t[0]}class LW extends Gt(){constructor(e){super();y(this,"_conversionApi");y(this,"_firedEventsMap");this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,i,s){const r=e.getRefreshedItems(),o=this._createConversionApi(s,r);for(const l of e.getMarkersToRemove())this._convertMarkerRemove(l.name,l.range,o);const a=this._reduceChanges(e.getChanges(),r);for(const l of a)l.type==="insert"?this._convertInsert(oe._createFromPositionAndShift(l.position,l.length),o):l.type==="reinsert"?this._convertReinsert(oe._createFromPositionAndShift(l.position,l.length),o):l.type==="remove"?this._convertRemove(l.position,l.length,l.name,o):this._convertAttribute(l.range,l.attributeKey,l.attributeOldValue,l.attributeNewValue,o);o.mapper.flushDeferredBindings();for(const l of o.mapper.flushUnboundMarkerNames()){const c=i.get(l).getRange();this._convertMarkerRemove(l,c,o),this._convertMarkerAdd(l,c,o)}for(const l of e.getMarkersToAdd())this._convertMarkerAdd(l.name,l.range,o);
431o.consumable.verifyAllConsumed("insert")}convert(e,i,s,r={}){const o=this._createConversionApi(s,void 0,r);this._convertInsert(e,o);for(const[a,l]of i)this._convertMarkerAdd(a,l,o);o.consumable.verifyAllConsumed("insert")}convertSelection(e,i,s){const r=this._createConversionApi(s);this.fire("cleanSelection",{selection:e},r);const o=e.getFirstPosition().root;if(!r.mapper.toViewElement(o))return;const a=Array.from(i.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(r.consumable,e,a),this.fire("selection",{selection:e},r),!!e.isCollapsed){for(const l of a)if(r.consumable.test(e,"addMarker:"+l.name)){const c=l.getRange();if(!Xfe(e.getFirstPosition(),l,r.mapper))continue;const u={item:e,markerName:l.name,markerRange:c};this.fire(`addMarker:${l.name}`,u,r)}for(const l of e.getAttributeKeys())if(r.consumable.test(e,"attribute:"+l)){const c={item:e,range:e.getFirstRange(),attributeKey:l,attributeOldValue:null,attributeNewValue:e.getAttribute(l)};this.fire(`attribute:${l}:$text`,c,r)}}}_convertInsert(e,i,s={}){s.doNotAddConsumables||this._addConsumablesForInsert(i.consumable,e);for(const r of e.getWalker({shallow:!0}))this._testAndFire("insert",gF(r),i)}_convertRemove(e,i,s,r){this.fire(`remove:${s}`,{position:e,length:i},r)}_convertAttribute(e,i,s,r,o){this._addConsumablesForRange(o.consumable,e,`attribute:${i}`);for(const a of e){const l={item:a.item,range:oe._createFromPositionAndShift(a.previousPosition,a.length),attributeKey:i,attributeOldValue:s,attributeNewValue:r};this._testAndFire(`attribute:${i}`,l,o)}}_convertReinsert(e,i){const s=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(i.consumable,s);for(const r of s.map(gF))this.fire(`remove:${r.item.is("element")?r.item.name:"$text"}`,{position:r.range.start,length:r.item.offsetSize,reconversion:!0},i),this._testAndFire("insert",{...r,reconversion:!0},i)}_convertMarkerAdd(e,i,s){if(i.root.rootName=="$graveyard")return;const r=`addMarker:${e}`;if(s.consumable.add(i,r),this.fire(r,{markerName:e,markerRange:i},s),!!s.consumable.consume(i,r)){this._addConsumablesForRange(s.consumable,i,r);for(const o of i.getItems()){if(!s.consumable.test(o,r))continue;const a={item:o,range:oe._createOn(o),markerName:e,markerRange:i};this.fire(r,a,s)}}}_convertMarkerRemove(e,i,s){i.root.rootName!="$graveyard"&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:i},s)}_reduceChanges(e,i){const s={changes:e,refreshedItems:i};return this.fire("reduceChanges",s),s.changes}_addConsumablesForInsert(e,i){for(const s of i){const r=s.item;if(e.test(r,"insert")===null){e.add(r,"insert");for(const o of r.getAttributeKeys())e.add(r,"attribute:"+o)}}return e}_addConsumablesForRange(e,i,s){for(const r of i.getItems())e.add(r,s);return e}_addConsumablesForSelection(e,i,s){e.add(i,"selection");for(const r of s)e.add(i,"addMarker:"+r.name);for(const r of i.getAttributeKeys())e.add(i,"attribute:"+r);return e}_testAndFire(e,i,s){const r=Jfe(e,i),o=i.item.is("$textProxy")?s.consumable._getSymbolForTextProxy(i.item):i.item,a=this._firedEventsMap.get(s),l=a.get(o);if(!l)a.set(o,new Set([r]));else if(!l.has(r))l.add(r);else return;this.fire(r,i,s)}_testAndFireAddAttributes(e,i){const s={item:e,range:oe._createOn(e)};for(const r of s.item.getAttributeKeys())s.attributeKey=r,s.attributeOldValue=null,s.attributeNewValue=s.item.getAttribute(r),this._testAndFire(`attribute:${r}`,s,i)}_createConversionApi(e,i=new Set,s={}){const r={...this._conversionApi,consumable:new Kfe,writer:e,options:s,convertItem:o=>this._convertInsert(oe._createOn(o),r),convertChildren:o=>this._convertInsert(oe._createIn(o),r,{doNotAddConsumables:!0}),convertAttributes:o=>this._testAndFireAddAttributes(o,r),canReuseView:o=>!i.has(r.mapper.toModelElement(o))};return this._firedEventsMap.set(r,new Map),r}}function Xfe(n,t,e){const i=t.getRange(),s=Array.from(n.getAncestors());return s.shift(),s.reverse(),!s.some(o=>{if(i.containsItem(o))return!!e.toViewElement(o).getCustomProperty("addHighlight")})}function Jfe(n,t){const e=t.item.is("element")?t.item.name:"$text";return`${n}:${e}`}function gF(n){return{item:n.item,range:oe._createFromPositionAndShift(n.previousPosition,n.length)}}class kh extends Xc{constructor(e){super();y(this,"parent",null);y(this,"_attrs");y(this,"_index",null);y(this,"_startOffset",null);this._attrs=Qo(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return this.startOffset===null?null:this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.parent===null?!1:this.root.isAttached()}getPath(){const e=[];let i=this;for(;i.parent;)e.unshift(i.startOffset),i=i.parent;return e}getAncestors(e={}){const i=[];let s=e.includeSelf?this:this.parent;for(;s;)i[e.parentFirst?"push":"unshift"](s),s=s.parent;return i}getCommonAncestor(e,i={}){const s=this.getAncestors(i),r=e.getAncestors(i);let o=0;for(;s[o]==r[o]&&s[o];)o++;return o===0?null:s[o-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const i=this.getPath(),s=e.getPath(),r=li(i,s);switch(r){case"prefix":return!0;case"extension":return!1;default:return i[r]<s[r]}}isAfter(e){return this==e||this.root!==e.root?!1:!this.isBefore(e)}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((i,s)=>(i[s[0]]=s[1],i),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,i){this._attrs.set(e,i)}_setAttributesTo(e){this._attrs=Qo(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}kh.prototype.is=function(n){return n==="node"||n==="model:node"};class Ws extends Gt(Xc){constructor(...e){super();y(this,"_lastRangeBackward",!1);y(this,"_attrs",new Map);y(this,"_ranges",[]);e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}
431get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return this._ranges.length===1?this._ranges[0].isCollapsed:!1}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const i of this._ranges){let s=!1;for(const r of e._ranges)if(i.isEqual(r)){s=!0;break}if(!s)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new oe(e.start,e.end)}getFirstRange(){let e=null;for(const i of this._ranges)(!e||i.start.isBefore(e.start))&&(e=i);return e?new oe(e.start,e.end):null}getLastRange(){let e=null;for(const i of this._ranges)(!e||i.end.isAfter(e.end))&&(e=i);return e?new oe(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[i,s,r]=e;if(typeof s=="object"&&(r=s,s=void 0),i===null)this._setRanges([]);else if(i instanceof Ws)this._setRanges(i.getRanges(),i.isBackward);else if(i&&typeof i.getRanges=="function")this._setRanges(i.getRanges(),i.isBackward);else if(i instanceof oe)this._setRanges([i],!!r&&!!r.backward);else if(i instanceof me)this._setRanges([new oe(i)]);else if(i instanceof kh){const o=!!r&&!!r.backward;let a;if(s=="in")a=oe._createIn(i);else if(s=="on")a=oe._createOn(i);else if(s!==void 0)a=new oe(me._createAt(i,s));else throw new ee("model-selection-setto-required-second-parameter",[this,i]);this._setRanges([a],o)}else if(qs(i))this._setRanges(i,r&&!!r.backward);else throw new ee("model-selection-setto-not-selectable",[this,i])}_setRanges(e,i=!1){const s=Array.from(e),r=s.some(o=>{if(!(o instanceof oe))throw new ee("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(a=>!a.isEqual(o))});s.length===this._ranges.length&&!r||(this._replaceAllRanges(s),this._lastRangeBackward=!!i,this.fire("change:range",{directChange:!0}))}setFocus(e,i){if(this.anchor===null)throw new ee("model-selection-setfocus-no-ranges",[this,e]);const s=me._createAt(e,i);if(s.compareWith(this.focus)=="same")return;const r=this.anchor;this._ranges.length&&this._popRange(),s.compareWith(r)=="before"?(this._pushRange(new oe(s,r)),this._lastRangeBackward=!0):(this._pushRange(new oe(r,s)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,i){this.getAttribute(e)!==i&&(this._attrs.set(e,i),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const i of this.getRanges()){const s=mF(i.start,e);Qfe(s,i)&&(yield s);const r=i.getWalker();for(const a of r){const l=a.item;a.type=="elementEnd"&&Zfe(l,e,i)?yield l:a.type=="elementStart"&&l.is("model:element")&&l.root.document.model.schema.isBlock(l)&&r.jumpTo(me._createAt(l,"end"))}const o=mF(i.end,e);ege(o,i)&&(yield o)}}containsEntireContent(e=this.anchor.root){const i=me._createAt(e,0),s=me._createAt(e,"end");return i.isTouching(this.getFirstPosition())&&s.isTouching(this.getLastPosition())}toJSON(){const e={ranges:Array.from(this.getRanges()).map(s=>s.toJSON())},i=Object.fromEntries(this.getAttributes());return Object.keys(i).length&&(e.attributes=i),this.isBackward&&(e.isBackward=!0),e}_pushRange(e){this._checkRange(e),this._ranges.push(new oe(e.start,e.end))}_checkRange(e){for(let i=0;i<this._ranges.length;i++)if(e.isIntersecting(this._ranges[i]))throw new ee("model-selection-range-intersects",[this,e],{addedRange:e,intersectingRange:this._ranges[i]})}_replaceAllRanges(e){this._removeAllRanges();for(const i of e)this._pushRange(i)}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}Ws.prototype.is=function(n){return n==="selection"||n==="model:selection"};function FW(n,t){return t.has(n)?!1:(t.add(n),n.root.document.model.schema.isBlock(n)&&!!n.parent)}function Zfe(n,t,e){return FW(n,t)&&nO(n,e)}function mF(n,t){const i=n.parent.root.document.model.schema,s=n.parent.getAncestors({parentFirst:!0,includeSelf:!0});let r=!1;const o=s.find(a=>r?!1:(r=i.isLimit(a),!r&&FW(a,t)));
431return s.forEach(a=>t.add(a)),o}function nO(n,t){const e=tge(n);return e?!t.containsRange(oe._createOn(e),!0):!0}function Qfe(n,t){return n?t.isCollapsed||n.isEmpty?!0:t.start.isTouching(me._createAt(n,n.maxOffset))?!1:nO(n,t):!1}function ege(n,t){return n?t.isCollapsed||n.isEmpty?!0:t.end.isTouching(me._createAt(n,0))?!1:nO(n,t):!1}function tge(n){const t=n.root.document.model.schema;let e=n.parent;for(;e;){if(t.isBlock(e))return e;e=e.parent}}class js extends Gt(oe){constructor(t,e){super(t,e),nge.call(this)}detach(){this.stopListening()}toRange(){return new oe(this.start,this.end)}static fromRange(t){return new js(t.start,t.end)}}js.prototype.is=function(n){return n==="liveRange"||n==="model:liveRange"||n=="range"||n==="model:range"};function nge(){this.listenTo(this.root.document.model,"applyOperation",(n,t)=>{const e=t[0];e.isDocumentOperation&&ige.call(this,e)},{priority:"low"})}function ige(n){const t=this.getTransformedByOperation(n),e=oe._createFromRanges(t),i=!e.isEqual(this),s=sge(this,n);let r=null;if(i){e.root.rootName=="$graveyard"&&(n.type=="remove"?r=n.sourcePosition:r=n.deletionPosition);const o=this.toRange();this.start=e.start,this.end=e.end,this.fire("change:range",o,{deletionPosition:r})}else s&&this.fire("change:content",this.toRange(),{deletionPosition:r})}function sge(n,t){switch(t.type){case"insert":return n.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return n.containsPosition(t.sourcePosition)||n.start.isEqual(t.sourcePosition)||n.containsPosition(t.targetPosition);case"split":return n.containsPosition(t.splitPosition)||n.containsPosition(t.insertionPosition)}return!1}class tn extends kh{constructor(e,i){super(i);y(this,"_data");this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new tn(this.data,this.getAttributes())}static fromJSON(e){return new tn(e.data,e.attributes)}}tn.prototype.is=function(n){return n==="$text"||n==="model:$text"||n==="text"||n==="model:text"||n==="node"||n==="model:node"};const Wb="selection:";class uo extends Gt(Xc){constructor(e){super();y(this,"_selection");this._selection=new rge(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}toJSON(){return this._selection.toJSON()}_setFocus(e,i){this._selection.setFocus(e,i)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,i){this._selection.setAttribute(e,i)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Wb+e}static _isStoreAttributeKey(e){return e.startsWith(Wb)}}uo.prototype.is=function(n){return n==="selection"||n=="model:selection"||n=="documentSelection"||n=="model:documentSelection"};class rge extends Ws{constructor(e){super();y(this,"markers",new er({idProperty:"name"}));y(this,"_model");y(this,"_document");y(this,"_attributePriority",new Map);y(this,"_selectionRestorePosition",null);y(this,"_hasChangedRange",!1);y(this,"_overriddenGravityRegister",new Set);y(this,"_observedMarkers",new Set);this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(i,s)=>{const r=s[0];!r.isDocumentOperation||r.type=="marker"||r.type=="rename"||r.type=="noop"||(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>
431{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(i,s,r,o)=>{this._updateMarker(s,o)}),this.listenTo(this._document,"change",(i,s)=>{oge(this._model,s)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(...e){super.setTo(...e),this._updateAttributes(!0),this.updateMarkers()}setFocus(e,i){super.setFocus(e,i),this._updateAttributes(!0),this.updateMarkers()}setAttribute(e,i){if(this._setAttribute(e,i)){const s=[e];this.fire("change:attribute",{attributeKeys:s,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const i=[e];this.fire("change:attribute",{attributeKeys:i,directChange:!0})}}overrideGravity(){const e=is();return this._overriddenGravityRegister.add(e),this._overriddenGravityRegister.size===1&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new ee("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(e){this._observedMarkers.add(e),this.updateMarkers()}_replaceAllRanges(e){this._validateSelectionRanges(e),super._replaceAllRanges(e)}_popRange(){this._ranges.pop().detach()}_pushRange(e){const i=this._prepareRange(e);i&&this._ranges.push(i)}toJSON(){const e=super.toJSON();return this.markers.length&&(e.markers=this.markers.map(i=>i.toJSON())),e}_validateSelectionRanges(e){for(const i of e)if(!this._document._validateSelectionRange(i))throw new ee("document-selection-wrong-position",this,{range:i})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const i=js.fromRange(e);return i.on("change:range",(s,r,o)=>{if(this._hasChangedRange=!0,i.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const a=this._ranges.indexOf(i);this._ranges.splice(a,1),i.detach()}}),i}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let i=!1;for(const r of this._model.markers){const o=r.name.split(":",1)[0];if(!this._observedMarkers.has(o))continue;const a=r.getRange();for(const l of this.getRanges())a.containsRange(l,!l.isCollapsed)&&e.push(r)}const s=Array.from(this.markers);for(const r of e)this.markers.has(r)||(this.markers.add(r),i=!0);for(const r of Array.from(this.markers))e.includes(r)||(this.markers.remove(r),i=!0);i&&this.fire("change:marker",{oldMarkers:s,directChange:!1})}_updateMarker(e,i){const s=e.name.split(":",1)[0];if(!this._observedMarkers.has(s))return;let r=!1;const o=Array.from(this.markers),a=this.markers.has(e);if(!i)a&&(this.markers.remove(e),r=!0);else{let l=!1;for(const c of this.getRanges())if(i.containsRange(c,!c.isCollapsed)){l=!0;break}l&&!a?(this.markers.add(e),r=!0):!l&&a&&(this.markers.remove(e),r=!0)}r&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(e){const i=Qo(this._getSurroundingAttributes()),s=Qo(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[o,a]of this._attributePriority)a=="low"&&(this._attrs.delete(o),this._attributePriority.delete(o));this._setAttributesTo(i);const r=[];for(const[o,a]of this.getAttributes())(!s.has(o)||s.get(o)!==a)&&r.push(o);for(const[o]of s)this.hasAttribute(o)||r.push(o);r.length>0&&this.fire("change:attribute",{attributeKeys:r,directChange:!1})}_setAttribute(e,i,s=!0){const r=s?"normal":"low";return r=="low"&&this._attributePriority.get(e)=="normal"||super.getAttribute(e)===i?!1:(this._attrs.set(e,i),this._attributePriority.set(e,r),!0)}_removeAttribute(e,i=!0){const s=i?"normal":"low";return s=="low"&&this._attributePriority.get(e)=="normal"||(this._attributePriority.set(e,s),!super.hasAttribute(e))?!1:(this._attrs.delete(e),!0)}_setAttributesTo(e){const i=new Set;for(const[s,r]of this.getAttributes())e.get(s)!==r&&this._removeAttribute(s,!1);for(const[s,r]of e)this._setAttribute(s,r,!1)&&i.add(s);return i}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const i of e.getAttributeKeys())i.startsWith(Wb)&&(yield[i.substr(Wb.length),e.getAttribute(i)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),i=this._model.schema;if(e.root.rootName=="$graveyard")return null;let s=null;if(this.isCollapsed){const r=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(s=pp(r,i)),s||(s=pp(o,i)),!this.isGravityOverridden&&!s){let a=r;for(;a&&!s;)a=a.previousSibling,s=pp(a,i)}if(!s){let a=o;for(;a&&!s;)a=a.nextSibling,s=pp(a,i)}s||(s=this.getStoredAttributes())}else{const r=this.getFirstRange();for(const o of r){if(o.item.is("element")&&i.isObject(o.item)){s=pp(o.item,i);break}if(o.type=="text"){s=o.item.getAttributes();break}}}return s}_fixGraveyardSelection(e){const i=this._model.schema.getNearestSelectionRange(e);i&&this._pushRange(i)}}function pp(n,t){if(!n)return null;if(n instanceof to||n instanceof tn)return n.getAttributes();if(!t.isInline(n))return null;if(!t.isObject(n))return[];const e=[];for(const[i,s]of n.getAttributes())t.checkAttribute("$text",i)&&t.getAttributeProperties(i).copyFromObject!==!1&&e.push([i,s]);return e}function oge(n,t){const e=n.document.differ;for(const i of e.getChanges()){if(i.type!="insert")continue;const s=i.position.parent;i.length===s.maxOffset&&n.enqueueChange(t,o=>{const a=Array.from(s.getAttributeKeys()).filter(l=>l.startsWith(Wb));for(const l of a)o.removeAttribute(l,s)})}}class fb{constructor(t){y(this,"_nodes",[]);y(this,"_offsetToNode",[]);t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(t){return this._nodes[t]||null}getNodeAtOffset(t){return this._offsetToNode[t]||null}getNodeIndex(t){return t.index}getNodeStartOffset(t){return t.startOffset}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];
431if(!e)throw new ee("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){if(t==this._offsetToNode.length)return this._nodes.length;const e=this._offsetToNode[t];if(!e)throw new ee("model-nodelist-offset-out-of-bounds",this,{offset:t,nodeList:this});return this.getNodeIndex(e)}_insertNodes(t,e){const i=[];for(const r of e){if(!(r instanceof kh))throw new ee("model-nodelist-insertnodes-not-node",this);i.push(r)}let s=this.indexToOffset(t);KL(this._nodes,i,t),KL(this._offsetToNode,age(i),s);for(let r=t;r<this._nodes.length;r++)this._nodes[r]._index=r,this._nodes[r]._startOffset=s,s+=this._nodes[r].offsetSize}_removeNodes(t,e=1){if(e==0)return[];let i=this.indexToOffset(t);const s=this._nodes.splice(t,e),r=s[s.length-1],o=r.startOffset+r.offsetSize-i;this._offsetToNode.splice(i,o);for(const a of s)a._index=null,a._startOffset=null;for(let a=t;a<this._nodes.length;a++)this._nodes[a]._index=a,this._nodes[a]._startOffset=i,i+=this._nodes[a].offsetSize;return s}_removeNodesArray(t){if(t.length==0)return;for(const i of t)i._index=null,i._startOffset=null;this._nodes=this._nodes.filter(i=>i.index!==null),this._offsetToNode=this._offsetToNode.filter(i=>i.index!==null);let e=0;for(let i=0;i<this._nodes.length;i++)this._nodes[i]._index=i,this._nodes[i]._startOffset=e,e+=this._nodes[i].offsetSize}toJSON(){return this._nodes.map(t=>t.toJSON())}}function age(n){const t=[];let e=0;for(const i of n)for(let s=0;s<i.offsetSize;s++)t[e++]=i;return t}class Kt extends kh{constructor(e,i,s){super(i);y(this,"name");y(this,"_children",new fb);this.name=e,s&&this._insertChild(0,s)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let i=this;for(const s of e)i=i.getChildAtOffset(s);return i}findAncestor(e,i={}){let s=i.includeSelf?this:this.parent;for(;s;){if(s.name===e)return s;s=s.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const i of this._children)e.children.push(i.toJSON())}return e}_clone(e=!1){const i=e?cge(this._children):void 0;return new Kt(this.name,this.getAttributes(),i)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,i){const s=lge(i);for(const r of s)r.parent!==null&&r._remove(),r.parent=this;this._children._insertNodes(e,s)}_removeChildren(e,i=1){const s=this._children._removeNodes(e,i);for(const r of s)r.parent=null;return s}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const i of e)i.parent=null}static fromJSON(e){let i;if(e.children){i=[];for(const s of e.children)s.name?i.push(Kt.fromJSON(s)):i.push(tn.fromJSON(s))}return new Kt(e.name,e.attributes,i)}}Kt.prototype.is=function(n,t){return t?t===this.name&&(n==="element"||n==="model:element"):n==="element"||n==="model:element"||n==="node"||n==="model:node"};function lge(n){if(typeof n=="string")return[new tn(n)];qs(n)||(n=[n]);const t=[];for(const e of n)typeof e=="string"?t.push(new tn(e)):e instanceof to?t.push(new tn(e.data,e.getAttributes())):t.push(e);return t}function cge(n){const t=[];for(const e of n)t.push(e._clone(!0));return t}/** 432 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 433 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 434 */class NW{constructor(t){y(this,"_dispatchers");this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}class uge extends NW{elementToElement(t){return this.add(kge(t))}elementToStructure(t){return this.add(Ige(t))}attributeToElement(t){return this.add(Pge(t))}attributeToAttribute(t){return this.add(Mge(t))}markerToElement(t){return this.add(Oge(t))}markerToHighlight(t){return this.add(Rge(t))}markerToData(t){return this.add(Dge(t))}}function BW(){return(n,t,e)=>{if(!e.consumable.consume(t.item,n.name))return;const i=e.writer,s=e.mapper.toViewPosition(t.range.start),r=i.createText(t.item.data);i.insert(s,r)}}function VW(){return(n,t,e)=>{e.convertAttributes(t.item),!t.reconversion&&t.item.is("element")&&!t.item.isEmpty&&e.convertChildren(t.item)}}function dge(){return(n,t,e)=>{if(t.reconversion)return;const i=e.mapper.toViewPosition(t.position),s=t.position.getShiftedBy(t.length),r=e.mapper.toViewPosition(s,{isPhantom:!0}),o=e.writer.createRange(i,r);zW(o.getTrimmed(),e)}}function HW(n,t){const e=n.createAttributeElement("span",t.attributes);return t.classes&&e._addClass(t.classes),typeof t.priority=="number"&&(e._priority=t.priority),e._id=t.id,e}function hge(){return(n,t,e)=>{const i=t.selection;if(i.isCollapsed||!e.consumable.consume(i,"selection"))return;const s=[];for(const r of i.getRanges())s.push(e.mapper.toViewRange(r));e.writer.setSelection(s,{backward:i.isBackward})}}
vendor: 6,050 bytes, line 434
434function fge(){return(n,t,e)=>{const i=t.selection;if(!i.isCollapsed||!e.consumable.consume(i,"selection"))return;const s=e.writer,r=i.getFirstPosition(),o=e.mapper.toViewPosition(r),a=s.breakAttributes(o);s.setSelection(a)}}function gge(){return(n,t,e)=>{const i=e.writer,s=i.document.selection;for(const r of s.getRanges())r.isCollapsed&&r.end.parent.isAttached()&&e.writer.mergeAttributes(r.start);i.setSelection(null)}}function mge(n){return(t,e,i)=>{if(!i.consumable.test(e.item,t.name))return;const s=n(e.attributeOldValue,i,e),r=n(e.attributeNewValue,i,e);if(!s&&!r)return;i.consumable.consume(e.item,t.name);const o=i.writer,a=o.document.selection;if(e.item instanceof Ws||e.item instanceof uo)o.wrap(a.getFirstRange(),r);else{let l=i.mapper.toViewRange(e.range);e.attributeOldValue!==null&&s&&(l=o.unwrap(l,s)),e.attributeNewValue!==null&&r&&o.wrap(l,r)}}}function pge(n,t=zge){return(e,i,s)=>{if(!t(i.item,s.consumable,{preflight:!0}))return;const r=n(i.item,s,i);if(!r)return;t(i.item,s.consumable);const o=i.reconversion&&$W(i.item,s)||s.mapper.toViewPosition(i.range.start);s.mapper.bindElements(i.item,r),s.writer.insert(o,r),s.convertAttributes(i.item),YW(r,i.item.getChildren(),s,{reconversion:i.reconversion})}}function bge(n,t){return(e,i,s)=>{if(!t(i.item,s.consumable,{preflight:!0}))return;const r=new Map;s.writer._registerSlotFactory(Nge(i.item,r,s));const o=n(i.item,s,i);if(s.writer._clearSlotFactory(),!o)return;Bge(i.item,r,s),t(i.item,s.consumable);const a=i.reconversion&&$W(i.item,s)||s.mapper.toViewPosition(i.range.start);s.mapper.bindElements(i.item,o),s.writer.insert(a,o),s.convertAttributes(i.item),Vge(o,r,s,{reconversion:i.reconversion})}}function wge(n){return(t,e,i)=>{e.isOpening=!0;const s=n(e,i);e.isOpening=!1;const r=n(e,i);if(!s||!r)return;const o=e.markerRange;if(o.isCollapsed&&!i.consumable.consume(o,t.name))return;for(const c of o)if(!i.consumable.consume(c.item,t.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(o.start),s),i.mapper.bindElementToMarker(s,e.markerName),o.isCollapsed||(l.insert(a.toViewPosition(o.end),r),i.mapper.bindElementToMarker(r,e.markerName)),t.stop()}}function zW(n,t){const e=t.writer.remove(n);for(const i of t.writer.createRangeIn(e).getItems())t.mapper.unbindViewElement(i,{defer:!0});return n.start}function $W(n,t){const e=t.mapper.toViewElement(n);return e&&zW(t.writer.createRangeOn(e),t)}function vge(){return(n,t,e)=>{const i=e.mapper.markerNameToElements(t.markerName);if(i){for(const s of i)e.mapper.unbindElementFromMarkerName(s,t.markerName),e.writer.clear(e.writer.createRangeOn(s),s);e.writer.clearClonedElementsGroup(t.markerName),n.stop()}}}function yge(n){return(t,e,i)=>{const s=n(e.markerName,i);if(!s)return;const r=e.markerRange;i.consumable.consume(r,t.name)&&(pF(r,!1,i,e,s),pF(r,!0,i,e,s),t.stop())}}function pF(n,t,e,i,s){const r=t?n.start:n.end,o=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(o||a){let c,u;t&&o||!t&&!a?(c=o,u=!0):(c=a,u=!1);const d=e.mapper.toViewElement(c);if(d){_ge(d,t,u,e,i,s);return}}const l=e.mapper.toViewPosition(r);Ege(l,t,e,i,s)}function _ge(n,t,e,i,s,r){const o=`data-${r.group}-${t?"start":"end"}-${e?"before":"after"}`,a=n.hasAttribute(o)?n.getAttribute(o).split(","):[];a.unshift(r.name),i.writer.setAttribute(o,a.join(","),n),i.mapper.bindElementToMarker(n,s.markerName)}function Ege(n,t,e,i,s){const r=`${s.group}-${t?"start":"end"}`,o=s.name?{name:s.name}:null,a=e.writer.createUIElement(r,o);e.writer.insert(n,a),e.mapper.bindElementToMarker(a,i.markerName)}function Sge(n){return(t,e,i)=>{const s=n(e.markerName,i);if(!s)return;const r=i.mapper.markerNameToElements(e.markerName);if(!r)return;for(const a of r)i.mapper.unbindElementFromMarkerName(a,e.markerName),a.is("containerElement")?(o(`data-${s.group}-start-before`,a),o(`data-${s.group}-start-after`,a),o(`data-${s.group}-end-before`,a),o(`data-${s.group}-end-after`,a)):i.writer.clear(i.writer.createRangeOn(a),a);i.writer.clearClonedElementsGroup(e.markerName),t.stop();function o(a,l){if(l.hasAttribute(a)){const c=new Set(l.getAttribute(a).split(","));c.delete(s.name),c.size==0?i.writer.removeAttribute(a,l):i.writer.setAttribute(a,Array.from(c).join(","),l)}}}}function Tge(n){return(t,e,i)=>{if(!i.consumable.test(e.item,t.name))return;const s=n(e.attributeOldValue,i,e),r=n(e.attributeNewValue,i,e);if(!s&&!r)return;i.consumable.consume(e.item,t.name);const o=i.mapper.toViewElement(e.item),a=i.writer;if(!o)throw new ee("conversion-attribute-to-attribute-on-text",i.dispatcher,e);if(e.attributeOldValue!==null&&s){let l=s.value;s.key=="style"&&(typeof s.value=="string"?l=new db(a.document.stylesProcessor).setTo(s.value).getStylesEntries().map(([c])=>c):l=Object.keys(s.value)),a.removeAttribute(s.key,l,o)}if(e.attributeNewValue!==null&&r){let l=r.value;r.key=="style"&&typeof r.value=="string"&&(l=Object.fromEntries(new db(a.document.stylesProcessor).setTo(r.value).getStylesEntries())),a.setAttribute(r.key,l,!1,o)}}}function xge(n){return(t,e,i)=>{if(!e.item||!(e.item instanceof Ws||e.item instanceof uo)&&!e.item.is("$textProxy"))return;const s=iO(n,e,i);if(!s||!i.consumable.consume(e.item,t.name))return;const r=i.writer,o=HW(r,s),a=r.document.selection;if(e.item instanceof Ws||e.item instanceof uo)r.wrap(a.getFirstRange(),o);else{const l=i.mapper.toViewRange(e.range),c=r.wrap(l,o);for(const u of c.getItems())if(u.is("attributeElement")&&u.isSimilar(o)){i.mapper.bindElementToMarker(u,e.markerName);break}}}}function Age(n){return(t,e,i)=>{if(!e.item||!(e.item instanceof Kt))return;const s=iO(n,e,i);if(!s||!i.consumable.test(e.item,t.name))return;const r=i.mapper.toViewElement(e.item);if(r&&r.getCustomProperty("addHighlight")){i.consumable.consume(e.item,t.name);for(const a of oe._createIn(e.item))i.consumable.consume(a.item,t.name);r.getCustomProperty("addHighlight")(r,s,i.writer),i.mapper.bindElementToMarker(r,e.markerName)}}}function Cge(n){return(t,e,i)=>{if(e.markerRange.isCollapsed)return;const s=iO(n,e,i);if(!s)return;
434const r=HW(i.writer,s),o=i.mapper.markerNameToElements(e.markerName);if(o){for(const a of o)i.mapper.unbindElementFromMarkerName(a,e.markerName),a.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(a),r):a.getCustomProperty("removeHighlight")(a,s.id,i.writer);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}}function kge(n){const t=WW(n.model),e=Ub(n.view,"container");return t.attributes.length&&(t.children=!0),i=>{i.on(`insert:${t.name}`,pge(e,GW(t)),{priority:n.converterPriority||"normal"}),(t.children||t.attributes.length)&&i.on("reduceChanges",jW(t),{priority:"low"})}}function Ige(n){const t=WW(n.model),e=Ub(n.view,"container");return t.children=!0,i=>{if(i._conversionApi.schema.checkChild(t.name,"$text"))throw new ee("conversion-element-to-structure-disallowed-text",i,{elementName:t.name});i.on(`insert:${t.name}`,bge(e,GW(t)),{priority:n.converterPriority||"normal"}),i.on("reduceChanges",jW(t),{priority:"low"})}}function Pge(n){n=_s(n);let t=n.model;typeof t=="string"&&(t={key:t});let e=`attribute:${t.key}`;if(t.name&&(e+=":"+t.name),t.values)for(const s of t.values)n.view[s]=Ub(n.view[s],"attribute");else n.view=Ub(n.view,"attribute");const i=UW(n);return s=>{s.on(e,mge(i),{priority:n.converterPriority||"normal"})}}function Mge(n){n=_s(n);let t=n.model;typeof t=="string"&&(t={key:t});let e=`attribute:${t.key}`;if(t.name&&(e+=":"+t.name),t.values)for(const s of t.values)n.view[s]=bF(n.view[s]);else n.view=bF(n.view);const i=UW(n);return s=>{s.on(e,Tge(i),{priority:n.converterPriority||"normal"})}}function Oge(n){const t=Ub(n.view,"ui");return e=>{e.on(`addMarker:${n.model}`,wge(t),{priority:n.converterPriority||"normal"}),e.on(`removeMarker:${n.model}`,vge(),{priority:n.converterPriority||"normal"})}}function Dge(n){n=_s(n);const t=n.model;let e=n.view;return e||(e=i=>({group:t,name:i.substr(n.model.length+1)})),i=>{i.on(`addMarker:${t}`,yge(e),{priority:n.converterPriority||"normal"}),i.on(`removeMarker:${t}`,Sge(e),{priority:n.converterPriority||"normal"})}}function Rge(n){return t=>{t.on(`addMarker:${n.model}`,xge(n.view),{priority:n.converterPriority||"normal"}),t.on(`addMarker:${n.model}`,Age(n.view),{priority:n.converterPriority||"normal"}),t.on(`removeMarker:${n.model}`,Cge(n.view),{priority:n.converterPriority||"normal"})}}function WW(n){return typeof n=="string"&&(n={name:n}),{name:n.name,attributes:n.attributes?bn(n.attributes):[],children:!!n.children}}function Ub(n,t){return typeof n=="function"?n:(e,i)=>Lge(n,i,t)}function Lge(n,t,e){typeof n=="string"&&(n={name:n});let i;const s=t.writer,r=Object.assign({},n.attributes);if(e=="container")i=s.createContainerElement(n.name,r);else if(e=="attribute"){const o={priority:n.priority||oh.DEFAULT_PRIORITY};i=s.createAttributeElement(n.name,r,o)}else i=s.createUIElement(n.name,r);if(n.styles){const o=Object.keys(n.styles);for(const a of o)s.setStyle(a,n.styles[a],i)}if(n.classes){const o=n.classes;if(typeof o=="string")s.addClass(o,i);else for(const a of o)s.addClass(a,i)}return i}function UW(n){return n.model.values?(t,e,i)=>{const s=n.view[t];return s?s(t,e,i):null}:n.view}function bF(n){return typeof n=="string"?t=>({key:n,value:t}):typeof n=="object"?n.value?()=>n:t=>({key:n.key,value:t}):n}function iO(n,t,e){const i=typeof n=="function"?n(t,e):{...n};return i?(i.priority||(i.priority=10),i.id||(i.id=t.markerName),i):null}function Fge(n){return(t,e)=>{if(!t.is("element",n.name))return!1;if(e.type=="attribute"){if(n.attributes.includes(e.attributeKey))return!0}else{/* istanbul ignore else: This is always true because otherwise it would not register a reducer callback. -- @preserve */if(n.children)return!0}return!1}}function jW(n){const t=Fge(n);return(e,i)=>{const s=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const r of i.changes){const o=r.type=="attribute"?r.range.start.nodeAfter:r.position.parent;if(!o||!t(o,r)||r.type=="reinsert"){s.push(r);continue}if(r.type=="insert"&&r.action=="rename"&&i.refreshedItems.add(r.position.nodeAfter),!i.reconvertedElements.has(o)){i.reconvertedElements.add(o);const a=me._createBefore(o);let l=s.length;for(let c=s.length-1;c>=0;c--){const u=s[c],h=(u.type=="attribute"?u.range.start:u.position).c
vendor: 6,010 bytes, lines 434-437
434ompareWith(a);if(h=="before"||u.type=="remove"&&h=="same")break;l=c}s.splice(l,0,{type:"reinsert",name:o.name,position:a,length:1})}}i.changes=s}}function GW(n){return(t,e,i={})=>{const s=["insert"];for(const r of n.attributes)t.hasAttribute(r)&&s.push(`attribute:${r}`);return s.every(r=>e.test(t,r))?(i.preflight||s.forEach(r=>e.consume(t,r)),!0):!1}}function Nge(n,t,e){return(i,s)=>{const r=i.createContainerElement("$slot");let o=null;if(s==="children")o=Array.from(n.getChildren());else if(typeof s=="function")o=Array.from(n.getChildren()).filter(a=>s(a));else throw new ee("conversion-slot-mode-unknown",e.dispatcher,{modeOrFilter:s});return t.set(r,o),r}}function Bge(n,t,e){const i=Array.from(t.values()).flat(),s=new Set(i);if(s.size!=i.length)throw new ee("conversion-slot-filter-overlap",e.dispatcher,{element:n});if(s.size!=n.childCount)throw new ee("conversion-slot-filter-incomplete",e.dispatcher,{element:n})}function Vge(n,t,e,i){e.mapper.on("modelToViewPosition",o,{priority:"highest"});let s=null,r=null;for([s,r]of t)YW(n,r,e,i),e.writer.setCustomProperty("$structureSlotParent",!0,s.parent),e.writer.move(e.writer.createRangeIn(s),e.writer.createPositionBefore(s)),e.writer.remove(s);e.mapper.off("modelToViewPosition",o);function o(a,l){const c=l.modelPosition.nodeAfter,u=r.indexOf(c);u<0||(l.viewPosition=l.mapper.findPositionIn(s,u))}}function YW(n,t,e,i){for(const s of t)Hge(n.root,s,e,i)||e.convertItem(s)}function Hge(n,t,e,i){const{writer:s,mapper:r}=e;if(!i.reconversion)return!1;const o=r.toViewElement(t);return!o||o.root==n||!e.canReuseView(o)?!1:(s.move(s.createRangeOn(o),r.toViewPosition(me._createBefore(t))),!0)}function zge(n,t,{preflight:e}={}){return e?t.test(n,"insert"):t.consume(n,"insert")}/** 435 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 436 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 437 */function qW(n){const{schema:t,document:e}=n.model;for(const i of e.getRoots())if(i.isEmpty&&!t.checkChild(i,"$text")&&t.checkChild(i,"paragraph"))return n.insertElement("paragraph",i),!0;return!1}function KW(n,t,e){const i=e.createContext(n);return!(!e.checkChild(i,"paragraph")||!e.checkChild(i.push("paragraph"),t))}function XW(n,t){const e=t.createElement("paragraph");return t.insert(e,n),t.createPositionAt(e,0)}class $ge extends NW{elementToElement(t){return this.add(JW(t))}elementToAttribute(t){return this.add(jge(t))}attributeToAttribute(t){return this.add(Gge(t))}elementToMarker(t){return this.add(Yge(t))}dataToMarker(t){return this.add(qge(t))}}function wF(){return(n,t,e)=>{if(!t.modelRange&&e.consumable.consume(t.viewItem,{name:!0})){const{modelRange:i,modelCursor:s}=e.convertChildren(t.viewItem,t.modelCursor);t.modelRange=i,t.modelCursor=s}}}function Wge(){return(n,t,{schema:e,consumable:i,writer:s})=>{let r=t.modelCursor;if(!i.test(t.viewItem))return;if(!e.checkChild(r,"$text")){if(!KW(r,"$text",e)||t.viewItem.data.trim().length==0)return;r=XW(r,s)}i.consume(t.viewItem);const o=s.createText(t.viewItem.data);s.insert(o,r),t.modelRange=s.createRange(r,r.getShiftedBy(o.offsetSize)),t.modelCursor=t.modelRange.end}}function Uge(n,t){return(e,i)=>{const s=i.newSelection,r=[];for(const a of s.getRanges())r.push(t.toModelRange(a));const o=n.createSelection(r,{backward:s.isBackward});o.isEqual(n.document.selection)||n.change(a=>{a.setSelection(o)})}}function JW(n){n=_s(n);const t=hI(n),e=sO(n.view),i=e?`element:${e}`:"element";return s=>{s.on(i,t,{priority:n.converterPriority||"normal"})}}function jge(n){n=_s(n),ZW(n);const t=QW(n,!1),e=sO(n.view),i=e?`element:${e}`:"element";return s=>{s.on(i,t,{priority:n.converterPriority||"low"})}}function Gge(n){n=_s(n);let t=null;(typeof n.view=="string"||n.view.key)&&(t=Jge(n)),ZW(n,t);const e=QW(n,!0);return i=>{i.on("element",e,{priority:n.converterPriority||"low"})}}function Yge(n){const t=eme(n.model);return JW({...n,model:t})}function qge(n){n=_s(n),n.model||(n.model=s=>s?n.view+":"+s:n.view);const t={view:n.view,model:n.model},e=hI(vF(t,"start")),i=hI(vF(t,"end"));return s=>{s.on(`element:${n.view}-start`,e,{priority:n.converterPriority||"normal"}),s.on(`element:${n.view}-end`,i,{priority:n.converterPriority||"normal"});const r=Dc.low,o=Dc.highest,a=Dc.get(n.converterPriority)/o;s.on("element",Kge(t),{priority:r+a})}}function Kge(n){return(t,e,i)=>{const s=`data-${n.view}`;if(!i.consumable.test(e.viewItem,{attributes:s+"-end-after"})&&!i.consumable.test(e.viewItem,{attributes:s+"-start-after"})&&!i.consumable.test(e.viewItem,{attributes:s+"-end-before"})&&!i.consumable.test(e.viewItem,{attributes:s+"-start-before"}))return;e.modelRange||Object.assign(e,i.convertChildren(e.viewItem,e.modelCursor)),i.consumable.consume(e.viewItem,{attributes:s+"-end-after"})&&r(e.modelRange.end,e.viewItem.getAttribute(s+"-end-after").split(",")),i.consumable.consume(e.viewItem,{attributes:s+"-start-after"})&&r(e.modelRange.end,e.viewItem.getAttribute(s+"-start-after").split(",")),i.consumable.consume(e.viewItem,{attributes:s+"-end-before"})&&r(e.modelRange.start,e.viewItem.getAttribute(s+"-end-before").split(",")),i.consumable.consume(e.viewItem,{attributes:s+"-start-before"})&&r(e.modelRange.start,e.viewItem.getAttribute(s+"-start-before").split(","));function r(o,a){for(const l of a){const c=n.model(l,i),u=i.writer.createElement("$marker",{"data-name":c});i.writer.insert(u,o),e.modelCursor.isEqual(o)?e.modelCursor=e.modelCursor.getShiftedBy(1):e.modelCursor=e.modelCursor._getTransformedByInsertion(o,1),e.modelRange=e.modelRange._getTransformedByInsertion(o,1)[0]}}}}function sO(n){return typeof n=="string"?n:typeof n=="object"&&typeof n.name=="string"?n.name:null}function hI(n){const t=new ym(n.view);return(e,i,s)=>{const r=t.match(i.viewItem);if(!r)return;const o=r.match;if(o.name=!0,!s.consumable.test(i.viewItem,o))return;const a=Xge(n.model,i.viewItem,s);a&&s.safeInsert(a,i.modelCursor)&&(s.consumable.consume(i.viewItem,o),s.convertChildren(i.viewItem,a),s.updateConversionResult(a,i)
437)}}function Xge(n,t,e){return n instanceof Function?n(t,e):e.writer.createElement(n)}function Jge(n){typeof n.view=="string"&&(n.view={key:n.view});const t=n.view.key,e=typeof n.view.value>"u"?/[\s\S]*/:n.view.value;let i;return t=="class"||t=="style"?i={[t=="class"?"classes":"styles"]:e}:i={attributes:{[t]:e}},n.view.name&&(i.name=n.view.name),n.view=i,t}function ZW(n,t=null){const e=t===null?!0:r=>r.getAttribute(t),i=typeof n.model!="object"?n.model:n.model.key,s=typeof n.model!="object"||typeof n.model.value>"u"?e:n.model.value;n.model={key:i,value:s}}function QW(n,t){const e=new ym(n.view);return(i,s,r)=>{if(!s.modelRange&&t)return;const o=e.match(s.viewItem);if(!o||(Zge(n.view,s.viewItem)?o.match.name=!0:delete o.match.name,!r.consumable.test(s.viewItem,o.match)))return;const a=n.model.key,l=typeof n.model.value=="function"?n.model.value(s.viewItem,r,s):n.model.value;if(l==null)return;s.modelRange||Object.assign(s,r.convertChildren(s.viewItem,s.modelCursor)),Qge(s.modelRange,{key:a,value:l},t,r)&&(r.consumable.test(s.viewItem,{name:!0})&&(o.match.name=!0),r.consumable.consume(s.viewItem,o.match))}}function Zge(n,t){const e=typeof n=="function"?n(t):n;return typeof e=="object"&&!sO(e)?!1:!e.classes&&!e.attributes&&!e.styles}function Qge(n,t,e,i){let s=!1;for(const r of Array.from(n.getItems({shallow:e})))i.schema.checkAttribute(r,t.key)&&(s=!0,!r.hasAttribute(t.key)&&i.writer.setAttribute(t.key,t.value,r));return s}function eme(n){return(t,e)=>{const i=typeof n=="string"?n:n(t,e);return e.writer.createElement("$marker",{"data-name":i})}}function vF(n,t){const e=(i,s)=>{const r=i.getAttribute("name"),o=n.model(r,s);return s.writer.createElement("$marker",{"data-name":o})};return{view:`${n.view}-${t}`,model:e}}class tme extends Ut(){constructor(e,i){super();y(this,"model");y(this,"view");y(this,"mapper");y(this,"downcastDispatcher");this.model=e,this.view=new Gfe(i),this.mapper=new RW,this.downcastDispatcher=new LW({mapper:this.mapper,schema:e.schema});const s=this.model.document,r=s.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(s,"change",()=>{this.view.change(a=>{this.downcastDispatcher.convertChanges(s.differ,o,a),this.downcastDispatcher.convertSelection(r,o,a)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",Uge(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",BW(),{priority:"lowest"}),this.downcastDispatcher.on("insert",VW(),{priority:"lowest"}),this.downcastDispatcher.on("remove",dge(),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",gge()),this.downcastDispatcher.on("selection",hge(),{priority:"low"}),this.downcastDispatcher.on("selection",fge(),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(a=>{if(a.rootName=="$graveyard")return null;const l=new _W(this.view.document,a.name);return l.rootName=a.rootName,this.mapper.bindElements(a,l),l})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const i=typeof e=="string"?e:e.name,s=this.model.markers.get(i);if(!s)throw new ee("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:i});this.model.change(()=>{this.model.markers._refresh(s)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}class nme extends Ut(){constructor(){super();y(this,"_sourceDefinitions",{});y(this,"_attributeProperties",Object.create(null));y(this,"_customChildChecks",new Map);y(this,"_customAttributeChecks",new Map);y(this,"_genericCheckSymbol",Symbol("$generic"));y(this,"_compiledDefinitions");this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,i)=>{i[0]=new Rc(i[0])},{priority:"highest"}),this.on("checkChild",(e,i)=>{i[0]=new Rc(i[0]),i[1]=this.getDefinition(i[1])},{priority:"highest"})}register(e,i){if(this._sourceDefinitions[e])throw new ee("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},i)],this._clearCache()}extend(e,i){if(!this._sourceDefinitions[e])throw new ee("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},i)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let i;return typeof e=="string"?i=e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?i="$text":i=e.name,this.getDefinitions()[i]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const i=this.getDefinition(e);return!!(i&&i.isBlock)}isLimit(e){const i=this.getDefinition(e);return i?!!(i.isLimit||i.isObject):!1}isObject(e){const i=this.getDefinition(e);return i?!!(i.isObject||i.isLimit&&i.isSelectable&&i.isContent):!1}isInline(e){const i=this.getDefinition(e);return!!(i&&i.isInline)}isSelectable(e){const i=this.getDefinition(e);return i?!!(i.isSelectable||i.isObject):!1}isContent(e){const i=this.getDefinition(e);return i?!!(i.isContent||i.isObject):!1}checkChild(e,i){return i?this._checkContextMatch(e,i):!1}checkAttribute(e,i){const s=this.getDefinition(e.last);if(!s)return!1;const r=this._evaluateAttributeChecks(e,i);return r!==void 0?r:s.allowAttributes.includes(i)}checkMerge(e,i){if(e instanceof me){const s=e.nodeBefore,r=e.nodeAfter;if(!(s instanceof Kt))throw new ee("schema-check-merge-no-element-before",this);if(!(r instanceof Kt))throw new ee("schema-check-merge-no-element-after",this);return this.checkMerge(s,r)}if(this.isLimit(e)||this.isLimit(i))return!1;for(const s of i.getChildren())if(!this.checkChild(e,s))return!1;return!0}addChildCheck(e,i){const s=i!==void 0?i:this._genericCheckSymbol,r=this._customChildChecks.get(s)||[];r.push(e),this._customChildChecks.set(s,r)}addAttributeCheck(e,i){const s=i!==void 0?i:this._genericCheckSymbol,r=this._customAttributeChecks.get(s)||[];r.push(e),this._customAttributeChecks.set(s,r)}setAttributeProperties(e,i){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),i)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let i;for(e instanceof me?i=e.parent:i=(e instanceof oe?[e]:Array.from(e.getRanges())).reduce((r,o)=>{const a=o.getCommonAncestor();return r?r.getCommonAncestor(a,{includeSelf:!0}):a},null);!this.isLimit(i)&&i.parent;)i=i.parent;return i}checkAttributeInSelection(e,i){if(e.isCollapsed){const r=[...e.getFirstPosition().getAncestors(),new tn("",e.getAttributes())];return this.checkAttribute(r,i)}else{const s=e.getRanges();for(const r of s)for(const o of r)if(this.checkAttribute(o.item,i))return!0}return!1}*getValidRanges(e,i){e=wme(e);for(const s of e)yield*this._getValidRangesForRange(s,i)}getNearestSelectionRange(e,i="both"){if(e.root.rootName=="$graveyard")return null;if(this.checkChild(e,"$text"))return new oe(e);let s,r;const o=e.getAncestors().reverse().find(a=>this.isLimit(a))||e.root;(i=="both"||i=="backward")&&(s=new rl({boundaries:oe._createIn(o),startPosition:e,direction:"backward"})),(i=="both"||i=="forward")&&(r=new rl({boundaries:oe._createIn(o),startPosition:e}));for(const a of bme(s,r)){const l=a.walker==s?"elementEnd":"elementStart",c=a.value;if(c.type==l&&this.isObject(c.item))return oe._createOn(c.item);if(this.checkChild(c.nextPosition,"$text"))return new oe(c.nextPosition)}return null}findAllowedParent(e,i){let s=e.parent;for(;s;){if(this.checkChild(s,i))return s;if(this.isLimit(s))return null;s=s.parent}return null}setAllowedAttributes(e,i,s){const r=s.model;for(const[o,a]of Object.entries(i))r.schema.checkAttribute(e,o)&&s.setAttribute(o,a,e)}removeDisallowedAttributes(e,i){for(const s of e)if(s.is("$text"))yF(this,s,i);else{const o=oe._createIn(s).getPositions();for(const a of o){const l=a.nodeBefore||a.parent;yF(this,l,i)}}}getAttributesWithProperty(e,i,s){const r={};for(const[o,a]of e.getAttributes()){const l=this.getAttributeProperties(o);l[i]!==void 0&&(s===void 0||s===l[i])&&(r[o]=a)}return r}createContext(e){return new Rc(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},i=this._sourceDefinitions,s=Object.keys(i);for(const o of s)e[o]=ime(i[o],o);const r=Object.values(e);for(const o of r)sme(e,o),rme(e,o),ome(e,o),ame(e,o);for(const o of r)lme(e,o);for(const o of r)cme(e,o);for(const o of r)ume(e,o);for(const o of r)hme(e,o);for(const o of r)fme(e,o);this._compiledDefinitions=dme(e)}_checkContextMatch(e,i){const s=e.last;let r=this._evaluateChildChecks(e,i);if(r=r!==void 0?r:i.allowIn.includes(s.name),!r)return!1;const o=this.getDefinition(s),a=e.trimLast();return o?a.length==0?!0:this._checkContextMatch(a,o):!1}_evaluateChildChecks(e,i){const s=this._customChildChecks.get(this._genericCheckSymbol)||[],r=this._customChildChecks.get(i.name)||[];for(const o of[...s,...r]){const a=o(e,i);if(a!==void 0)return a}}_evaluateAttributeChecks(e,i){const s=this._customAttributeChecks.get(this._genericCheckSymbol)||[],r=this._customAttributeChecks.get(i)||[];for(const o of[...s,...r]){const a=o(e,i);if(a!==void 0)return a}}*_getValidRangesForRange(e,i){let s=e.start,r=e.start;for(const o of e.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(oe._createIn(o),i)),this.checkAttribute(o,i)||(s.isEqual(r)||(yield new oe(s,r)),s=me._createAfter(o)),r=me._createAfter(o);s.isEqual(r)||(yield new oe(s,r))}findOptimalInsertionRange(e,i){const s=e.getSelectedElement();if(s&&this.isObject(s)&&!this.isInline(s))return i=="before"||i=="after"?new oe(me._createAt(s,i)):oe._
437createOn(s);const r=$i(e.getSelectedBlocks());if(!r)return new oe(e.focus);if(r.isEmpty)return new oe(me._createAt(r,0));const o=me._createAfter(r);return e.focus.isTouching(o)?new oe(o):new oe(me._createBefore(r))}}class Rc{constructor(t){y(this,"_items");if(t instanceof Rc)return t;let e;typeof t=="string"?e=[t]:Array.isArray(t)?e=t:e=t.getAncestors({includeSelf:!0}),this._items=e.map(pme)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new Rc([t]);return e._items=[...this._items,...e._items],e}trimLast(){const t=new Rc([]);return t._items=this._items.slice(0,-1),t}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function ime(n,t){const e={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return gme(n,e),yo(n,e,"allowIn"),yo(n,e,"allowChildren"),yo(n,e,"disallowIn"),yo(n,e,"disallowChildren"),yo(n,e,"allowContentOf"),yo(n,e,"allowWhere"),yo(n,e,"allowAttributes"),yo(n,e,"disallowAttributes"),yo(n,e,"allowAttributesOf"),yo(n,e,"inheritTypesFrom"),mme(n,e),e}function sme(n,t){for(const e of t.allowIn){const i=n[e];i?i.allowChildren.add(t.name):t.allowIn.delete(e)}}function rme(n,t){for(const e of t.allowChildren){const i=n[e];i?i.allowIn.add(t.name):t.allowChildren.delete(e)}}function ome(n,t){for(const e of t.disallowIn){const i=n[e];i?i.disallowChildren.add(t.name):t.disallowIn.delete(e)}}function ame(n,t){for(const e of t.disallowChildren){const i=n[e];i?i.disallowIn.add(t.name):t.disallowChildren.delete(e)}}function lme(n,t){for(const e of t.disallowChildren)t.allowChildren.delete(e);for(const e of t.disallowIn)t.allowIn.delete(e);for(const e of t.disallowAttributes)t.allowAttributes.delete(e)}function cme(n,t){for(const e of t.allowContentOf){const i=n[e];i&&(i.disallowChildren.forEach(s=>{t.allowChildren.has(s)||(t.disallowChildren.add(s),n[s].disallowIn.add(t.name))}),i.allowChildren.forEach(s=>{t.disallowChildren.has(s)||(t.allowChildren.add(s),n[s].allowIn.add(t.name))}))}}function ume(n,t){for(const e of t.allowWhere){const i=n[e];i&&(i.disallowIn.forEach(s=>{t.allowIn.has(s)||(t.disallowIn.add(s),n[s].disallowChildren.add(t.name))}),i.allowIn.forEach(s=>{t.disallowIn.has(s)||(t.allowIn.add(s),n[s].allowChildren.add(t.name))}))}}function dme(n){const t={};for(const e of Object.values(n))t[e.name]={name:e.name,isBlock:!!e.isBlock,isContent:!!e.isContent,isInline:!!e.isInline,isLimit:!!e.isLimit,isObject:!!e.isObject,isSelectable:!!e.isSelectable,allowIn:Array.from(e.allowIn).filter(i=>!!n[i]),allowChildren:Array.from(e.allowChildren).filter(i=>!!n[i]),allowAttributes:Array.from(e.allowAttributes)};return t}function hme(n,t){for(const e of t.allowAttributesOf){const i=n[e];if(!i)return;i.allowAttributes.forEach(s=>{t.disallowAttributes.has(s)||t.allowAttributes.add(s)})}}function fme(n,t){for(const e of t.inheritTypesFrom){const i=n[e];if(i){const s=Object.keys(i).filter(r=>r.startsWith("is"));for(const r of s)r in t||(t[r]=i[r])}}}function gme(n,t){for(const e of n){const i=Object.keys(e).filter(s=>s.startsWith("is"));for(const s of i)t[s]=!!e[s]}}function yo(n,t,e){for(const i of n){let s=i[e];typeof s=="string"&&(s=[s]),Array.isArray(s)&&s.forEach(r=>t[e].add(r))}}function mme(n,t){for(const e of n){const i=e.inheritAllFrom;i&&(t.allowContentOf.add(i),t.allowWhere.add(i),t.allowAttributesOf.add(i),t.inheritTypesFrom.add(i))}}function pme(n){return typeof n=="string"||n.is("documentFragment")?{name:typeof n=="string"?n:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:n.is("element")?n.name:"$text",*getAttributeKeys(){yield*n.getAttributeKeys()},getAttribute(t){return n.getAttribute(t)}}}function*bme(n,t){let e=!1;for(;!e;){if(e=!0,n){const i=n.next();i.done||(e=!1,yield{walker:n,value:i.value})}if(t){const i=t.next();i.done||(e=!1,yield{walker:t,value:i.value})}}}function*wme(n){for(const t of n)yield*t.getMinimalFlatRanges()}function yF(n,t,e){for(const i of t.getAttributeKeys())n.checkAttribute(t,i)||e.removeAttribute(i,t)}class vme extends Gt(){constructor(e){super();y(this,"conversionApi");y(this,"_splitParts",new Map);y(this,"_cursorParents",new Map);y(this,"_modelCursor",null);y(this,"_emptyElementsToKeep",new Set);this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(i,s)=>this._convertItem(i,s),convertChildren:(i,s)=>this._convertChildren(i,s),safeInsert:(i,s)=>this._safeInsert(i,s),updateConversionResult:(i,s)=>this._updateConversionResult(i,s),splitToAllowedParent:(i,s)=>this._splitToAllowedParent(i,s),getSplitParts:i=>this._getSplitParts(i),keepEmptyElement:i=>this._keepEmptyElement(i)}}convert(e,i,s=["$root"]){this.fire("viewCleanup",e),this._modelCursor=_me(s,i),this.conversionApi.writer=i,this.conversionApi.consumable=$E.createFrom(e),this.conversionApi.store={};const{modelRange:r}=this._convertItem(e,this._modelCursor),o=i.createDocumentFragment();if(r){this._removeEmptyElements();const a=this._modelCursor.parent,l=a._removeChildren(0,a.childCount);o._insertChild(0,l),o.markers=yme(o,i)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,i){const s={viewItem:e,modelCursor:i,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,s,this.conversionApi):e.is("$text")?this.fire("text",s,this.conversionApi):this.fire("documentFragment",s,this.conversionApi),s.modelRange&&!(s.modelRange instanceof oe))throw new ee("view-conversion-dispatcher-incorrect-result",this);return{modelRange:s.modelRange,modelCursor:s.modelCursor}}_convertChildren(e,i){let s=i.is("position")?i:me._createAt(i,0);const r=new oe(s);for(const o of Array.from(e.getChildren())){const a=this._convertItem(o,s);a.modelRange instanceof oe&&(r.end=a.modelRange.end,s=a.modelCursor)}return{modelRange:r,modelCursor:s}}_safeInsert(e,i){const s=this._splitToAllowedParent(e,i);return s?(this.conversionApi.writer.insert(e,s.position),!0):!1}_updateConversionResult(e,i){const s=this._getSplitParts(e),r=this.conversionApi.writer;i.modelRange||(i.modelRange=r.createRange(r.createPositionBefore(e),r.createPositionAfter(s[s.length-1])));const o=this._cursorParents.get(e);o?i.modelCursor=r.createPositionAt(o,0):i.modelCursor=i.modelRange.end}_splitToAllowedParent(e,i){const{schema:s,writer:r}=this.conversionApi;let o=s.findAllowedParent(i,e);if(o){if(o===i.parent)return{position:i};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return KW(i,e,s)?{position:XW(i,r)}:null;const a=this.conversionApi.writer.split(i,o),l=[];for(const u of a.range.getWalker())if(u.type=="elementEnd")l.push(u.item);else{const d=l.pop(),h=u.item;this._registerSplitPair(d,h)}const c=a.range.end.parent;return this._cursorParents.set(e,c),{position:a.position,cursorParent:c}}_registerSplitPair(e,i){this._splitParts.has(e)||this._splitParts.set(e,[e]);const s=this._splitParts.get(e);this._splitParts.set(i,s),s.push(i)}_getSplitParts(e){let i;return this._splitParts.has(e)?i=this._splitParts.get(e):i=[e],i}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){const e=new Map;
437for(const i of this._splitParts.keys())if(i.isEmpty&&!this._emptyElementsToKeep.has(i)){const s=e.get(i.parent)||[];s.push(i),this._splitParts.delete(i),e.set(i.parent,s)}for(const[i,s]of e)i._removeChildrenArray(s);e.size&&this._removeEmptyElements()}}function yme(n,t){const e=new Set,i=new Map,s=oe._createIn(n).getItems();for(const r of s)r.is("element","$marker")&&e.add(r);for(const r of e){const o=r.getAttribute("data-name"),a=t.createPositionBefore(r);i.has(o)?i.get(o).end=a.clone():i.set(o,new oe(a.clone())),t.remove(r)}return i}function _me(n,t){let e;for(const i of new Rc(n)){const s={};for(const o of i.getAttributeKeys())s[o]=i.getAttribute(o);const r=t.createElement(i.name,s);e&&t.insert(r,e),e=me._createAt(r,0)}return e}class Eme{getHtml(t){const i=Ie.document.implementation.createHTMLDocument("").createElement("div");return i.appendChild(t),i.innerHTML}}class Sme{constructor(t){y(this,"domParser");y(this,"domConverter");y(this,"htmlWriter");y(this,"skipComments",!0);this.domParser=new DOMParser,this.domConverter=new kW(t,{renderingMode:"data"}),this.htmlWriter=new Eme}toData(t){const e=this.domConverter.viewToDom(t);return this.htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this.domConverter.domToView(e,{skipComments:this.skipComments})}registerRawContentMatcher(t){this.domConverter.registerRawContentMatcher(t)}useFillerType(t){this.domConverter.blockFillerMode=t=="marked"?"markedNbsp":"nbsp"}_toDom(t){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(t.trim().slice(0,1e4))||(t=`<body>${t}</body>`);const e=this.domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment(),s=e.body.childNodes;for(;s.length>0;)i.appendChild(s[0]);return i}}class Tme extends Gt(){constructor(e,i){super();y(this,"model");y(this,"mapper");y(this,"downcastDispatcher");y(this,"upcastDispatcher");y(this,"viewDocument");y(this,"stylesProcessor");y(this,"htmlProcessor");y(this,"processor");y(this,"_viewWriter");this.model=e,this.mapper=new RW,this.downcastDispatcher=new LW({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",BW(),{priority:"lowest"}),this.downcastDispatcher.on("insert",VW(),{priority:"lowest"}),this.upcastDispatcher=new vme({schema:e.schema}),this.viewDocument=new EW(i),this.stylesProcessor=i,this.htmlProcessor=new Sme(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new SW(this.viewDocument),this.upcastDispatcher.on("text",Wge(),{priority:"lowest"}),this.upcastDispatcher.on("element",wF(),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",wF(),{priority:"lowest"}),Ut().prototype.decorate.call(this,"init"),Ut().prototype.decorate.call(this,"set"),Ut().prototype.decorate.call(this,"get"),Ut().prototype.decorate.call(this,"toView"),Ut().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},qW)},{priority:"lowest"})}get(e={}){const{rootName:i="main",trim:s="empty"}=e;if(!this._checkIfRootsExists([i]))throw new ee("datacontroller-get-non-existent-root",this);const r=this.model.document.getRoot(i);return r.isAttached()||Dt("datacontroller-get-detached-root",this),s==="empty"&&!this.model.hasContent(r,{ignoreWhitespaces:!0})?"":this.stringify(r,e)}stringify(e,i={}){const s=this.toView(e,i);return this.processor.toData(s)}toView(e,i={}){const s=this.viewDocument,r=this._viewWriter;this.mapper.clearBindings();const o=oe._createIn(e),a=new ah(s);this.mapper.bindElements(e,a);const l=e.is("documentFragment")?e.markers:xme(e);return this.downcastDispatcher.convert(o,l,r,i),a}init(e){if(this.model.document.version)throw new ee("datacontroller-init-document-not-empty",this);let i={};if(typeof e=="string"?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new ee("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},s=>{for(const r of Object.keys(i)){const o=this.model.document.getRoot(r);s.insert(this.parse(i[r],o),o,0)}}),Promise.resolve()}set(e,i={}){let s={};if(typeof e=="string"?s.main=e:s=e,!this._checkIfRootsExists(Object.keys(s)))throw new ee("datacontroller-set-non-existent-root",this);this.model.enqueueChange(i.batchType||{},r=>{r.setSelection(null),r.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const o of Object.keys(s)){const a=this.model.document.getRoot(o);r.remove(r.createRangeIn(a)),r.insert(this.parse(s[o],a),a,0)}})}parse(e,i="$root"){const s=this.processor.toView(e);return this.toModel(s,i)}toModel(e,i="$root"){return this.model.change(s=>
437this.upcastDispatcher.convert(e,s,i))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const i of e)if(!this.model.document.getRoot(i))return!1;return!0}}function xme(n){const t=[],e=n.root.document;if(!e)return new Map;const i=oe._createIn(n);for(const s of e.model.markers){const r=s.getRange(),o=r.isCollapsed,a=r.start.isEqual(i.start)||r.end.isEqual(i.end);if(o&&a)t.push([s.name,r]);else{const l=i.getIntersection(r);l&&t.push([s.name,l])}}return t.sort(([s,r],[o,a])=>{if(r.end.compareWith(a.start)!=="after")return 1;if(r.start.compareWith(a.end)!=="before")return-1;switch(r.start.compareWith(a.start)){case"before":return 1;case"after":return-1;default:switch(r.end.compareWith(a.end)){case"before":return 1;case"after":return-1;default:return o.localeCompare(s)}}}),new Map(t)}class Ame{constructor(t,e){y(this,"_helpers",new Map);y(this,"_downcast");y(this,"_upcast");this._downcast=bn(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=bn(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new ee("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new ee("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of EA(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of EA(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of EA(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new ee("conversion-group-exists",this);const s=i?new uge(e):new $ge(e);this._helpers.set(t,s)}}function*EA(n){if(n.model.values)for(const t of n.model.values){const e={key:n.model.key,value:t},i=n.view[t],s=n.upcastAlso?n.upcastAlso[t]:void 0;yield*_F(e,i,s)}else yield*_F(n.model,n.view,n.upcastAlso)}function*_F(n,t,e){if(yield{model:n,view:t},e)for(const i of bn(e))yield{model:n,view:i}}/** 438 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 439 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 440 */class Ks{constructor(t){y(this,"baseVersion");y(this,"isDocumentOperation");y(this,"batch");this.baseVersion=t,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t,e){return new this(t.baseVersion)}}function rO(n,t){const e=t4(t),i=e.reduce((o,a)=>o+a.offsetSize,0),s=n.parent;Yb(n);const r=n.index;return s._insertChild(r,e),Gb(s,r+e.length),Gb(s,r),new oe(n,n.getShiftedBy(i))}function e4(n){if(!n.isFlat)throw new ee("operation-utils-remove-range-not-flat",this);const t=n.start.parent;Yb(n.start),Yb(n.end);const e=t._removeChildren(n.start.index,n.end.index-n.start.index);return Gb(t,n.start.index),e}function jb(n,t){if(!n.isFlat)throw new ee("operation-utils-move-range-not-flat",this);const e=e4(n);return t=t._getTransformedByDeletion(n.start,n.end.offset-n.start.offset),rO(t,e)}function Cme(n,t,e){Yb(n.start),Yb(n.end);for(const i of n.getItems({shallow:!0})){const s=i.is("$textProxy")?i.textNode:i;e!==null?s._setAttribute(t,e):s._removeAttribute(t),Gb(s.parent,s.index)}Gb(n.end.parent,n.end.index)}function t4(n){const t=[];function e(i){if(typeof i=="string")t.push(new tn(i));else if(i instanceof to)t.push(new tn(i.data,i.getAttributes()));else if(i instanceof kh)t.push(i);else if(qs(i))for(const s of i)e(s)}e(n);for(let i=1;i<t.length;i++){const s=t[i],r=t[i-1];s instanceof tn&&r instanceof tn&&n4(s,r)&&(t.splice(i-1,2,new tn(r.data+s.data,r.getAttributes())),i--)}return t}function Gb(n,t){const e=n.getChild(t-1),i=n.getChild(t);if(e&&i&&e.is("$text")&&i.is("$text")&&n4(e,i)){const s=new tn(e.data+i.data,e.getAttributes());n._removeChildren(t-1,2),n._insertChild(t-1,s)}}function Yb(n){const t=n.textNode,e=n.parent;if(t){const i=n.offset-t.startOffset,s=t.index;e._removeChildren(s,1);const r=new tn(t.data.substr(0,i),t.getAttributes()),o=new tn(t.data.substr(i),t.getAttributes());e._insertChild(s,[r,o])}}function n4(n,t){const e=n.getAttributes(),i=t.getAttributes();for(const s of e){if(s[1]!==t.getAttribute(s[0]))return!1;i.next()}return i.next().done}class Rt extends Ks{constructor(e,i,s,r){super(r);y(this,"sourcePosition");y(this,"howMany");y(this,"targetPosition");this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=i,this.targetPosition=s.clone(),this.targetPosition.stickiness="toNone"}get type(){return this.targetPosition.root.rootName==this.sourcePosition.root.rootName?"move":this.targetPosition.root.rootName=="$graveyard"?"remove":this.sourcePosition.root.rootName=="$graveyard"?"reinsert":"move"}get affectedSelectable(){return[oe._createFromPositionAndShift(this.sourcePosition,this.howMany),oe._createFromPositionAndShift(this.targetPosition,0)]}clone(){return new Rt(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new Rt(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,i=this.targetPosition.parent,s=this.sourcePosition.offset,r=this.targetPosition.offset;if(s+this.howMany>e.maxOffset)throw new ee("move-operation-nodes-do-not-exist",this);if(e===i&&s<r&&r<s+this.howMany)throw new ee("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&li(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())=="prefix"){const o=this.sourcePosition.path.length-1;if(this.targetPosition.path[o]>=s&&this.targetPosition.path[o]<s+this.howMany)throw new ee("move-operation-node-into-itself",this)}}_execute(){jb(oe._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,i){const s=me.fromJSON(e.sourcePosition,i),r=me.fromJSON(e.targetPosition,i);return new this(s,e.howMany,r,e.baseVersion)}}class hi extends Ks{constructor(e,i,s){super(s);y(this,"position");y(this,"nodes");y(this,"shouldReceiveAttributes");this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new fb(t4(i)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}get affectedSelectable(){return this.position.clone()}clone(){const e=new fb([...this.nodes].map(s=>s._clone(!0))),i=new hi(this.position,e,this.baseVersion);return i.shouldReceiveAttributes=this.shouldReceiveAttributes,i}getReversed(){const e=this.position.root.document.graveyard,i=new me(e,[0]);return new Rt(this.position,this.nodes.maxOffset,i,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new ee("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new fb([...e].map(i=>i._clone(!0))),rO(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,i){const s=[];
440for(const o of e.nodes)o.name?s.push(Kt.fromJSON(o)):s.push(tn.fromJSON(o));const r=new hi(me.fromJSON(e.position,i),s,e.baseVersion);return r.shouldReceiveAttributes=e.shouldReceiveAttributes,r}}class jt extends Ks{constructor(e,i,s,r,o){super(o);y(this,"splitPosition");y(this,"howMany");y(this,"insertionPosition");y(this,"graveyardPosition");this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=i,this.insertionPosition=s,this.graveyardPosition=r?r.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new me(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new oe(this.splitPosition,e)}get affectedSelectable(){const e=[oe._createFromPositionAndShift(this.splitPosition,0),oe._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(oe._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new jt(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,i=new me(e,[0]);return new Sn(this.moveTargetPosition,this.howMany,this.splitPosition,i,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,i=this.splitPosition.offset;if(!e||e.maxOffset<i)throw new ee("split-operation-position-invalid",this);if(e.parent){if(this.howMany!==Number.NEGATIVE_INFINITY&&this.howMany!=e.maxOffset-this.splitPosition.offset)throw new ee("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new ee("split-operation-graveyard-position-invalid",this)}else throw new ee("split-operation-split-in-root",this);this.howMany=this.splitPosition.parent.maxOffset-this.splitPosition.offset}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)jb(oe._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const s=e._clone();rO(this.insertionPosition,s)}const i=new oe(me._createAt(e,this.splitPosition.offset),me._createAt(e,e.maxOffset));jb(i,this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const i=e.path.slice(0,-1);return i[i.length-1]++,new me(e.root,i,"toPrevious")}static fromJSON(e,i){const s=me.fromJSON(e.splitPosition,i),r=me.fromJSON(e.insertionPosition,i),o=e.graveyardPosition?me.fromJSON(e.graveyardPosition,i):null;return new this(s,e.howMany,r,o,e.baseVersion)}}class Sn extends Ks{constructor(e,i,s,r,o){super(o);y(this,"sourcePosition");y(this,"howMany");y(this,"targetPosition");y(this,"graveyardPosition");this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=i,this.targetPosition=s.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=r.clone()}get type(){return"merge"}get deletionPosition(){return new me(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new oe(this.sourcePosition,e)}get affectedSelectable(){const e=this.sourcePosition.parent;return[oe._createOn(e),oe._createFromPositionAndShift(this.targetPosition,0),oe._createFromPositionAndShift(this.graveyardPosition,0)]}clone(){return new Sn(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),i=this.sourcePosition.path.slice(0,-1),s=new me(this.sourcePosition.root,i)._getTransformedByMergeOperation(this);return new jt(e,this.howMany,s,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,i=this.targetPosition.parent;if(e.parent)if(i.parent){if(this.howMany!==Number.NEGATIVE_INFINITY&&this.howMany!=e.maxOffset)throw new ee("merge-operation-how-many-invalid",this)}else throw new ee("merge-operation-target-position-invalid",this);else throw new ee("merge-operation-source-position-invalid",this);this.howMany=this.sourcePosition.parent.maxOffset}
440_execute(){const e=this.sourcePosition.parent,i=oe._createIn(e);jb(i,this.targetPosition),jb(oe._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,i){const s=me.fromJSON(e.sourcePosition,i),r=me.fromJSON(e.targetPosition,i),o=me.fromJSON(e.graveyardPosition,i);return new this(s,e.howMany,r,o,e.baseVersion)}}class ts extends Ks{constructor(e,i,s,r,o,a){super(a);y(this,"name");y(this,"oldRange");y(this,"newRange");y(this,"affectsData");y(this,"_markers");this.name=e,this.oldRange=i?i.clone():null,this.newRange=s?s.clone():null,this.affectsData=o,this._markers=r}get type(){return"marker"}get affectedSelectable(){const e=[];return this.oldRange&&e.push(this.oldRange.clone()),this.newRange&&(this.oldRange?e.push(...this.newRange.getDifference(this.oldRange)):e.push(this.newRange.clone())),e}clone(){return new ts(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new ts(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){this.newRange?this._markers._set(this.name,this.newRange,!0,this.affectsData):this._markers._remove(this.name)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,i){return new ts(e.name,e.oldRange?oe.fromJSON(e.oldRange,i):null,e.newRange?oe.fromJSON(e.newRange,i):null,i.model.markers,e.affectsData,e.baseVersion)}}class Ln extends Ks{constructor(e,i,s,r,o){super(o);y(this,"range");y(this,"key");y(this,"oldValue");y(this,"newValue");this.range=e.clone(),this.key=i,this.oldValue=s===void 0?null:s,this.newValue=r===void 0?null:r}get type(){return this.oldValue===null?"addAttribute":this.newValue===null?"removeAttribute":"changeAttribute"}get affectedSelectable(){return this.range.clone()}clone(){return new Ln(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Ln(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new ee("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(this.oldValue!==null&&!IL(e.getAttribute(this.key),this.oldValue))throw new ee("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(this.oldValue===null&&this.newValue!==null&&e.hasAttribute(this.key))throw new ee("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){IL(this.oldValue,this.newValue)||Cme(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,i){return new Ln(oe.fromJSON(e.range,i),e.key,e.oldValue,e.newValue,e.baseVersion)}}class $n extends Ks{get type(){return"noop"}get affectedSelectable(){return null}clone(){return new $n(this.baseVersion)}getReversed(){return new $n(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}class vs extends Ks{constructor(e,i,s,r){super(r);y(this,"position");y(this,"oldName");y(this,"newName");this.position=e,this.position.stickiness="toNext",this.oldName=i,this.newName=s}get type(){return"rename"}get affectedSelectable(){return this.position.nodeAfter}clone(){return new vs(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new vs(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(e instanceof Kt){if(this.oldName!==""&&e.name!==this.oldName)throw new ee("rename-operation-wrong-name",this)}else throw new ee("rename-operation-wrong-position",this);this.oldName=e.name}_execute(){const e=this.position.nodeAfter;e.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,i){return new vs(me.fromJSON(e.position,i),e.oldName,e.newName,e.baseVersion)}}class ul extends Ks{constructor(e,i,s,r,o){super(o);y(this,"root");y(this,"key");y(this,"oldValue");y(this,"newValue");this.root=e,this.key=i,this.oldValue=s===void 0?null:s,this.newValue=r===void 0?null:r}get type(){return this.oldValue===null?"addRootAttribute":this.newValue===null?"removeRootAttribute":"changeRootAttribute"}get affectedSelectable(){return this.root}clone(){return new ul(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ul(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new ee("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue)throw new ee("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key))throw new ee("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){this.newValue!==null?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,i){if(!i.getRoot(e.root))throw new ee("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new ul(i.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Xo extends Ks{constructor(e,i,s,r,o){super(o);y(this,"rootName");y(this,"elementName");y(this,"isAdd");y(this,"_document");
440if(this.rootName=e,this.elementName=i,this.isAdd=s,this._document=r,!this._document.getRoot(this.rootName)){const a=this._document.createRoot(this.elementName,this.rootName);a._isAttached=!1}}get type(){return this.isAdd?"addRoot":"detachRoot"}get affectedSelectable(){return this._document.getRoot(this.rootName)}clone(){return new Xo(this.rootName,this.elementName,this.isAdd,this._document,this.baseVersion)}getReversed(){return new Xo(this.rootName,this.elementName,!this.isAdd,this._document,this.baseVersion+1)}_execute(){this._document.getRoot(this.rootName)._isAttached=this.isAdd}toJSON(){const e=super.toJSON();return delete e._document,e}static get className(){return"RootOperation"}static fromJSON(e,i){return new Xo(e.rootName,e.elementName,e.isAdd,i,e.baseVersion)}}const Ar={};Ar[Ln.className]=Ln;Ar[hi.className]=hi;Ar[ts.className]=ts;Ar[Rt.className]=Rt;Ar[$n.className]=$n;Ar[Ks.className]=Ks;Ar[vs.className]=vs;Ar[ul.className]=ul;Ar[Xo.className]=Xo;Ar[jt.className]=jt;Ar[Sn.className]=Sn;class kme{static fromJSON(t,e){return Ar[t.__className].fromJSON(t,e)}}const fI=new Map;function Pt(n,t,e){let i=fI.get(n);i||(i=new Map,fI.set(n,i)),i.set(t,e)}function Ime(n,t){const e=fI.get(n);return e&&e.has(t)?e.get(t):Pme}function Pme(n){return[n]}function EF(n,t,e={}){const i=Ime(n.constructor,t.constructor);try{return n=n.clone(),i(n,t,e)}catch(s){throw s}}function Mme(n,t,e){n=n.slice(),t=t.slice();const i=new Ome(e.document,e.useRelations,e.forceWeakRemove);i.setOriginalOperations(n),i.setOriginalOperations(t);const s=i.originalOperations;if(n.length==0||t.length==0)return{operationsA:n,operationsB:t,originalOperations:s};const r=new WeakMap;for(const l of n)r.set(l,0);const o={nextBaseVersionA:n[n.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:n.length,originalOperationsBCount:t.length};let a=0;for(;a<n.length;){const l=n[a],c=r.get(l);if(c==t.length){a++;continue}const u=t[c],d=EF(l,u,i.getContext(l,u,!0)),h=EF(u,l,i.getContext(u,l,!1));i.updateRelation(l,u),i.setOriginalOperations(d,l),i.setOriginalOperations(h,u);for(const f of d)r.set(f,c+h.length);n.splice(a,1,...d),t.splice(c,1,...h)}if(xF(n),xF(t),e.padWithNoOps){const l=n.length-o.originalOperationsACount,c=t.length-o.originalOperationsBCount;TF(n,c-l),TF(t,l-c)}return SF(n,o.nextBaseVersionB),SF(t,o.nextBaseVersionA),{operationsA:n,operationsB:t,originalOperations:s}}class Ome{constructor(t,e,i=!1){y(this,"originalOperations");y(this,"_history");y(this,"_useRelations");y(this,"_forceWeakRemove");y(this,"_relations");this.originalOperations=new Map,this._history=t.history,this._useRelations=e,this._forceWeakRemove=!!i,this._relations=new Map}setOriginalOperations(t,e=null){const i=e?this.originalOperations.get(e):null;for(const s of t)this.originalOperations.set(s,i||s)}updateRelation(t,e){if(t instanceof Rt)e instanceof Sn?t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,"insertAtSource"):t.targetPosition.isEqual(e.deletionPosition)?this._setRelation(t,e,"insertBetween"):t.targetPosition.isAfter(e.sourcePosition)?this._setRelation(t,e,"moveTargetAfter"):t.howMany>1&&t.sourcePosition.isEqual(e.deletionPosition)?this._setRelation(t,e,"firstToMoveMerged"):t.howMany>1&&t.sourcePosition.getShiftedBy(t.howMany-1).isEqual(e.deletionPosition)&&this._setRelation(t,e,"lastToMoveMerged"):e instanceof Rt&&(t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,"insertBefore"):this._setRelation(t,e,"insertAfter"));else if(t instanceof jt){if(e instanceof Sn)t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,"splitBefore");else if(e instanceof Rt)if(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))this._setRelation(t,e,"splitBefore");else{const i=oe._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)){const s=i.end.offset-t.splitPosition.offset,r=t.splitPosition.offset-i.start.offset;this._setRelation(t,e,{howMany:s,offset:r})}}}else if(t instanceof Sn)e instanceof Sn?(t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,"mergeTargetNotMoved"),t.sourcePosition.isEqual(e.targetPosition)&&this._setRelation(t,e,"mergeSourceNotMoved"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeSameElement")):e instanceof jt?t.sourcePosition.isEqual(e.splitPosition)&&this._setRelation(t,e,"splitAtSource"):e instanceof Rt&&e.howMany>0&&(t.sourcePosition.isEqual(e.sourcePosition.getShiftedBy(e.howMany))&&this._setRelation(t,e,"mergeSourceAffected"),t.targetPosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeTargetWasBefore"));else if(t instanceof ts){const i=t.newRange;if(!i)return;if(e instanceof Sn){const s=i.start.isEqual(e.targetPosition),r=i.start.isEqual(e.deletionPosition),o=i.end.isEqual(e.deletionPosition),a=i.end.isEqual(e.sourcePosition);(s||r||o||a)&&this._setRelation(t,e,{wasInLeftElement:s,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:o,wasInRightElement:a})}}}getContext(t,e,i){return{aIsStrong:i,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const i=this.originalOperations.get(e),s=this._history.getUndoneOperation(i);if(!s)return null;const r=this.originalOperations.get(t),o=this._relations.get(r);return o&&o.get(s)||null}
440_setRelation(t,e,i){const s=this.originalOperations.get(t),r=this.originalOperations.get(e);let o=this._relations.get(s);o||(o=new Map,this._relations.set(s,o)),o.set(r,i)}}function SF(n,t){for(const e of n)e.baseVersion=t++}function TF(n,t){for(let e=0;e<t;e++)n.push(new $n(0))}function xF(n){const t=new Map;for(let e=0;e<n.length;e++){const i=n[e];i instanceof ts&&(i.baseVersion!==-1?t.set(i.name,{op:i,ranges:i.newRange?[i.newRange]:[]}):(i.newRange&&t.get(i.name).ranges.push(i.newRange),n.splice(e,1),e--))}for(const{op:e,ranges:i}of t.values())i.length?e.newRange=oe._createFromRanges(i):e.newRange=null}Pt(Ln,Ln,(n,t,e)=>{if(n.key===t.key&&n.range.start.hasSameParentAs(t.range.start)){const i=n.range.getDifference(t.range).map(r=>new Ln(r,n.key,n.oldValue,n.newValue,0)),s=n.range.getIntersection(t.range);return s&&e.aIsStrong&&i.push(new Ln(s,t.key,t.newValue,n.newValue,0)),i.length==0?[new $n(0)]:i}else return[n]});Pt(Ln,hi,(n,t)=>{if(n.range.start.hasSameParentAs(t.position)&&n.range.containsPosition(t.position)){const i=n.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(s=>new Ln(s,n.key,n.oldValue,n.newValue,n.baseVersion));if(t.shouldReceiveAttributes){const s=i4(t,n.key,n.oldValue);s&&i.unshift(s)}return i}return n.range=n.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[n]});function i4(n,t,e){const s=n.nodes.getNode(0).getAttribute(t);if(s==e)return null;const r=new oe(n.position,n.position.getShiftedBy(n.howMany));return new Ln(r,t,s,e,0)}Pt(Ln,Sn,(n,t)=>{const e=[];n.range.start.hasSameParentAs(t.deletionPosition)&&(n.range.containsPosition(t.deletionPosition)||n.range.start.isEqual(t.deletionPosition))&&e.push(oe._createFromPositionAndShift(t.graveyardPosition,1));const i=n.range._getTransformedByMergeOperation(t);return i.isCollapsed||e.push(i),e.map(s=>new Ln(s,n.key,n.oldValue,n.newValue,n.baseVersion))});Pt(Ln,Rt,(n,t)=>Dme(n.range,t).map(i=>new Ln(i,n.key,n.oldValue,n.newValue,n.baseVersion)));function Dme(n,t){const e=oe._createFromPositionAndShift(t.sourcePosition,t.howMany);let i=null,s=[];e.containsRange(n,!0)?i=n:n.start.hasSameParentAs(e.start)?(s=n.getDifference(e),i=n.getIntersection(e)):s=[n];const r=[];for(let o of s){o=o._getTransformedByDeletion(t.sourcePosition,t.howMany);const a=t.getMovedRangeStart(),l=o.start.hasSameParentAs(a),c=o._getTransformedByInsertion(a,t.howMany,l);r.push(...c)}return i&&r.push(i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),r}Pt(Ln,jt,(n,t)=>{if(n.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||n.range.end.offset++,[n];if(n.range.start.hasSameParentAs(t.splitPosition)&&n.range.containsPosition(t.splitPosition)){const e=n.clone();return e.range=new oe(t.moveTargetPosition.clone(),n.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),n.range.end=t.splitPosition.clone(),n.range.end.stickiness="toPrevious",[n,e]}return n.range=n.range._getTransformedBySplitOperation(t),[n]});Pt(hi,Ln,(n,t)=>{const e=[n];if(n.shouldReceiveAttributes&&n.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(n.position)){const i=i4(n,t.key,t.newValue);i&&e.push(i)}return e});Pt(hi,hi,(n,t,e)=>n.position.isEqual(t.position)&&e.aIsStrong?[n]:(n.position=n.position._getTransformedByInsertOperation(t),[n]));Pt(hi,Rt,(n,t)=>(n.position=n.position._getTransformedByMoveOperation(t),[n]));Pt(hi,jt,(n,t)=>(n.position=n.position._getTransformedBySplitOperation(t),[n]));Pt(hi,Sn,(n,t)=>(n.position=n.position._getTransformedByMergeOperation(t),[n]));Pt(ts,hi,(n,t)=>(n.oldRange&&(n.oldRange=n.oldRange._getTransformedByInsertOperation(t)[0]),n.newRange&&(n.newRange=n.newRange._getTransformedByInsertOperation(t)[0]),[n]));Pt(ts,ts,(n,t,e)=>{if(n.name==t.name)if(e.aIsStrong)n.oldRange=t.newRange?t.newRange.clone():null;else return[new $n(0)];return[n]});Pt(ts,Sn,(n,t)=>(n.oldRange&&(n.oldRange=n.oldRange._getTransformedByMergeOperation(t)),n.newRange&&(n.newRange=n.newRange._getTransformedByMergeOperation(t)),[n]));Pt(ts,Rt,(n,t)=>{const e=[n];if(n.oldRange&&(n.oldRange=oe._createFromRanges(n.oldRange._getTransformedByMoveOperation(t))),n.newRange){const i=n.newRange._getTransformedByMoveOperation(t);n.newRange=i[0];for(let s=1;s<i.length;s++){const r=n.clone();r.oldRange=null,r.newRange=i[s],r.baseVersion=-1,e.push(r)}}return e});Pt(ts,jt,(n,t,e)=>{if(n.oldRange&&(n.oldRange=n.oldRange._getTransformedBySplitOperation(t)),n.newRange){if(e.abRelation){const i=n.newRange._getTransformedBySplitOperation(t);return n.newRange.start.isEqual(t.splitPosition)?e.abRelation.wasStartBeforeMergedElement?n.newRange.start=me._createAt(t.insertionPosition):e.abRelation.wasInLeftElement?n.newRange.start=me._createAt(n.newRange.start):n.newRange.start=me._createAt(t.moveTargetPosition):n.newRange.start=i.start,n.newRange.end.isEqual(t.splitPosition)?n.newRange.end.isEqual(t.splitPosition)&&e.abRelation.wasEndBeforeMergedElement?n.newRange.end=me._createAt(t.insertionPosition):e.abRelation.wasInRightElement?n.newRange.end=me._createAt(t.moveTargetPosition):n.newRange.end=me._createAt(n.newRange.end):n.newRange.end=i.end,[n]}n.newRange=n.newRange._getTransformedBySplitOperation(t)}return[n]});Pt(Sn,hi,(n,t)=>(n.sourcePosition.hasSameParentAs(t.position)&&(n.howMany+=t.howMany),n.sourcePosition=n.sourcePosition._getTransformedByInsertOperation(t),n.targetPosition=n.targetPosition._getTransformedByInsertOperation(t),[n]));Pt(Sn,Sn,(n,t,e)=>{if(n.sourcePosition.isEqual(t.sourcePosition)&&n.targetPosition.isEqual(t.targetPosition))if(e.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),n.sourcePosition=new me(t.graveyardPosition.root,
vendor: 12,171 bytes, line 440
440i),n.howMany=0,[n]}else return[new $n(0)];if(n.sourcePosition.isEqual(t.sourcePosition)&&!n.targetPosition.isEqual(t.targetPosition)&&!e.bWasUndone&&e.abRelation!="splitAtSource"){const i=n.targetPosition.root.rootName=="$graveyard",s=t.targetPosition.root.rootName=="$graveyard";if(s&&!i||!(i&&!s)&&e.aIsStrong){const l=t.targetPosition._getTransformedByMergeOperation(t),c=n.targetPosition._getTransformedByMergeOperation(t);return[new Rt(l,n.howMany,c,0)]}else return[new $n(0)]}return n.sourcePosition.hasSameParentAs(t.targetPosition)&&(n.howMany+=t.howMany),n.sourcePosition=n.sourcePosition._getTransformedByMergeOperation(t),n.targetPosition=n.targetPosition._getTransformedByMergeOperation(t),(!n.graveyardPosition.isEqual(t.graveyardPosition)||!e.aIsStrong)&&(n.graveyardPosition=n.graveyardPosition._getTransformedByMergeOperation(t)),[n]});Pt(Sn,Rt,(n,t,e)=>{const i=oe._createFromPositionAndShift(t.sourcePosition,t.howMany);return t.type=="remove"&&!e.bWasUndone&&n.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(n.sourcePosition)?[new $n(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(n.sourcePosition)?n.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(n.sourcePosition)&&e.abRelation=="mergeSourceAffected"?n.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(n.targetPosition)?(n.targetPosition.stickiness="toNone",n.howMany-=t.howMany):t.targetPosition.isEqual(n.targetPosition)&&e.abRelation=="mergeTargetWasBefore"?(n.targetPosition.stickiness="toPrevious",n.howMany+=t.howMany):(n.sourcePosition.hasSameParentAs(t.targetPosition)&&(n.howMany+=t.howMany),n.sourcePosition.hasSameParentAs(t.sourcePosition)&&(n.howMany-=t.howMany)),n.sourcePosition=n.sourcePosition._getTransformedByMoveOperation(t),n.targetPosition=n.targetPosition._getTransformedByMoveOperation(t),n.sourcePosition.stickiness="toPrevious",n.targetPosition.stickiness="toNext",n.graveyardPosition.isEqual(t.targetPosition)||(n.graveyardPosition=n.graveyardPosition._getTransformedByMoveOperation(t)),[n])});Pt(Sn,jt,(n,t,e)=>{if(t.graveyardPosition&&(n.graveyardPosition=n.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),n.deletionPosition.isEqual(t.graveyardPosition)&&(n.howMany=t.howMany)),n.targetPosition.isEqual(t.splitPosition)&&(t.graveyardPosition&&n.deletionPosition.isEqual(t.graveyardPosition)||e.abRelation=="mergeTargetNotMoved"))return n.sourcePosition=n.sourcePosition._getTransformedBySplitOperation(t),[n];if(n.sourcePosition.isEqual(t.splitPosition)){if(e.abRelation=="mergeSourceNotMoved")return n.howMany=0,n.targetPosition=n.targetPosition._getTransformedBySplitOperation(t),[n];if(e.abRelation=="mergeSameElement"||n.sourcePosition.offset>0)return n.sourcePosition=t.moveTargetPosition.clone(),n.targetPosition=n.targetPosition._getTransformedBySplitOperation(t),[n]}return n.sourcePosition.hasSameParentAs(t.splitPosition)&&(n.howMany=t.splitPosition.offset),n.sourcePosition=n.sourcePosition._getTransformedBySplitOperation(t),n.targetPosition=n.targetPosition._getTransformedBySplitOperation(t),[n]});Pt(Rt,hi,(n,t)=>{const i=oe._createFromPositionAndShift(n.sourcePosition,n.howMany)._getTransformedByInsertOperation(t,!1)[0];return n.sourcePosition=i.start,n.howMany=i.end.offset-i.start.offset,n.targetPosition.isEqual(t.position)||(n.targetPosition=n.targetPosition._getTransformedByInsertOperation(t)),[n]});Pt(Rt,Rt,(n,t,e)=>{const i=oe._createFromPositionAndShift(n.sourcePosition,n.howMany),s=oe._createFromPositionAndShift(t.sourcePosition,t.howMany);let r=e.aIsStrong,o=!e.aIsStrong;e.abRelation=="insertBefore"||e.baRelation=="insertAfter"?o=!0:(e.abRelation=="insertAfter"||e.baRelation=="insertBefore")&&(o=!1);let a;if(n.targetPosition.isEqual(t.targetPosition)&&o?a=n.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):a=n.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),AF(n,t)&&AF(t,n))return[t.getReversed()];if(i.containsPosition(t.targetPosition)&&i.containsRange(s,!0))return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),gf([i],a);if(s.containsPosition(n.targetPosition)&&s.containsRange(i,!0))return i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),gf([i],a);const u=li(n.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(u=="prefix"||u=="extension")return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),gf([i],a);n.type=="remove"&&t.type!="remove"&&!e.aWasUndone&&!e.forceWeakRemove?r=!0:n.type!="remove"&&t.type=="remove"&&!e.bWasUndone&&!e.forceWeakRemove&&(r=!1);const d=[],h=i.getDifference(s);for(const p of h){p.start=p.start._getTransformedByDeletion(t.sourcePosition,t.howMany),p.end=p.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const v=li(p.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same",E=p._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,v);d.push(...E)}const f=i.getIntersection(s);return f!==null&&r&&(f.start=f.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),f.end=f.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),d.length===0?d.push(f):d.length==1?s.start.isBefore(i.start)||s.start.isEqual(i.start)?d.unshift(f):d.push(f):d.splice(1,0,f)),d.length===0?[new $n(n.baseVersion)]:gf(d,a)});Pt(Rt,jt,(n,t,e)=>{let i=n.targetPosition.clone();if((!n.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||e.abRelation=="moveTargetAfter")&&(i=n.targetPosition._getTransformedBySplitOperation(t)),n.sourcePosition.isEqual(t.insertionPosition)&&e.abRelation=="firstToMoveMerged")return n.howMany++,n.targetPosition=i,[n];const s=oe._createFromPositionAndShift(n.sourcePosition,n.howMany);if(s.end.isEqual(t.insertionPosition))return(!t.graveyardPosition||e.abRelation=="lastToMoveMerged")&&n.howMany++,n.targetPosition=i,[n];if(s.start.hasSameParentAs(t.splitPosition)&&s.containsPosition(t.splitPosition)){let a=new oe(t.splitPosition,s.end);a=a._getTransformedBySplitOperation(t);const l=[new oe(s.start,t.splitPosition),a];return gf(l,i)}n.targetPosition.isEqual(t.splitPosition)&&e.abRelation=="insertAtSource"&&(i=t.moveTargetPosition),n.targetPosition.isEqual(t.insertionPosition)&&e.abRelation=="insertBetween"&&(i=n.targetPosition);const o=[s._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const a=s.start.isEqual(t.graveyardPosition)||s.containsPosition(t.graveyardPosition);n.howMany>1&&a&&!e.aWasUndone&&o.push(oe._createFromPositionAndShift(t.insertionPosition,1))}return gf(o,i)});Pt(Rt,Sn,(n,t,e)=>{const i=oe._createFromPositionAndShift(n.sourcePosition,n.howMany);if(t.deletionPosition.hasSameParentAs(n.sourcePosition)&&i.containsPosition(t.sourcePosition)){if(n.type=="remove"&&!e.forceWeakRemove){if(!e.aWasUndone){const o=[];let a=t.graveyardPosition.clone(),l=t.targetPosition._getTransformedByMergeOperation(t);const c=n.targetPosition.getTransformedByOperation(t);n.howMany>1&&(o.push(new Rt(n.sourcePosition,n.howMany-1,c,0)),a=a._getTransformedByMove(n.sourcePosition,c,n.howMany-1),l=l._getTransformedByMove(n.sourcePosition,c,n.howMany-1));const u=t.deletionPosition._getCombined(n.sourcePosition,c),d=new Rt(a,1,u,0),h=d.getMovedRangeStart().path.slice();h.push(0);const f=new me(d.targetPosition.root,h);l=l._getTransformedByMove(a,u,1);const p=new Rt(l,t.howMany,f,0);return o.push(d),o.push(p),o}}else if(n.howMany==1)return e.bWasUndone?(n.sourcePosition=t.graveyardPosition.clone(),n.targetPosition=n.targetPosition._getTransformedByMergeOperation(t),[n]):[new $n(0)]}const r=oe._createFromPositionAndShift(n.sourcePosition,n.howMany)._getTransformedByMergeOperation(t);return n.sourcePosition=r.start,n.howMany=r.end.offset-r.start.offset,n.targetPosition=n.targetPosition._getTransformedByMergeOperation(t),[n]});Pt(vs,hi,(n,t)=>(n.position=n.position._getTransformedByInsertOperation(t),[n]));Pt(vs,Sn,(n,t)=>n.position.isEqual(t.deletionPosition)?(n.position=t.graveyardPosition.clone(),n.position.stickiness="toNext",[n]):(n.position=n.position._getTransformedByMergeOperation(t),[n]));Pt(vs,Rt,(n,t)=>(n.position=n.position._getTransformedByMoveOperation(t),[n]));Pt(vs,vs,(n,t,e)=>{if(n.position.isEqual(t.position))if(e.aIsStrong)n.oldName=t.newName;else return[new $n(0)];return[n]});Pt(vs,jt,(n,t)=>{const e=n.position.path,i=t.splitPosition.getParentPath();if(li(e,i)=="same"&&!t.graveyardPosition){const s=new vs(n.position.getShiftedBy(1),n.oldName,n.newName,0);return[n,s]}return n.position=n.position._getTransformedBySplitOperation(t),[n]});Pt(ul,ul,(n,t,e)=>{if(n.root===t.root&&n.key===t.key)if(e.aIsStrong)n.oldValue=t.newValue;else return[new $n(0)];return[n]});Pt(Xo,Xo,(n,t)=>n.rootName===t.rootName&&n.isAdd===t.isAdd?[new $n(0)]:[n]);Pt(jt,hi,(n,t)=>(n.splitPosition.hasSameParentAs(t.position)&&n.splitPosition.offset<t.position.offset&&(n.howMany+=t.howMany),n.splitPosition=n.splitPosition._getTransformedByInsertOperation(t),n.insertionPosition=n.insertionPosition._getTransformedByInsertOperation(t),[n]));Pt(jt,Sn,(n,t,e)=>{if(!n.graveyardPosition&&!e.bWasUndone&&n.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const s=new me(t.graveyardPosition.root,i),r=jt.getInsertionPosition(new me(t.graveyardPosition.root,i)),o=new jt(s,0,r,null,0);return n.splitPosition=n.splitPosition._getTransformedByMergeOperation(t),n.insertionPosition=jt.getInsertionPosition(n.splitPosition),n.graveyardPosition=o.insertionPosition.clone(),n.graveyardPosition.stickiness="toNext",[o,n]}return n.splitPosition.hasSameParentAs(t.deletionPosition)&&!n.splitPosition.isAfter(t.deletionPosition)&&n.howMany--,n.splitPosition.hasSameParentAs(t.targetPosition)&&(n.howMany+=t.howMany),n.splitPosition=n.splitPosition._getTransformedByMergeOperation(t),n.insertionPosition=jt.getInsertionPosition(n.splitPosition),n.graveyardPosition&&(n.graveyardPosition=n.graveyardPosition._getTransformedByMergeOperation(t)),[n]});Pt(jt,Rt,(n,t,e)=>{const i=oe._createFromPositionAndShift(t.sourcePosition,t.howMany);if(n.graveyardPosition){const r=i.start.isEqual(n.graveyardPosition)||i.containsPosition(n.graveyardPosition);if(!e.bWasUndone&&r){const o=n.splitPosition._getTransformedByMoveOperation(t),a=n.graveyardPosition._getTransformedByMoveOperation(t),l=a.path.slice();l.push(0);const c=new me(a.root,l);return[new Rt(o,n.howMany,c,0)]}n.graveyardPosition=n.graveyardPosition._getTransformedByMoveOperation(t)}const s=n.splitPosition.isEqual(t.targetPosition);if(s&&(e.baRelation=="insertAtSource"||e.abRelation=="splitBefore"))return n.howMany+=t.howMany,n.splitPosition=n.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),n.insertionPosition=jt.getInsertionPosition(n.splitPosition),[n];if(s&&e.abRelation&&e.abRelation.howMany){const{howMany:r,offset:o}=e.abRelation;return n.howMany+=r,n.splitPosition=n.splitPosition.getShiftedBy(o),[n]}if(n.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(n.splitPosition)){const r=t.howMany-(n.splitPosition.offset-t.sourcePosition.offset);return n.howMany-=r,n.splitPosition.hasSameParentAs(t.targetPosition)&&n.splitPosition.offset<t.targetPosition.offset&&(n.howMany+=t.howMany),n.splitPosition=t.sourcePosition.clone(),n.insertionPosition=jt.getInsertionPosition(n.splitPosition),[n]}return t.sourcePosition.isEqual(t.targetPosition)||(n.splitPosition.hasSameParentAs(t.sourcePosition)&&n.splitPosition.offset<=t.sourcePosition.offset&&(n.howMany-=t.howMany),n.splitPosition.hasSameParentAs(t.targetPosition)&&n.splitPosition.offset<t.targetPosition.offset&&(n.howMany+=t.howMany)),n.splitPosition.stickiness="toNone",n.splitPosition=n.splitPosition._getTransformedByMoveOperation(t),n.splitPosition.stickiness="toNext",n.graveyardPosition?n.insertionPosition=n.insertionPosition._getTransformedByMoveOperation(t):n.insertionPosition=jt.getInsertionPosition(n.splitPosition),[n]});Pt(jt,jt,(n,t,e)=>
440{if(n.splitPosition.isEqual(t.splitPosition)){if(!n.graveyardPosition&&!t.graveyardPosition)return[new $n(0)];if(n.graveyardPosition&&t.graveyardPosition&&n.graveyardPosition.isEqual(t.graveyardPosition))return[new $n(0)];if(e.abRelation=="splitBefore")return n.howMany=0,n.graveyardPosition=n.graveyardPosition._getTransformedBySplitOperation(t),[n]}if(n.graveyardPosition&&t.graveyardPosition&&n.graveyardPosition.isEqual(t.graveyardPosition)){const i=n.splitPosition.root.rootName=="$graveyard",s=t.splitPosition.root.rootName=="$graveyard";if(s&&!i||!(i&&!s)&&e.aIsStrong){const l=[];return t.howMany&&l.push(new Rt(t.moveTargetPosition,t.howMany,t.splitPosition,0)),n.howMany&&l.push(new Rt(n.splitPosition,n.howMany,n.moveTargetPosition,0)),l}else return[new $n(0)]}if(n.graveyardPosition&&(n.graveyardPosition=n.graveyardPosition._getTransformedBySplitOperation(t)),n.splitPosition.isEqual(t.insertionPosition)&&e.abRelation=="splitBefore")return n.howMany++,[n];if(t.splitPosition.isEqual(n.insertionPosition)&&e.baRelation=="splitBefore"){const i=t.insertionPosition.path.slice();i.push(0);const s=new me(t.insertionPosition.root,i),r=new Rt(n.insertionPosition,1,s,0);return[n,r]}return n.splitPosition.hasSameParentAs(t.splitPosition)&&n.splitPosition.offset<t.splitPosition.offset&&(n.howMany-=t.howMany),n.splitPosition=n.splitPosition._getTransformedBySplitOperation(t),n.insertionPosition=jt.getInsertionPosition(n.splitPosition),[n]});function AF(n,t){return n.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany)===null}function gf(n,t){const e=[];for(let i=0;i<n.length;i++){const s=n[i],r=new Rt(s.start,s.end.offset-s.start.offset,t,0);e.push(r);for(let o=i+1;o<n.length;o++)n[o]=n[o]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];t=t._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return e}class Mn extends Gt(me){constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new ee("model-liveposition-root-not-rootelement",t);Rme.call(this)}detach(){this.stopListening()}toPosition(){return new me(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}Mn.prototype.is=function(n){return n==="livePosition"||n==="model:livePosition"||n=="position"||n==="model:position"};function Rme(){this.listenTo(this.root.document.model,"applyOperation",(n,t)=>{const e=t[0];e.isDocumentOperation&&Lme.call(this,e)},{priority:"low"})}function Lme(n){const t=this.getTransformedByOperation(n);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}class $h{constructor(t={}){y(this,"operations");y(this,"isUndoable");y(this,"isLocal");y(this,"isUndo");y(this,"isTyping");typeof t=="string"&&(t=t==="transparent"?{isUndoable:!1}:{},Dt("batch-constructor-deprecated-string-type"));const{isUndoable:e=!0,isLocal:i=!0,isUndo:s=!1,isTyping:r=!1}=t;this.operations=[],this.isUndoable=e,this.isLocal=i,this.isUndo=s,this.isTyping=r}get baseVersion(){for(const t of this.operations)if(t.baseVersion!==null)return t.baseVersion;return null}addOperation(t){return t.isDocumentOperation&&(t.batch=this,this.operations.push(t)),t}}const bb=class bb{constructor(t){y(this,"_markerCollection");y(this,"_changesInElement",new Map);y(this,"_elementsSnapshots",new Map);y(this,"_elementChildrenSnapshots",new Map);y(this,"_elementState",new Map);y(this,"_changedMarkers",new Map);y(this,"_changedRoots",new Map);y(this,"_changeCount",0);y(this,"_cachedChanges",null);y(this,"_cachedChangesWithGraveyard",null);y(this,"_refreshedItems",new Set);this._markerCollection=t}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(t){const e=t;switch(e.type){case"insert":{if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break}case"addAttribute":case"removeAttribute":case"changeAttribute":{for(const i of e.range.getItems({shallow:!0}))this._isInInsertedElement(i.parent)||this._markAttribute(i);break}case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const i=this._isInInsertedElement(e.sourcePosition.parent),s=this._isInInsertedElement(e.targetPosition.parent);i||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),s||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);const r=oe._createFromPositionAndShift(e.sourcePosition,e.howMany);for(const o of r.getItems({shallow:!0}
vendor: 5,283 bytes, line 440
440))this._setElementState(o,"move");break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const i=oe._createFromPositionAndShift(e.position,1);for(const s of this._markerCollection.getMarkersIntersectingRange(i)){const r=s.getData();this.bufferMarkerChange(s.name,r,r)}this._setElementState(e.position.nodeAfter,"rename");break}case"split":{const i=e.splitPosition.parent;if(!this._isInInsertedElement(i)){this._markRemove(i,e.splitPosition.offset,e.howMany);const s=oe._createFromPositionAndShift(e.splitPosition,e.howMany);for(const r of s.getItems({shallow:!0}))this._setElementState(r,"move")}this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&(this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1),this._setElementState(e.graveyardPosition.nodeAfter,"move"));break}case"merge":{const i=e.sourcePosition.parent;this._isInInsertedElement(i.parent)||this._markRemove(i.parent,i.startOffset,1);const s=e.graveyardPosition.parent;this._markInsert(s,e.graveyardPosition.offset,1),this._setElementState(i,"move");const r=e.targetPosition.parent;if(!this._isInInsertedElement(r)){this._markInsert(r,e.targetPosition.offset,i.maxOffset);const o=oe._createFromPositionAndShift(e.sourcePosition,e.howMany);for(const a of o.getItems({shallow:!0}))this._setElementState(a,"move")}break}case"detachRoot":case"addRoot":{const i=e.affectedSelectable;if(!i._isLoaded||i.isAttached()==e.isAdd)return;this._bufferRootStateChange(e.rootName,e.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!e.root._isLoaded)return;const i=e.root.rootName;this._bufferRootAttributeChange(i,e.key,e.oldValue,e.newValue);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i){e.range&&e.range.root.is("rootElement")&&!e.range.root._isLoaded&&(e.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let s=this._changedMarkers.get(t);s?s.newMarkerData=i:(s={newMarkerData:i,oldMarkerData:e},this._changedMarkers.set(t,s)),s.oldMarkerData.range==null&&i.range==null&&this._changedMarkers.delete(t)}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)i.oldMarkerData.range!=null&&t.push({name:e,range:i.oldMarkerData.range});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)i.newMarkerData.range!=null&&t.push({name:e,range:i.newMarkerData.range});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(([t,e])=>({name:t,data:{oldRange:e.oldMarkerData.range,newRange:e.newMarkerData.range}}))}hasDataChanges(){if(this.getChanges().length||this._changedRoots.size>0)return!0;for(const{newMarkerData:t,oldMarkerData:e}of this._changedMarkers.values()){if(t.affectsData!==e.affectsData)return!0;if(t.affectsData){const i=t.range&&!e.range,s=!t.range&&e.range,r=t.range&&e.range&&!t.range.isEqual(e.range);if(i||s||r)return!0}}return!1}getChanges(t={}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let e=[];for(const i of this._changesInElement.keys()){const s=this._changesInElement.get(i).sort((u,d)=>u.offset===d.offset?u.type!=d.type?u.type=="remove"?-1:1:0:u.offset<d.offset?-1:1),r=this._elementChildrenSnapshots.get(i),o=kF(i.getChildren()),a=Fme(r.length,s);let l=0,c=0;for(const u of a)if(u==="i"){const d=this._getDiffActionForNode(o[l].node,"insert"),h=this._elementsSnapshots.get(o[l].node),f=this._getInsertDiff(i,l,d,o[l],h);e.push(f),l++}else if(u==="r"){const d=this._getDiffActionForNode(r[c].node,"remove"),h=this._getRemoveDiff(i,l,d,r[c]);e.push(h),c++}else if(u==="a"){const d=r[c].attributes,h=o[l].attributes;let f;if(o[l].name=="$text")f=new oe(me._createAt(i,l),me._createAt(i,l+1));else{const v=i.offsetToIndex(l);f=new oe(me._createAt(i,l),me._createAt(i.getChild(v),0))}const p=this._getAttributesDiff(f,d,h);e.push(...p),l++,c++}else l++,c++}e.sort((i,s)=>i.position.root!=s.position.root?i.position.root.rootName<s.position.root.rootName?-1:1:i.position.isEqual(s.position)?i.changeCount-s.changeCount:i.position.isBefore(s.position)?-1:1);for(let i=1,s=0;i<e.length;i++){const r=e[s],o=e[i],a=r.type=="remove"&&o.type=="remove"&&r.name=="$text"&&o.name=="$text"&&r.position.isEqual(o.position),l=r.type=="insert"&&o.type=="insert"&&r.name=="$text"&&o.name=="$text"&&r.position.parent==o.position.parent&&r.position.offset+r.length==o.position.offset,c=r.type=="attribute"&&o.type=="attribute"&&r.position.parent==o.position.parent&&r.range.isFlat&&o.range.isFlat&&r.position.offset+r.length==o.position.offset&&r.attributeKey==o.attributeKey&&r.attributeOldValue==o.attributeOldValue&&r.attributeNewValue==o.attributeNewValue;a||l||c?(r.length++,c&&(r.range.end=r.range.end.getShiftedBy(1)),e[i]=null):s=i}e=e.filter(i=>i);for(const i of e)delete i.changeCount,i.type=="attribute"&&(delete i.position,delete i.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e,this._cachedChanges=e.filter(Nme),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}
440getChangedRoots(){return Array.from(this._changedRoots.values()).map(t=>{const e={...t};return e.state!==void 0&&delete e.attributes,e})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize),this._refreshedItems.add(t),this._setElementState(t,"refresh");const e=oe._createOn(t);for(const i of this._markerCollection.getMarkersIntersectingRange(e)){const s=i.getData();this.bufferMarkerChange(i.name,s,s)}this._cachedChanges=null}_bufferRootLoad(t){if(t.isAttached()){this._bufferRootStateChange(t.rootName,!0),this._markInsert(t,0,t.maxOffset);for(const e of t.getAttributeKeys())this._bufferRootAttributeChange(t.rootName,e,null,t.getAttribute(e));for(const e of this._markerCollection)if(e.getRange().root==t){const i=e.getData();this.bufferMarkerChange(e.name,{...i,range:null},i)}}}_bufferRootStateChange(t,e){if(!this._changedRoots.has(t)){this._changedRoots.set(t,{name:t,state:e?"attached":"detached"});return}const i=this._changedRoots.get(t);i.state!==void 0?(delete i.state,i.attributes===void 0&&this._changedRoots.delete(t)):i.state=e?"attached":"detached"}_bufferRootAttributeChange(t,e,i,s){const r=this._changedRoots.get(t)||{name:t},o=r.attributes||{};if(o[e]){const a=o[e];s===a.oldValue?delete o[e]:a.newValue=s}else o[e]={oldValue:i,newValue:s};Object.entries(o).length===0?(delete r.attributes,r.state===void 0&&this._changedRoots.delete(t)):(r.attributes=o,this._changedRoots.set(t,r))}_markInsert(t,e,i){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const s={type:"insert",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,s)}_markRemove(t,e,i){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const s={type:"remove",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,s),this._removeAllNestedChanges(t,e,i)}_markAttribute(t){if(t.root.is("rootElement")&&!t.root._isLoaded)return;const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshots(t);const i=this._getChangesForElement(t);this._handleChange(e,i),i.push(e);for(let s=0;s<i.length;s++)i[s].howMany<1&&(i.splice(s,1),s--)}_setElementState(t,e){if(!t.is("element"))return;const i=bb._statesPriority.indexOf(this._elementState.get(t));bb._statesPriority.indexOf(e)>i&&this._elementState.set(t,e)}_getDiffActionForNode(t,e){if(!t.is("element")||!this._elementsSnapshots.has(t))return e;const i=this._elementState.get(t);return!i||i=="move"?e:i}_getChangesForElement(t){let e;return this._changesInElement.has(t)?e=this._changesInElement.get(t):(e=[],this._changesInElement.set(t,e)),e}_makeSnapshots(t){if(this._elementChildrenSnapshots.has(t))return;const e=kF(t.getChildren());this._elementChildrenSnapshots.set(t,e);for(const i of e)this._elementsSnapshots.set(i.node,i)}_handleChange(t,e){t.nodesToHandle=t.howMany;for(const i of e){const s=t.offset+t.howMany,r=i.offset+i.howMany;if(t.type=="insert"&&(i.type=="insert"&&(t.offset<=i.offset?i.offset+=t.howMany:t.offset<r&&(i.howMany+=t.nodesToHandle,t.nodesToHandle=0)),i.type=="remove"&&t.offset<i.offset&&(i.offset+=t.howMany),i.type=="attribute")){if(t.offset<=i.offset)i.offset+=t.howMany;else if(t.offset<r){const o=i.howMany;i.howMany=t.offset-i.offset,e.unshift({type:"attribute",offset:s,howMany:o-i.howMany,count:this._changeCount++})}}if(t.type=="remove"){if(i.type=="insert"){if(s<=i.offset)i.offset-=t.howMany;else if(s<=r)if(t.offset<i.offset){const o=s-i.offset;i.offset=t.offset,i.howMany-=o,t.nodesToHandle-=o}else i.howMany-=t.nodesToHandle,t.nodesToHandle=0;else if(t.offset<=i.offset)t.nodesToHandle-=i.howMany,i.howMany=0;else if(t.offset<r){const o=r-t.offset;i.howMany-=o,t.nodesToHandle-=o}}if(i.type=="remove"&&(s<=i.offset?i.offset-=t.howMany:t.offset<i.offset&&(t.nodesToHandle+=i.howMany,i.howMany=0)),i.type=="attribute"){if(s<=i.offset)i.offset-=t.howMany;else if(t.offset<i.offset){const o=s-i.offset;i.offset=t.offset,i.howMany-=o}else if(t.offset<r)if(s<=r){const o=i.howMany;i.howMany=t.offset-i.offset;const a=o-i.howMany-t.nodesToHandle;e.unshift({type:"attribute",offset:t.offset,howMany:a,count:this._changeCount++})}else i.howMany-=r-t.offset}}if(t.type=="attribute"){if(i.type=="insert")if(t.offset<i.offset&&s>i.offset){if(s>r){const o={type:"attribute",offset:r,howMany:s-r,count:this._changeCount++};this._handleChange(o,e),e.push(o)}
440t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offset<r&&(s>r?(t.nodesToHandle=s-r,t.offset=r):t.nodesToHandle=0);if(i.type=="remove"&&t.offset<i.offset&&s>i.offset){const o={type:"attribute",offset:i.offset,howMany:s-i.offset,count:this._changeCount++};this._handleChange(o,e),e.push(o),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}i.type=="attribute"&&(t.offset>=i.offset&&s<=r?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&s>=r&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i,s,r){const o={type:"insert",position:me._createAt(t,e),name:s.name,attributes:new Map(s.attributes),length:1,changeCount:this._changeCount++,action:i};return i!="insert"&&r&&(o.before={name:r.name,attributes:new Map(r.attributes)}),o}_getRemoveDiff(t,e,i,s){return{type:"remove",action:i,position:me._createAt(t,e),name:s.name,attributes:new Map(s.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const s=[];i=new Map(i);for(const[r,o]of e){const a=i.has(r)?i.get(r):null;a!==o&&s.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:o,attributeNewValue:a,changeCount:this._changeCount++}),i.delete(r)}for(const[r,o]of i)s.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return s}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),s=t.startOffset;if(i){for(const r of i)if(r.type=="insert"&&s>=r.offset&&s<r.offset+r.howMany)return!0}return this._isInInsertedElement(e)}_removeAllNestedChanges(t,e,i){const s=new oe(me._createAt(t,e),me._createAt(t,e+i));for(const r of s.getItems({shallow:!0}))r.is("element")&&(this._changesInElement.delete(r),this._removeAllNestedChanges(r,0,r.maxOffset))}};y(bb,"_statesPriority",[void 0,"refresh","rename","move"]);let gI=bb;function CF(n){return{node:n,name:n.is("$text")?"$text":n.name,attributes:new Map(n.getAttributes())}}function kF(n){const t=[];for(const e of n)if(e.is("$text"))for(let i=0;i<e.data.length;++i)t.push(CF(e));else t.push(CF(e));return t}function Fme(n,t){const e=[];let i=0,s=0;for(const r of t){if(r.offset>i){for(let o=0;o<r.offset-i;o++)e.push("e");s+=r.offset-i}if(r.type=="insert"){for(let o=0;o<r.howMany;
440o++)e.push("i");i=r.offset+r.howMany}else if(r.type=="remove"){for(let o=0;o<r.howMany;o++)e.push("r");i=r.offset,s+=r.howMany}else{if(r.howMany>1500)for(let o=0;o<r.howMany;o++)e.push("a");else e.push(..."a".repeat(r.howMany).split(""));i=r.offset+r.howMany,s+=r.howMany}}if(s<n)for(let r=0;r<n-s-i;r++)e.push("e");return e}function Nme(n){const t="position"in n&&n.position.root.rootName=="$graveyard",e="range"in n&&n.range.root.rootName=="$graveyard";return!t&&!e}class Bme{constructor(){y(this,"_operations",[]);y(this,"_undoPairs",new Map);y(this,"_undoneOperations",new Set);y(this,"_baseVersionToOperationIndex",new Map);y(this,"_version",0);y(this,"_gaps",new Map)}get version(){return this._version}set version(t){this._operations.length&&t>this._version+1&&this._gaps.set(this._version,t),this._version=t}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(t){if(t.baseVersion!==this.version)throw new ee("model-document-history-addoperation-incorrect-version",this,{operation:t,historyVersion:this.version});this._operations.push(t),this._version++,this._baseVersionToOperationIndex.set(t.baseVersion,this._operations.length-1)}getOperations(t,e=this.version){if(!this._operations.length)return[];const i=this._operations[0];t===void 0&&(t=i.baseVersion);let s=e-1;for(const[a,l]of this._gaps)t>a&&t<l&&(t=l),s>a&&s<l&&(s=a-1);if(s<i.baseVersion||t>this.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(t);r===void 0&&(r=0);let o=this._baseVersionToOperationIndex.get(s);return o===void 0&&(o=this._operations.length-1),this._operations.slice(r,o+1)}getOperation(t){const e=this._baseVersionToOperationIndex.get(t);if(e!==void 0)return this._operations[e]}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class jE extends Kt{constructor(e,i,s="main"){super(i);y(this,"rootName");y(this,"_document");y(this,"_isAttached",!0);y(this,"_isLoaded",!0);this._document=e,this.rootName=s}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}jE.prototype.is=function(n,t){return t?t===this.name&&(n==="rootElement"||n==="model:rootElement"||n==="element"||n==="model:element"):n==="rootElement"||n==="model:rootElement"||n==="element"||n==="model:element"||n==="node"||n==="model:node"};const IF="$graveyard";class Vme extends Gt(){constructor(e){super();y(this,"model");y(this,"history");y(this,"selection");y(this,"roots");y(this,"differ");y(this,"isReadOnly");y(this,"_postFixers");y(this,"_hasSelectionChangedFromTheLastChangeBlock");this.model=e,this.history=new Bme,this.selection=new uo(this),this.roots=new er({idProperty:"rootName"}),this.differ=new gI(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",IF),this.listenTo(e,"applyOperation",(i,s)=>{const r=s[0];r.isDocumentOperation&&this.differ.bufferOperation(r)},{priority:"high"}),this.listenTo(e,"applyOperation",(i,s)=>{const r=s[0];r.isDocumentOperation&&this.history.addOperation(r)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(i,s,r,o,a)=>{const l={...s.getData(),range:o};this.differ.bufferMarkerChange(s.name,a,l),r===null&&s.on("change",(c,u)=>{const d=s.getData();this.differ.bufferMarkerChange(s.name,{...d,range:u},d)})}),this.registerPostFixer(i=>{let s=!1;for(const r of this.roots)!r.isAttached()&&!r.isEmpty&&(i.remove(i.createRangeIn(r)),s=!0);for(const r of this.model.markers)r.getRange().root.isAttached()||(i.removeMarker(r),s=!0);return s})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(IF)}createRoot(e="$root",i="main"){if(this.roots.get(i))throw new ee("model-document-createroot-name-exists",this,{name:i});const s=new jE(this,e,i);return this.roots.add(s),s}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map(i=>i.rootName)}getRoots(e=!1){return this.roots.filter(i=>i!=this.graveyard&&(e||i.isAttached())&&i._isLoaded)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=hde(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),i=this.model,s=i.schema,r=i.createPositionFromPath(e,[0]);return s.getNearestSelectionRange(r)||i.createRange(r)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&PF(e.start)&&PF(e.end)}_callPostFixers(e){let i=!1;do for(const s of this._postFixers)if(this.selection.refresh(),i=s(e),i)break;while(i)}}function PF(n){const t=n.textNode;if(t){const e=t.data,i=n.offset-t.startOffset;return!XM(e,i)&&!JM(e,i)}return!0}class Hme extends Gt(){constructor(){super(...arguments);y(this,"_markers",new Map)}[Symbol.iterator](){return this._markers.values()}has(e){const i=e instanceof sf?e.name:e;return this._markers.has(i)}get(e){return this._markers.get(e)||null}_set(e,i,s=!1,r=!1){const o=e instanceof sf?e.name:e;if(o.includes(","))throw new ee("markercollection-incorrect-marker-name",this);const a=this._markers.get(o);if(a){const u=a.getData(),d=a.getRange();let h=!1;return d.isEqual(i)||(a._attachLiveRange(js.fromRange(i)),h=!0),s!=a.managedUsingOperations&&(a._managedUsingOperations=s,h=!0),typeof r=="boolean"&&r!=a.affectsData&&(a._affectsData=r,h=!0),h&&this.fire(`update:${o}`,a,d,i,u),a}const l=js.fromRange(i),c=new sf(o,l,s,r);return this._markers.set(o,c),this.fire(`update:${o}`,c,null,i,{...c.getData(),range:null}),c}_remove(e){const i=e instanceof sf?e.name:e,s=this._markers.get(i);return s?(this._markers.delete(i),this.fire(`update:${i}`,s,s.getRange(),null,s.getData()),this._destroyMarker(s),!0):!1}_refresh(e){const i=e instanceof sf?e.name:e,s=this._markers.get(i);if(!s)throw new ee("markercollection-refresh-marker-not-exists",this);const r=s.getRange();this.fire(`update:${i}`,s,r,r,s.getData())}*getMarkersAtPosition(e){for(const i of this)i.getRange().containsPosition(e)&&(yield i)}*getMarkersIntersectingRange(e){for(const i of this)i.getRange().getIntersection(e)!==null&&(yield i)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const i of this._markers.values())i.name.startsWith(e+":")&&(yield i)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class sf extends Gt(Xc){constructor(e,i,s,r){super();y(this,"name");y(this,"_managedUsingOperations");y(this,"_affectsData");y(this,"_liveRange");this.name=e,this._liveRange=this._attachLiveRange(i),this._managedUsingOperations=s,this._affectsData=r}get managedUsingOperations(){if(!this._liveRange)throw new ee("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new ee("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}
440getStart(){if(!this._liveRange)throw new ee("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new ee("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new ee("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){var e;return{name:this.name,range:(e=this._liveRange)==null?void 0:e.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}sf.prototype.is=function(n){return n==="marker"||n==="model:marker"};class zme extends Ks{constructor(e,i){super(null);y(this,"sourcePosition");y(this,"howMany");this.sourcePosition=e.clone(),this.howMany=i}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new ee("detach-operation-on-document-node",this)}_execute(){e4(oe._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Co extends Xc{constructor(e){super();y(this,"markers",new Map);y(this,"_children",new fb);e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let i=this;for(const s of e)i=i.getChildAtOffset(s);return i}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const i of this._children)e.push(i.toJSON());return e}static fromJSON(e){const i=[];for(const s of e)s.name?i.push(Kt.fromJSON(s)):i.push(tn.fromJSON(s));return new Co(i)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,i){const s=$me(i);for(const r of s)r.parent!==null&&r._remove(),r.parent=this;this._children._insertNodes(e,s)}_removeChildren(e,i=1){const s=this._children._removeNodes(e,i);for(const r of s)r.parent=null;return s}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const i of e)i.parent=null}}Co.prototype.is=function(n){return n==="documentFragment"||n==="model:documentFragment"};function $me(n){return typeof n=="string"?[new tn(n)]:(qs(n)||(n=[n]),Array.from(n).map(t=>typeof t=="string"?new tn(t):t instanceof to?new tn(t.data,t.getAttributes()):t))}class Wme{constructor(t,e){y(this,"model");y(this,"batch");this.model=t,this.batch=e}createText(t,e){return new tn(t,e)}createElement(t,e){return new Kt(t,e)}createDocumentFragment(){return new Co}cloneElement(t,e=!0){return t._clone(e)}insert(t,e,i=0){if(this._assertWriterUsedCorrectly(),t instanceof tn&&t.data=="")return;const s=me._createAt(e,i);if(t.parent)if(DF(t.root,s.root)){this.move(oe._createOn(t),s);return}else{if(t.root.document)throw new ee("model-writer-insert-forbidden-move",this);this.remove(t)}const r=s.root.document?s.root.document.version:null,o=t instanceof Co?t._removeChildren(0,t.childCount):t,a=new hi(s,o,r);if(t instanceof tn&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),t instanceof Co)for(const[l,c]of t.markers){const u=me._createAt(c.root,0),h={range:new oe(c.start._getCombined(u,s),c.end._getCombined(u,s)),usingOperation:!0,affectsData:!0};this.model.markers.has(l)?this.updateMarker(l,h):this.addMarker(l,h)}}insertText(t,e,i,s){e instanceof Co||e instanceof Kt||e instanceof me?this.insert(this.createText(t),e,i):this.insert(this.createText(t,e),i,s)}insertElement(t,e,i,s){e instanceof Co||e instanceof Kt||e instanceof me?this.insert(this.createElement(t),e,i):this.insert(this.createElement(t,e),i,s)}append(t,e){this.insert(t,e,"end")}appendText(t,e,i){e instanceof Co||e instanceof Kt?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),i,"end")}appendElement(t,e,i){e instanceof Co||e instanceof Kt?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),i,"end")}setAttribute(t,e,i){if(this._assertWriterUsedCorrectly(),i instanceof oe){const s=i.getMinimalFlatRanges();for(const r of s)MF(this,t,e,r)}else OF(this,t,e,i)}setAttributes(t,e){for(const[i,s]of Qo(t))this.setAttribute(i,s,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof oe){const i=e.getMinimalFlatRanges();for(const s of i)MF(this,t,null,s)}else OF(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=i=>{for(const s of i.getAttributeKeys())this.removeAttribute(s,i)};if(!(t instanceof oe))e(t);else for(const i of t.getItems())e(i)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof oe))throw new ee("writer-move-invalid-range",this);if(!t.isFlat)throw new ee("writer-move-range-not-flat",this);const s=me._createAt(e,i);if(s.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!DF(t.root,s.root))throw new ee("writer-move-different-document",this);const r=t.root.document?t.root.document.version:null,o=new Rt(t.start,t.end.offset-t.start.offset,s,r);this.batch.addOperation(o),this.model.applyOperation(o)}remove(t){this._assertWriterUsedCorrectly();const i=(t instanceof oe?t:oe._createOn(t)).getMinimalFlatRanges().reverse();for(const s of i)this._addOperationForAffectedMarkers("move",s),Ume(s.start,s.end.offset-s.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof Kt))throw new ee("writer-merge-no-element-before",this);if(!(i instanceof Kt))throw new ee("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(...t){return this.model.createSelection(...t)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(oe._createIn(i),me._createAt(e,"end")),this.remove(i)}_merge(t){const e=me._createAt(t.nodeBefore,"end"),i=me._createAt(t.nodeAfter,0),s=t.root.document.graveyard,r=new me(s,[0]),o=t.root.document.version,a=new Sn(i,t.nodeAfter.maxOffset,e,r,o);this.batch.addOperation(a),this.model.applyOperation(a)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Kt))throw new ee("writer-rename-not-element-instance",this);const i=t.root.document?t.root.document.version:null,s=new vs(me._createBefore(t),t.name,e,i);this.batch.addOperation(s),this.model.applyOperation(s)}split(t,e){this._assertWriterUsedCorrectly();let i=t.parent;if(!i.parent)throw new ee("writer-split-element-no-parent",this);if(e||(e=i.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new ee("writer-split-invalid-limit-element",this);let s,r;do{const o=i.root.document?i.root.document.version:null,a=i.maxOffset-t.offset,l=jt.getInsertionPosition(t),c=new jt(t,a,l,null,o);this.batch.addOperation(c),this.model.applyOperation(c),!s&&!r&&(s=i,r=t.parent.nextSibling),t=this.createPositionAfter(t.parent),i=t.parent}while(i!==e);return{position:t,range:new oe(me._createAt(s,"end"),me._createAt(r,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new ee("writer-wrap-range-not-flat",this);const i=e instanceof Kt?e:new Kt(e);
440if(i.childCount>0)throw new ee("writer-wrap-element-not-empty",this);if(i.parent!==null)throw new ee("writer-wrap-element-attached",this);this.insert(i,t.start);const s=new oe(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(s,me._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),t.parent===null)throw new ee("writer-unwrap-element-no-parent",this);this.move(oe._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||typeof e.usingOperation!="boolean")throw new ee("writer-addmarker-no-usingoperation",this);const i=e.usingOperation,s=e.range,r=e.affectsData===void 0?!1:e.affectsData;if(this.model.markers.has(t))throw new ee("writer-addmarker-marker-exists",this);if(!s)throw new ee("writer-addmarker-no-range",this);return i?(bp(this,t,null,s,r),this.model.markers.get(t)):this.model.markers._set(t,s,i,r)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i=typeof t=="string"?t:t.name,s=this.model.markers.get(i);if(!s)throw new ee("writer-updatemarker-marker-not-exists",this);if(!e){Dt("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),this.model.markers._refresh(s);return}const r=typeof e.usingOperation=="boolean",o=typeof e.affectsData=="boolean",a=o?e.affectsData:s.affectsData;if(!r&&!e.range&&!o)throw new ee("writer-updatemarker-wrong-options",this);const l=s.getRange(),c=e.range?e.range:l;if(r&&e.usingOperation!==s.managedUsingOperations){e.usingOperation?bp(this,i,null,c,a):(bp(this,i,l,null,a),this.model.markers._set(i,c,void 0,a));return}s.managedUsingOperations?bp(this,i,l,c,a):this.model.markers._set(i,c,void 0,a)}removeMarker(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?t:t.name;if(!this.model.markers.has(e))throw new ee("writer-removemarker-no-marker",this);const i=this.model.markers.get(e);if(!i.managedUsingOperations){this.model.markers._remove(e);return}const s=i.getRange();bp(this,e,s,null,i.affectsData)}addRoot(t,e="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(t);if(i&&i.isAttached())throw new ee("writer-addroot-root-exists",this);const s=this.model.document,r=new Xo(t,e,!0,s,s.version);return this.batch.addOperation(r),this.model.applyOperation(r),this.model.document.getRoot(t)}detachRoot(t){this._assertWriterUsedCorrectly();const e=typeof t=="string"?this.model.document.getRoot(t):t;if(!e||!e.isAttached())throw new ee("writer-detachroot-no-root",this);for(const r of this.model.markers)r.getRange().root===e&&this.removeMarker(r);for(const r of e.getAttributeKeys())this.removeAttribute(r,e);this.remove(this.createRangeIn(e));const i=this.model.document,s=new Xo(e.rootName,e.name,!1,i,i.version);this.batch.addOperation(s),this.model.applyOperation(s)}setSelection(...t){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...t)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),typeof t=="string")this._setSelectionAttribute(t,e);else for(const[i,s]of Qo(t))this._setSelectionAttribute(i,s)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),typeof t=="string")this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const s=uo._getStoreAttributeKey(t);this.setAttribute(s,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=uo._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new ee("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const s=i.getRange();let r=!1;if(t==="move"){const o=e;r=o.containsPosition(s.start)||o.start.isEqual(s.start)||o.containsPosition(s.end)||o.end.isEqual(s.end)}else{const o=e,a=o.nodeBefore,l=o.nodeAfter,c=s.start.parent==a&&s.start.isAtEnd,u=s.end.parent==l&&s.end.offset==0,d=s.end.nodeAfter==l,h=s.start.nodeAfter==l;r=c||u||d||h}r&&this.updateMarker(i.name,{range:s})}}}function MF(n,t,e,i){const s=n.model,r=s.document;let o=i.start,a,l,c;for(const d of i.getWalker({shallow:!0}))c=d.item.getAttribute(t),a&&l!=c&&(l!=e&&u(),o=a),a=d.nextPosition,l=c;a instanceof me&&a!=o&&l!=e&&u();function u(){const d=new oe(o,a),h=d.root.document?r.version:null,f=new Ln(d,t,l,e,h);n.batch.addOperation(f),s.applyOperation(f)}}function OF(n,t,e,i){const s=n.model,r=s.document,o=i.getAttribute(t);let a,l;if(o!=e){if(i.root===i){const u=i.document?r.version:null;l=new ul(i,t,o,e,u)}else{a=new oe(me._createBefore(i),n.createPositionAfter(i));const u=a.root.document?r.version:null;l=new Ln(a,t,o,e,u)}n.batch.addOperation(l),s.applyOperation(l)}}function bp(n,t,e,i,s){const r=n.model,o=r.document,a=new ts(t,e,i,r.markers,!!s,o.version);n.batch.addOperation(a),r.applyOperation(a)}function Ume(n,t,e,i){let s;if(n.root.document){const r=i.document,o=new me(r.graveyard,[0]);s=new Rt(n,t,o,r.version)}else s=new zme(n,t);e.addOperation(s),i.applyOperation(s)}function DF(n,t){return n===t||n instanceof jE&&t instanceof jE}function jme(n){n.document.registerPostFixer(t=>Gme(t,n))}function Gme(n,t){const e=t.document.selection,i=t.schema,s=[];let r=!1;for(const o of e.getRanges()){const a=oO(o,i);a&&!a.isEqual(o)?(s.push(a),r=!0):s.push(o)}return r&&n.setSelection(Xme(s),{backward:e.isBackward}),!1}function oO(n,t){return n.isCollapsed?Yme(n,t):qme(n,t)}function Yme(n,t){const e=n.start,i=t.getNearestSelectionRange(e);if(!i){const r=e.getAncestors().reverse().find(o=>t.isObject(o));return r?oe._createOn(r):null}if(!i.isCollapsed)return i;const s=i.start;return e.isEqual(s)?null:new oe(s)}function qme(n,t){const{start:e,end:i}=n,s=t.checkChild(e,"$text"),r=t.checkChild(i,"$text"),o=t.getLimitElement(e),a=t.getLimitElement(i);if(o===a){if(s&&r)return null;
440if(Kme(e,i,t)){const d=e.nodeAfter&&t.isSelectable(e.nodeAfter)?null:t.getNearestSelectionRange(e,"forward"),f=i.nodeBefore&&t.isSelectable(i.nodeBefore)?null:t.getNearestSelectionRange(i,"backward"),p=d?d.start:e,v=f?f.end:i;return new oe(p,v)}}const l=o&&!o.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const u=e.nodeAfter&&i.nodeBefore&&e.nodeAfter.parent===i.nodeBefore.parent,d=l&&(!u||!LF(e.nodeAfter,t)),h=c&&(!u||!LF(i.nodeBefore,t));let f=e,p=i;return d&&(f=me._createBefore(RF(o,t))),h&&(p=me._createAfter(RF(a,t))),new oe(f,p)}return null}function RF(n,t){let e=n,i=e;for(;t.isLimit(i)&&i.parent;)e=i,i=i.parent;return e}function Kme(n,t,e){const i=n.nodeAfter&&!e.isLimit(n.nodeAfter)||e.checkChild(n,"$text"),s=t.nodeBefore&&!e.isLimit(t.nodeBefore)||e.checkChild(t,"$text");return i||s}function Xme(n){const t=[...n],e=new Set;let i=1;for(;i<t.length;){const r=t[i],o=t.slice(0,i);for(const[a,l]of o.entries())if(!e.has(a)){if(r.isEqual(l))e.add(a);else if(r.isIntersecting(l)){e.add(a),e.add(i);const c=r.getJoined(l);t.push(c)}}i++}return t.filter((r,o)=>!e.has(o))}function LF(n,t){return n&&t.isSelectable(n)}function Jme(n,t,e={}){if(t.isCollapsed)return;const i=t.getFirstRange();if(i.root.rootName=="$graveyard")return;const s=n.schema;n.change(r=>{if(!e.doNotResetEntireContent&&ope(s,t)){rpe(r,t);return}const o={};if(!e.doNotAutoparagraph){const c=t.getSelectedElement();c&&Object.assign(o,s.getAttributesWithProperty(c,"copyOnReplace",!0))}let a,l;e.doNotFixSelection?(a=Mn.fromPosition(i.start,"toPrevious"),l=Mn.fromPosition(i.end,"toNext")):[a,l]=Zme(i),a.isTouching(l)||r.remove(r.createRange(a,l)),e.leaveUnmerged||(epe(r,a,l),s.removeDisallowedAttributes(a.parent.getChildren(),r)),a4(r,t,a),!e.doNotAutoparagraph&&ipe(s,a)&&o4(r,a,t,o),a.detach(),l.detach()})}function Zme(n){const t=n.root.document.model,e=n.start;let i=n.end;if(t.hasContent(n,{ignoreMarkers:!0})){const s=Qme(i);if(s&&i.isTouching(t.createPositionAt(s,0))){const r=t.createSelection(n);t.modifySelection(r,{direction:"backward"});const o=r.getLastPosition(),a=t.createRange(o,i);t.hasContent(a,{ignoreMarkers:!0})||(i=o)}}return[Mn.fromPosition(e,"toPrevious"),Mn.fromPosition(i,"toNext")]}function Qme(n){const t=n.parent,e=t.root.document.model.schema,i=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const s of i){if(e.isLimit(s))return null;if(e.isBlock(s))return s}}function epe(n,t,e){const i=n.model;if(!aO(n.model.schema,t,e))return;const[s,r]=npe(t,e);!s||!r||(!i.hasContent(s,{ignoreMarkers:!0})&&i.hasContent(r,{ignoreMarkers:!0})?r4(n,t,e,s.parent):s4(n,t,e,s.parent))}function s4(n,t,e,i){const s=t.parent,r=e.parent;if(!(s==i||r==i)){for(t=n.createPositionAfter(s),e=n.createPositionBefore(r),e.isEqual(t)||n.insert(r,t),n.merge(t);e.parent.isEmpty;){const o=e.parent;e=n.createPositionBefore(o),n.remove(o)}aO(n.model.schema,t,e)&&s4(n,t,e,i)}}function r4(n,t,e,i){const s=t.parent,r=e.parent;if(!(s==i||r==i)){for(t=n.createPositionAfter(s),e=n.createPositionBefore(r),e.isEqual(t)||n.insert(s,e);t.parent.isEmpty;){const o=t.parent;t=n.createPositionBefore(o),n.remove(o)}e=n.createPositionBefore(r),tpe(n,e),aO(n.model.schema,t,e)&&r4(n,t,e,i)}}function tpe(n,t){const e=t.nodeBefore,i=t.nodeAfter;e.name!=i.name&&n.rename(e,i.name),n.clearAttributes(e),n.setAttributes(Object.fromEntries(i.getAttributes()),e),n.merge(t)}function aO(n,t,e){const i=t.parent,s=e.parent;return i==s||n.isLimit(i)||n.isLimit(s)?!1:spe(t,e,n)}function npe(n,t){const e=n.getAncestors(),i=t.getAncestors();let s=0;for(;e[s]&&e[s]==i[s];)s++;return[e[s],i[s]]}function ipe(n,t){const e=n.checkChild(t,"$text"),i=n.checkChild(t,"paragraph");return!e&&i}function spe(n,t,e){const i=new oe(n,t);for(const s of i.getWalker())if(e.isLimit(s.item))return!1;return!0}function o4(n,t,e,i={}){const s=n.createElement("paragraph");n.model.schema.setAllowedAttributes(s,i,n),n.insert(s,t),a4(n,e,n.createPositionAt(s,0))}function rpe(n,t){const e=n.model.schema.getLimitElement(t);n.remove(n.createRangeIn(e)),o4(n,n.createPositionAt(e,0),t)}function ope(n,t){const e=n.getLimitElement(t);if(!t.containsEntireContent(e))return!1;const i=t.getFirstRange();return i.start.parent==i.end.parent?!1:n.checkChild(e,"paragraph")}function a4(n,t,e){t instanceof uo?n.setSelection(e):t.setTo(e)}/** 441 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 442 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 443 */function ape(n,t){return n.change(e=>{const i=e.createDocumentFragment(),s=t.getFirstRange();if(!s||s.isCollapsed)return i;const r=s.start.root,o=s.start.getCommonPath(s.end),a=r.getNodeByPath(o);let l;s.start.parent==s.end.parent?l=s:l=e.createRange(e.createPositionAt(a,s.start.path[o.length]),e.createPositionAt(a,s.end.path[o.length]+1));const c=l.end.offset-l.start.offset;for(const u of l.getItems({shallow:!0}))u.is("$textProxy")?e.appendText(u.data,u.getAttributes(),i):e.append(e.cloneElement(u,!0),i);if(l!=s){const u=s._getTransformedByMove(l.start,e.createPositionAt(i,0),c)[0],d=e.createRange(e.createPositionAt(i,0),u.start),h=e.createRange(u.end,e.createPositionAt(i,"end"));FF(h,e),FF(d,e)}return i})}function FF(n,t){const e=[];Array.from(n.getItems({direction:"backward"})).map(i=>t.createRangeOn(i)).filter(i=>(i.start.isAfter(n.start)||i.start.isEqual(n.start))&&(i.end.isBefore(n.end)||i.end.isEqual(n.end))).forEac
443h(i=>{e.push(i.start.parent),t.remove(i)}),e.forEach(i=>{let s=i;for(;s.parent&&s.isEmpty;){const r=t.createRangeOn(s);s=s.parent,t.remove(r)}})}function lpe(n,t,e){return n.change(i=>{const s=e||n.document.selection;s.isCollapsed||n.deleteContent(s,{doNotAutoparagraph:!0});const r=new cpe(n,i,s.anchor),o=[];let a;if(t.is("documentFragment")){if(t.markers.size){const u=[];for(const[d,h]of t.markers){const{start:f,end:p}=h,v=f.isEqual(p);u.push({position:f,name:d,isCollapsed:v},{position:p,name:d,isCollapsed:v})}u.sort(({position:d},{position:h})=>d.isBefore(h)?1:-1);for(const{position:d,name:h,isCollapsed:f}of u){let p=null,v=null;const E=d.parent===t&&d.isAtStart,x=d.parent===t&&d.isAtEnd;!E&&!x?(p=i.createElement("$marker"),i.insert(p,d)):f&&(v=E?"start":"end"),o.push({name:h,element:p,collapsed:v})}}a=t.getChildren()}else a=[t];r.handleNodes(a);let l=r.getSelectionRange();if(t.is("documentFragment")&&o.length){const u=l?js.fromRange(l):null,d={};for(let h=o.length-1;h>=0;h--){const{name:f,element:p,collapsed:v}=o[h],E=!d[f];if(E&&(d[f]=[]),p){const x=i.createPositionAt(p,"before");d[f].push(x),i.remove(p)}else{const x=r.getAffectedRange();if(!x){v&&d[f].push(r.position);continue}v?d[f].push(x[v]):d[f].push(E?x.start:x.end)}}for(const[h,[f,p]]of Object.entries(d))f&&p&&f.root===p.root&&f.root.document&&!i.model.markers.has(h)&&i.addMarker(h,{usingOperation:!0,affectsData:!0,range:new oe(f,p)});u&&(l=u.toRange(),u.detach())}/* istanbul ignore else -- @preserve */l&&(s instanceof uo?i.setSelection(l):s.setTo(l));const c=r.getAffectedRange()||n.createRange(s.anchor);return r.destroy(),c})}class cpe{constructor(t,e,i){y(this,"model");y(this,"writer");y(this,"position");y(this,"canMergeWith");y(this,"schema");y(this,"_documentFragment");y(this,"_documentFragmentPosition");y(this,"_firstNode",null);y(this,"_lastNode",null);y(this,"_lastAutoParagraph",null);y(this,"_filterAttributesAndChildrenOf",[]);y(this,"_affectedStart",null);y(this,"_affectedEnd",null);y(this,"_nodeToSelect",null);this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0)}handleNodes(t){var e;for(const i of Array.from(t))i.offsetSize>0&&this._handleNode(i);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),(e=this.model._config)!=null&&e.get("experimentalFlags.modelInsertContentDeepSchemaVerification")&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(t){const e=Array.from(t);for(const i of e){if(!i.is("element"))continue;const s=[],r=[],o=this.writer.createRangeIn(i).getWalker({ignoreElementEnd:!0});for(const{item:a}of o){const l=a.parent;this.schema.checkChild(l,a)||(a.is("element")&&!this.schema.isObject(a)?(r.push(a),e.push(l)):s.push(a),o.jumpTo(this.writer.createPositionAfter(a)))}for(const a of r)this.writer.unwrap(a);for(const a of s)this.writer.remove(a)}}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(t);if(i.isAfter(e)){this._lastNode=t;/* istanbul ignore if -- @preserve */if(this.position.parent!=t||!this.position.isAtEnd)throw new ee("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?oe._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new oe(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(!this._checkAndSplitToAllowedPosition(t)){this.schema.isObject(t)||this._handleDisallowedNode(t);return}t=this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=Mn.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleDisallowedNode(t){t.is("element")&&this.handleNodes(t.getChildren())}_appendToFragment(t){/* istanbul ignore if -- @preserve */if(!this.schema.checkChild(this.position,t))throw new ee("insertcontent-wrong-position",this,{node:t,position:this.position});return this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),t.parent||(t=this._documentFragmentPosition.nodeBefore),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=t:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(t),t}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=Mn.fromPosition(t,"toPrevious")),(!this._affectedEnd||this._affectedEnd.isBefore(t))&&(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Mn.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof Kt)||!this._canMergeLeft(t))return;const e=Mn._createBefore(t);e.stickiness="toNext";const i=Mn.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=Mn._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Mn._createAt(e.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof Kt)||!this._canMergeRight(t))return;const e=Mn._createAfter(t);e.stickiness="toNext";/* istanbul ignore if -- @preserve */if(!this.position.isEqual(e))throw new ee("insertcontent-invalid-insertion-position",this);this.position=me._createAt(e.nodeBefore,"end");const i=Mn.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=Mn._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Mn._createAt(e.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof Kt&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof Kt&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_insertAutoParagraph(){this._insertPartialFragment();const t=this.writer.createElement("paragraph");this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0)}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(this.position.parent,t);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;)if(this.position.isAtStart){const i=this.position.parent;this.position=this.writer.createPositionBefore(i),i.isEmpty&&i.parent===e&&this.writer.remove(i)}
443else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const i=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=i,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,t)||this._insertAutoParagraph(),!0}_getAllowedIn(t,e){const i=this.schema.createContext(t);return this.schema.checkChild(i,e)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),e)?t:this.schema.isLimit(t)?null:this._getAllowedIn(t.parent,e)}}function upe(n,t,e,i={}){if(!n.schema.isObject(t))throw new ee("insertobject-element-not-an-object",n,{object:t});const s=e||n.document.selection;let r=s;i.findOptimalPosition&&n.schema.isBlock(t)&&(r=n.createSelection(n.schema.findOptimalInsertionRange(s,i.findOptimalPosition)));const o=$i(s.getSelectedBlocks()),a={};return o&&Object.assign(a,n.schema.getAttributesWithProperty(o,"copyOnReplace",!0)),n.change(l=>{r.isCollapsed||n.deleteContent(r,{doNotAutoparagraph:!0});let c=t;const u=r.anchor.parent,d=n.schema.createContext(u);!n.schema.checkChild(d,t)&&n.schema.checkChild(d,"paragraph")&&n.schema.checkChild(d.push("paragraph"),t)&&(c=l.createElement("paragraph"),l.insert(t,c)),n.schema.setAllowedAttributes(c,a,l);const h=n.insertContent(c,r);return h.isCollapsed||i.setSelection&&dpe(l,t,i.setSelection,a),h})}function dpe(n,t,e,i){const s=n.model;if(e=="on"){n.setSelection(t,"on");return}if(e!="after")throw new ee("insertobject-invalid-place-parameter-value",s);let r=t.nextSibling;if(s.schema.isInline(t)){n.setSelection(t,"after");return}!(r&&s.schema.checkChild(r,"$text"))&&s.schema.checkChild(t.parent,"paragraph")&&(r=n.createElement("paragraph"),s.schema.setAllowedAttributes(r,i,n),s.insertContent(r,n.createPositionAfter(t))),r&&n.setSelection(r,0)}const hpe=' ,.?!:;"-()';function fpe(n,t,e={}){const i=n.schema,s=e.direction!="backward",r=e.unit?e.unit:"character",o=!!e.treatEmojiAsSingleUnit,a=t.focus,l=new rl({boundaries:bpe(a,s),singleCharacters:!0,direction:s?"forward":"backward"}),c={walker:l,schema:i,isForward:s,unit:r,treatEmojiAsSingleUnit:o};let u;for(;u=l.next();){if(u.done)return;const d=gpe(c,u.value);if(d){t instanceof uo?n.change(h=>{h.setSelectionFocus(d)}):t.setFocus(d);return}}}function gpe(n,t){const{isForward:e,walker:i,unit:s,schema:r,treatEmojiAsSingleUnit:o}=n,{type:a,item:l,nextPosition:c}=t;if(a=="text")return n.unit==="word"?ppe(i,e):mpe(i,s,o);if(a==(e?"elementStart":"elementEnd")){if(r.isSelectable(l))return me._createAt(l,e?"after":"before");if(r.checkChild(c,"$text"))return c}else{if(r.isLimit(l)){i.skip(()=>!0);return}if(r.checkChild(c,"$text"))return c}}function mpe(n,t,e){const i=n.position.textNode;if(i){const s=i.data;let r=n.position.offset-i.startOffset;for(;XM(s,r)||t=="character"&&JM(s,r)||e&&bW(s,r);)n.next(),r=n.position.offset-i.startOffset}return n.position}function ppe(n,t){let e=n.position.textNode;for(e||(e=t?n.position.nodeAfter:n.position.nodeBefore);e&&e.is("$text");){const i=n.position.offset-e.startOffset;if(vpe(e,i,t))e=t?n.position.nodeAfter:n.position.nodeBefore;else{if(wpe(e.data,i,t))break;n.next()}}return n.position}function bpe(n,t){const e=n.root,i=me._createAt(e,t?"end":0);return t?new oe(n,i):new oe(i,n)}function wpe(n,t,e){const i=t+(e?0:-1);return hpe.includes(n.charAt(i))}function vpe(n,t,e){return t===(e?n.offsetSize:0)}class ype extends Ut(){constructor(e){super();y(this,"markers");y(this,"document");y(this,"schema");y(this,"_config");y(this,"_pendingChanges");y(this,"_currentWriter");this.markers=new Hme,this.document=new Vme(this),this.schema=new nme,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(i=>this.decorate(i)),this.on("applyOperation",(i,s)=>{s[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(()=>!0,"$marker"),jme(this),this.document.registerPostFixer(qW),this.on("insertContent",(i,[s,r])=>{i.return=lpe(this,s,r)}),this.on("insertObject",(i,[s,r,o])=>{i.return=upe(this,s,r,o)}),this.on("canEditAt",i=>{const s=!this.document.isReadOnly;i.return=s,s||i.stop()})}
443change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new $h,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(i){/* istanbul ignore next -- @preserve */ee.rethrowUnexpectedError(i,this)}}enqueueChange(e,i){try{e?typeof e=="function"?(i=e,e=new $h):e instanceof $h||(e=new $h(e)):e=new $h,this._pendingChanges.push({batch:e,callback:i}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(s){/* istanbul ignore next -- @preserve */ee.rethrowUnexpectedError(s,this)}}applyOperation(e){e._execute()}insertContent(e,i,s,...r){const o=SA(i,s);return this.fire("insertContent",[e,o,s,...r])}insertObject(e,i,s,r,...o){const a=SA(i,s);return this.fire("insertObject",[e,a,r,r,...o])}deleteContent(e,i){Jme(this,e,i)}modifySelection(e,i){fpe(this,e,i)}getSelectedContent(e){return ape(this,e)}hasContent(e,i={}){const s=e instanceof oe?e:oe._createIn(e);if(s.isCollapsed)return!1;const{ignoreWhitespaces:r=!1,ignoreMarkers:o=!1}=i;if(!o){for(const a of this.markers.getMarkersIntersectingRange(s))if(a.affectsData)return!0}for(const a of s.getItems())if(this.schema.isContent(a))if(a.is("$textProxy"))if(r){if(a.data.search(/\S/)!==-1)return!0}else return!0;else return!0;return!1}canEditAt(e){const i=SA(e);return this.fire("canEditAt",[i])}createPositionFromPath(e,i,s){return new me(e,i,s)}
443createPositionAt(e,i){return me._createAt(e,i)}createPositionAfter(e){return me._createAfter(e)}createPositionBefore(e){return me._createBefore(e)}createRange(e,i){return new oe(e,i)}createRangeIn(e){return oe._createIn(e)}createRangeOn(e){return oe._createOn(e)}createSelection(...e){return new Ws(...e)}createBatch(e){return new $h(e)}createOperationFromJSON(e){return kme.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const i=this._pendingChanges[0].batch;this._currentWriter=new Wme(this,i);const s=this._pendingChanges[0].callback(this._currentWriter);e.push(s),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function SA(n,t){if(n)return n instanceof Ws||n instanceof uo?n:n instanceof kh?t||t===0?new Ws(n,t):n.is("rootElement")?new Ws(n,"in"):new Ws(n,"on"):new Ws(n)}class _pe extends sa{constructor(){super(...arguments);y(this,"domEventType","click")}onDomEvent(e){this.fire(e.type,e)}}class lO extends sa{constructor(){super(...arguments);y(this,"domEventType",["mousedown","mouseup","mouseover","mouseout"])}onDomEvent(e){this.fire(e.type,e)}}class Epe extends sa{constructor(){super(...arguments);y(this,"domEventType",["touchstart","touchend","touchmove"])}onDomEvent(e){this.fire(e.type,e)}}class l4 extends sa{constructor(){super(...arguments);y(this,"domEventType",["pointerdown","pointerup","pointermove"])}onDomEvent(e){this.fire(e.type,e)}}class cO{constructor(t){y(this,"document");this.document=t}createDocumentFragment(t){return new ah(this.document,t)}createElement(t,e,i){return new co(this.document,t,e,i)}createText(t){return new zn(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const i=t.parent;if(i){const s=i.getChildIndex(t);return this.removeChildren(s,1,i),this.insertChild(s,e,i),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t),this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new co(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){Yo(t)&&i===void 0?e._setStyle(t):i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return Ee._createAt(t,e)}createPositionAfter(t){return Ee._createAfter(t)}createPositionBefore(t){return Ee._createBefore(t)}createRange(t,e){return new Je(t,e)}createRangeOn(t){return Je._createOn(t)}createRangeIn(t){return Je._createIn(t)}createSelection(...t){return new so(...t)}}/** 444 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 445 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 446 *//** 447 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 448 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 449 */class c4{constructor(t){y(this,"crashes",[]);y(this,"state","initializing");y(this,"_crashNumberLimit");y(this,"_now",Date.now);y(this,"_minimumNonErrorTimePeriod");y(this,"_boundErrorHandler");y(this,"_listeners");if(this.crashes=[],this._crashNumberLimit=typeof t.crashNumberLimit=="number"?t.crashNumberLimit:3,this._minimumNonErrorTimePeriod=typeof t.minimumNonErrorTimePeriod=="number"?t.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const i="error"in e?e.error:e.reason;i instanceof Error&&this._handleError(i,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(t,e){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)}off(t,e){this._listeners[t]=this._listeners[t].filter(i=>i!==e)}_fire(t,...e){const i=this._listeners[t]||[];for(const s of i)s.apply(this,[null,...e])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(t,e){if(this._shouldReactToError(t)){this.crashes.push({message:t.message,stack:t.stack,filename:e instanceof ErrorEvent?e.filename:void 0,lineno:e instanceof ErrorEvent?e.lineno:void 0,colno:e instanceof ErrorEvent?e.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:t,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(t){return t.is&&t.is("CKEditorError")&&t.context!==void 0&&t.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(t)}
449_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;const t=this.crashes[this.crashes.length-1].date,e=this.crashes[this.crashes.length-1-this._crashNumberLimit].date;return(t-e)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}/** 450 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 451 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 452 */function mI(n,t=new Set){const e=[n],i=new Set;let s=0;for(;e.length>s;){const r=e[s++];if(!(i.has(r)||!Spe(r)||t.has(r)))if(i.add(r),Symbol.iterator in r)try{for(const o of r)e.push(o)}catch{}else for(const o in r)o!=="defaultValue"&&e.push(r[o])}return i}function Spe(n){const t=Object.prototype.toString.call(n),e=typeof n;return!(e==="number"||e==="boolean"||e==="string"||e==="symbol"||e==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||n===void 0||n===null||n._watchdogExcluded||n instanceof EventTarget||n instanceof Event)}function u4(n,t,e=new Set){if(n===t&&Tpe(n))return!0;const i=mI(n,e),s=mI(t,e);for(const r of i)if(s.has(r))return!0;return!1}function Tpe(n){return typeof n=="object"&&n!==null}class d4 extends c4{constructor(e,i={}){super(i);y(this,"_editor",null);y(this,"_lifecyclePromise",null);y(this,"_throttledSave");y(this,"_data");y(this,"_lastDocumentVersion");y(this,"_elementOrData");y(this,"_initUsingData",!0);y(this,"_editables",{});y(this,"_config");y(this,"_excludedProps");this._throttledSave=Vb(this._save.bind(this),typeof i.saveInterval=="number"?i.saveInterval:5e3),e&&(this._creator=(s,r)=>e.create(s,r)),this._destructor=s=>s.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(e=>{console.error("An error happened during the editor destroying.",e)}).then(()=>{const e={},i=[],s=this._config.rootsAttributes||{},r={};for(const[a,l]of Object.entries(this._data.roots))l.isLoaded?(e[a]="",r[a]=s[a]||{}):i.push(a);const o={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:i,rootsAttributes:r,_watchdogInitialData:this._data};return delete o.initialData,o.extraPlugins.push(xpe),this._initUsingData?this.create(e,o,o.context):Wc(this._elementOrData)?this.create(this._elementOrData,o,o.context):this.create(this._editables,o,o.context)}).then(()=>{this._fire("restart")})}create(e=this._elementOrData,i=this._config,s){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(super._startErrorHandling(),this._elementOrData=e,this._initUsingData=typeof e=="string"||Object.keys(e).length>0&&typeof Object.values(e)[0]=="string",this._config=this._cloneEditorConfiguration(i)||{},this._config.context=s,this._creator(e,this._config))).then(r=>{this._editor=r,r.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=r.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")}).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)})}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(i){console.error(i,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,i=e.model.document.roots.filter(l=>l.isAttached()&&l.rootName!="$graveyard"),{plugins:s}=e,r=s.has("CommentsRepository")&&s.get("CommentsRepository"),o=s.has("TrackChanges")&&s.get("TrackChanges"),a={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};
452i.forEach(l=>{a.roots[l.rootName]={content:JSON.stringify(Array.from(l.getChildren())),attributes:JSON.stringify(Array.from(l.getAttributes())),isLoaded:l._isLoaded}});for(const l of e.model.markers)l._affectsData&&(a.markers[l.name]={rangeJSON:l.getRange().toJSON(),usingOperation:l._managedUsingOperations,affectsData:l._affectsData});return r&&(a.commentThreads=JSON.stringify(r.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),o&&(a.suggestions=JSON.stringify(o.getSuggestions({toJSON:!0,skipNotAttached:!0}))),a}_getEditables(){const e={};for(const i of this.editor.model.document.getRootNames()){const s=this.editor.ui.getEditableElement(i);s&&(e[i]=s)}return e}_isErrorComingFromThisItem(e){return u4(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return GT(e,(i,s)=>{if(Wc(i)||s==="context")return i})}}class xpe{constructor(t){y(this,"editor");y(this,"_data");this.editor=t,this._data=t.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",t=>{t.stop(),this.editor.model.enqueueChange({isUndoable:!1},e=>{this._restoreCollaborationData(),this._restoreEditorData(e)}),this.editor.data.fire("ready")},{priority:1e3-1})}_createNode(t,e){if("name"in e){const i=t.createElement(e.name,e.attributes);if(e.children)for(const s of e.children)i._appendChild(this._createNode(t,s));return i}else return t.createText(e.data,e.attributes)}_restoreEditorData(t){const e=this.editor;Object.entries(this._data.roots).forEach(([i,{content:s,attributes:r}])=>{const o=JSON.parse(s),a=JSON.parse(r),l=e.model.document.getRoot(i);for(const[c,u]of a)t.setAttribute(c,u,l);for(const c of o){const u=this._createNode(t,c);t.insert(u,l,"end")}}),Object.entries(this._data.markers).forEach(([i,s])=>{const{document:r}=e.model,{rangeJSON:{start:o,end:a},...l}=s,c=r.getRoot(o.root),u=t.createPositionFromPath(c,o.path,o.stickiness),d=t.createPositionFromPath(c,a.path,a.stickiness),h=t.createRange(u,d);t.addMarker(i,{range:h,...l})})}_restoreCollaborationData(){const t=JSON.parse(this._data.commentThreads),e=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const i=this.editor.plugins.get("CommentsRepository");for(const s of i.getCommentThreads())i._removeCommentThread({threadId:s.id});t.forEach(s=>{const r=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:r,...s})})}if(this.editor.plugins.has("TrackChangesEditing")){const i=this.editor.plugins.get("TrackChangesEditing");for(const s of i.getSuggestions())i._removeSuggestion(s);e.forEach(s=>{i.addSuggestionData(s)})}}}const gb=Symbol("MainQueueId");class Ape extends c4{constructor(e,i={}){super(i);y(this,"_watchdogs",new Map);y(this,"_watchdogConfig");y(this,"_context",null);y(this,"_contextProps",new Set);y(this,"_actionQueues",new Cpe);y(this,"_contextConfig");y(this,"_item");this._watchdogConfig=i,this._creator=s=>e.create(s),this._destructor=s=>s.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(gb,()=>(this._contextConfig=e,this._create()))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const i=NF(e);return Promise.all(i.map(s=>this._actionQueues.enqueue(s.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let r;if(this._watchdogs.has(s.id))throw new Error(`Item with the given id is already added: '${s.id}'.`);if(s.type==="editor")return r=new d4(null,this._watchdogConfig),r.setCreator(s.creator),r._setExcludedProperties(this._contextProps),s.destructor&&r.setDestructor(s.destructor),this._watchdogs.set(s.id,r),r.on("error",(o,{error:a,causesRestart:l})=>{this._fire("itemError",{itemId:s.id,error:a}),l&&this._actionQueues.enqueue(s.id,()=>new Promise(c=>{const u=()=>{r.off("restart",u),this._fire("itemRestart",{itemId:s.id}),c()};r.on("restart",u)}))}),r.create(s.sourceElementOrData,s.config,this._context);throw new Error(`Not supported item type: '${s.type}'.`)})))}remove(e){const i=NF(e);return Promise.all(i.map(s=>this._actionQueues.enqueue(s,()=>{const r=this._getWatchdog(s);return this._watchdogs.delete(s),r.destroy()})))}destroy(){return this._actionQueues.enqueue(gb,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(gb,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(e=>{console.error("An error happened during destroying the context or items.",e)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(e=>(this._context=e,this._contextProps=mI(this._context),Promise.all(Array.from(this._watchdogs.values()).map(i=>(i._setExcludedProperties(this._contextProps),i.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(i=>i.destroy())).then(()=>this._destructor(e))})}_getWatchdog(e){const i=this._watchdogs.get(e);if(!i)throw new Error(`Item with the given id was not registered: ${e}.`);return i}_isErrorComingFromThisItem(e){for(const i of this._watchdogs.values())if(i._isErrorComingFromThisItem(e))return!1;return u4(this._context,e.context)}}class Cpe{constructor(){y(this,"_onEmptyCallbacks",[]);y(this,"_queues",new Map);y(this,"_activeActions",0)}onEmpty(t){this._onEmptyCallbacks.push(t)}enqueue(t,e){const i=t===gb;this._activeActions++,this._queues.get(t)||this._queues.set(t,Promise.resolve());const r=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(gb),this._queues.get(t)])).then(e),o=r.catch(()=>{});return this._queues.set(t,o),r.finally(()=>{this._activeActions--,this._queues.get(t)===o&&this._activeActions===0&&this._onEmptyCallbacks.forEach(a=>a())})}}function NF(n){return Array.isArray(n)?n:[n]}/** 453 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 454 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 455 */class we extends Ut(){constructor(e){super();y(this,"editor");y(this,"_disableStack",new Set);this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",BF,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",BF),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function BF(n){n.return=!1,n.stop()}class _t extends Ut(){constructor(e){super();y(this,"editor");y(this,"_isEnabledBasedOnSelection");y(this,"_affectsData");y(this,"_disableStack");this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",i=>{if(!this.affectsData)return;const s=e.model.document.selection,o=!(s.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(s);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(i.return=!1,i.stop())},{priority:"highest"}),this.on("execute",i=>{this.isEnabled||i.stop()},{priority:"high"})}static get _throwErrorWhenUsedAsAPlugin(){return!0}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",VF,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",VF),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function VF(n){n.return=!1,n.stop()}class kpe{constructor(){y(this,"_commands");this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new ee("commandcollection-command-not-found",this,{commandName:t});return i.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class h4 extends Gt(){constructor(e,i=[],s=[]){super();y(this,"_context");y(this,"_plugins",new Map);y(this,"_availablePlugins");y(this,"_contextPlugins");this._context=e,this._availablePlugins=new Map;for(const r of i)r.pluginName&&this._availablePlugins.set(r.pluginName,r);this._contextPlugins=new Map;for(const[r,o]of s)this._contextPlugins.set(r,o),this._contextPlugins.set(o,r),r.pluginName&&this._availablePlugins.set(r.pluginName,r)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const i=this._plugins.get(e);if(!i){let s=e;throw typeof e=="function"&&(s=e.pluginName||e.name),new ee("plugincollection-
455plugin-not-loaded",this._context,{plugin:s})}return i}has(e){return this._plugins.has(e)}async init(e,i=[],s=[]){const r=this,o=this._context;p(e),E(e);const a=e.filter(D=>!h(D,i)),l=[...v(a)];k(l,s);const c=T(l);return await P(c,"init"),await P(c,"afterInit"),c;function u(D){return typeof D=="function"}function d(D){return u(D)&&!!D.isContextPlugin}function h(D,U){return U.some(Y=>Y===D||f(D)===Y||f(Y)===D)}function f(D){return u(D)?D.pluginName||D.name:D}function p(D,U=new Set){D.forEach(Y=>{u(Y)&&(U.has(Y)||(U.add(Y),Y.pluginName&&!r._availablePlugins.has(Y.pluginName)&&r._availablePlugins.set(Y.pluginName,Y),Y.requires&&p(Y.requires,U)))})}function v(D,U=new Set){return D.map(Y=>u(Y)?Y:r._availablePlugins.get(Y)).reduce((Y,K)=>U.has(K)?Y:(U.add(K),K.requires&&(E(K.requires,K),v(K.requires,U).forEach(j=>Y.add(j))),Y.add(K)),new Set)}function E(D,U=null){D.map(Y=>u(Y)?Y:r._availablePlugins.get(Y)||Y).forEach(Y=>{x(Y),A(Y,U),O(Y,U),I(Y,U)})}function x(D){if(typeof D=="function"&&D._throwErrorWhenUsedAsAPlugin)throw new ee("plugincollection-plugin-invalid-constructor",o,{name:D.name})}function A(D,U){if(!u(D))throw U?new ee("plugincollection-soft-required",o,{missingPlugin:D,requiredBy:f(U)}):new ee("plugincollection-plugin-not-found",o,{plugin:D})}function O(D,U){if(d(U)&&!d(D))throw new ee("plugincollection-context-required",o,{plugin:f(D),requiredBy:f(U)})}function I(D,U){if(U&&h(D,i))throw new ee("plugincollection-required",o,{plugin:f(D),requiredBy:f(U)})}function T(D){return D.map(U=>{let Y=r._contextPlugins.get(U);return Y=Y||new U(o),r._add(U,Y),Y})}function P(D,U){return D.reduce((Y,K)=>!K[U]||r._contextPlugins.has(K)?Y:Y.then(K[U].bind(K)),Promise.resolve())}function k(D,U){for(const Y of U){if(typeof Y!="function")throw new ee("plugincollection-replace-plugin-invalid-type",null,{pluginItem:Y});const K=Y.pluginName;if(!K)throw new ee("plugincollection-replace-plugin-missing-name",null,{pluginItem:Y});if(Y.requires&&Y.requires.length)throw new ee("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:K});const j=r._availablePlugins.get(K);if(!j)throw new ee("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:K});const L=D.indexOf(j);if(L===-1){if(r._contextPlugins.has(j))return;throw new ee("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:K})}if(j.requires&&j.requires.length)throw new ee("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:K});D.splice(L,1,Y),r._availablePlugins.set(K,Y)}}}destroy(){const e=[];for(const[,i]of this)typeof i.destroy=="function"&&!this._contextPlugins.has(i)&&e.push(i.destroy());return Promise.all(e)}_add(e,i){this._plugins.set(e,i);const s=e.pluginName;if(s){if(this._plugins.has(s))throw new ee("plugincollection-plugin-name-conflict",null,{pluginName:s,plugin1:this._plugins.get(s).constructor,plugin2:e});this._plugins.set(s,i)}}}class GE{constructor(t){y(this,"config");y(this,"plugins");y(this,"locale");y(this,"t");y(this,"editors");y(this,"_contextOwner",null);const{translations:e,...i}=t||{};this.config=new sW(i,this.constructor.defaultConfig);const s=this.constructor.builtinPlugins;this.config.define("plugins",s),this.plugins=new h4(this,s);const r=this.config.get("language")||{};this.locale=new Phe({uiLanguage:typeof r=="string"?r:r.ui,contentLanguage:this.config.get("language.content"),translations:e}),this.t=this.locale.t,this.editors=new er}initPlugins(){const t=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const i of t.concat(e)){if(typeof i!="function")throw new ee("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new ee("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(t,[],e)}destroy(){return Promise.all(Array.from(this.editors,t=>t.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new ee("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const i=new this(t);e(i.initPlugins().then(()=>i))})}static get _throwErrorWhenUsedAsAPlugin(){return!0}}y(GE,"defaultConfig"),y(GE,"builtinPlugins");class f4 extends Ut(){constructor(e){super();y(this,"context");this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class Ipe extends rs{constructor(e){super();y(this,"editor");this.editor=e}set(e,i,s={}){if(typeof i=="string"){const r=i;i=(o,a)=>{this.editor.execute(r),a()}}super.set(e,i,s)}}
455const TA="contentEditing",HF="common";class Ppe{constructor(t){y(this,"keystrokeInfos",new Map);y(this,"_editor");this._editor=t;const e=t.config.get("menuBar.isVisible"),i=t.locale.t;this.addKeystrokeInfoCategory({id:TA,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const s=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];e&&s.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:s}]})}addKeystrokeInfoCategory({id:t,label:e,description:i,groups:s}){this.keystrokeInfos.set(t,{id:t,label:e,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:t,id:HF}),s&&s.forEach(r=>{this.addKeystrokeInfoGroup({categoryId:t,...r})})}addKeystrokeInfoGroup({categoryId:t=TA,id:e,label:i,keystrokes:s}){const r=this.keystrokeInfos.get(t);if(!r)throw new ee("accessibility-unknown-keystroke-info-category",this._editor,{groupId:e,categoryId:t});r.groups.set(e,{id:e,label:i,keystrokes:s||[]})}addKeystrokeInfos({categoryId:t=TA,groupId:e=HF,keystrokes:i}){if(!this.keystrokeInfos.has(t))throw new ee("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:t,keystrokes:i});const s=this.keystrokeInfos.get(t);if(!s.groups.has(e))throw new ee("accessibility-unknown-keystroke-info-group",this._editor,{groupId:e,categoryId:t,keystrokes:i});s.groups.get(e).keystrokes.push(...i)}}function Mpe(n){return{sessionId:Fpe(),pageSessionId:Npe(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Ope(n),plugins:Dpe(n.plugins),distribution:Rpe(),env:Lpe(),integration:Object.create(null),menuBar:{isVisible:!!n.config.get("menuBar.isVisible")},language:{ui:n.locale.uiLanguage,content:n.locale.contentLanguage},toolbar:{main:xA(n.config.get("toolbar")),block:xA(n.config.get("blockToolbar")),balloon:xA(n.config.get("balloonToolbar"))}}}function Ope(n){return Object.getPrototypeOf(n).constructor.editorName}function Dpe(n){return Array.from(n).filter(([t])=>!!t.pluginName).map(([t])=>{const{pluginName:e,isContextPlugin:i,isOfficialPlugin:s,isPremiumPlugin:r}=t;return{isContext:!!i,isOfficial:!!s,isPremium:!!r,name:e}})}function xA(n){if(!n)return;const t=Array.isArray(n)?{items:n}:n,e=r(t.items||[]);return{isMultiline:e.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:s(e)};function s(o){return o.filter(a=>a!=="|"&&a!=="-")}function r(o){return o.flatMap(a=>typeof a=="string"?[a]:r(a.items))}}function Rpe(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function Lpe(){let n="unknown",t="unknown";return Ge.isMac?n="mac":Ge.isWindows?n="windows":Ge.isiOS?n="ios":Ge.isAndroid&&(n="android"),Ge.isGecko?t="gecko":Ge.isBlink?t="blink":Ge.isSafari&&(t="safari"),{os:n,browser:t}}function Fpe(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",is()),localStorage.getItem("__ckeditor-session-id")}function Npe(){return Ie.window.CKEDITOR_PAGE_SESSION_ID=Ie.window.CKEDITOR_PAGE_SESSION_ID||is(),Ie.window.CKEDITOR_PAGE_SESSION_ID}class rf extends Ut(){constructor(e={}){super();y(this,"accessibility");y(this,"commands");y(this,"config");y(this,"conversion");y(this,"data");y(this,"editing");y(this,"locale");y(this,"model");y(this,"plugins");y(this,"keystrokes");y(this,"t");y(this,"_context");y(this,"_readOnlyLocks");
455if(typeof e!="object"||Array.isArray(e))throw new ee("editor-config-invalid-type");if("sanitizeHtml"in e)throw new ee("editor-config-sanitizehtml-not-supported");const i=this.constructor,{translations:s,...r}=i.defaultConfig||{},{translations:o=s,...a}=e,l=e.language||r.language;this._context=e.context||new GE({language:l,translations:o}),this._context._addEditor(this,!e.context);const c=Array.from(i.builtinPlugins||[]);this.config=new sW(a,r),this.config.define("plugins",c),this.config.define(this._context._getEditorConfig()),d(this.config),this.plugins=new h4(this,c,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new kpe,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new ype(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const u=new Qhe;this.data=new Tme(this.model,u),this.editing=new tme(this.model,u),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Ame([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Ipe(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new Ppe(this),h(this);function d(f){let p=f.get("licenseKey");if(!p&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(p=window.CKEDITOR_GLOBAL_LICENSE_KEY,f.set("licenseKey",p)),!p)throw new ee("license-key-missing")}function h(f){const p=f.config.get("licenseKey"),v=window[Symbol.for("cke distribution")]||"sh";function E(D,U){f.enableReadOnlyMode(Symbol("invalidLicense")),f._showLicenseError(D,U)}function x(D){return["exp","jti","vc"].every(Y=>Y in D)}function A(D){return Object.getOwnPropertyNames(D).sort().filter(K=>K!="vc"&&D[K]!=null).map(K=>D[K])}function O(D){const{hostname:U}=new URL(window.location.href);if(D.includes(U))return!0;const Y=U.split(".");return D.filter(K=>K.includes("*")).map(K=>K.split(".")).filter(K=>K.length<=Y.length).map(K=>Array(Y.length-K.length).fill(K[0]==="*"?"*":"").concat(K)).some(K=>Y.every((j,L)=>K[L]===j||K[L]==="*"))}function I(D){const U=D[0].toUpperCase()+D.slice(1),Y=D==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${U} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`â ï¸ You are using ${Y} ${D} license of CKEditor 5${D==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(p=="GPL"){v=="cloud"&&E("distributionChannel");return}const T=XL(p);if(!T){E("invalid");return}if(!x(T)){E("invalid");return}if(T.distributionChannel&&!bn(T.distributionChannel).includes(v)){E("distributionChannel");return}if(Lhe(A(T))!=T.vc.toLowerCase()){E("invalid");return}if(new Date(T.exp*1e3)<zde){E("expired");return}const k=T.licensedHosts;if(k&&k.length>0&&!O(k)){E("domainLimit");return}if(["evaluation","trial"].includes(T.licenseType)&&T.exp*1e3<Date.now()){E("expired");return}if(["development","evaluation","trial"].includes(T.licenseType)){const{licenseType:D}=T;window.CKEDITOR_WARNING_SUPPRESSIONS=window.CKEDITOR_WARNING_SUPPRESSIONS||{},window.CKEDITOR_WARNING_SUPPRESSIONS[D]||(I(D),window.CKEDITOR_WARNING_SUPPRESSIONS[D]=!0)}if(["evaluation","trial"].includes(T.licenseType)){const D=T.licenseType,U=setTimeout(()=>{E(`${D}Limit`)},6e5);f.on("destroy",()=>{clearTimeout(U)})}T.usageEndpoint&&f.once("ready",()=>{const D={requestId:is(),requestTime:Math.round(Date.now()/1e3),license:p,editor:Bpe(f)};f._sendUsageRequest(T.usageEndpoint,D).then(U=>{const{status:Y,message:K}=U;K&&console.warn(K),Y!="ok"&&E("usageLimit")},()=>{Bde("license-key-validation-endpoint-not-reachable",{url:T.usageEndpoint})})},{priority:"high"})}}static get editorName(){return"Editor"}static get _throwErrorWhenUsedAsAPlugin(){return!0}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new ee("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new ee("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new ee("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,i=e.get("plugins"),s=e.get("removePlugins")||[],r=e.get("extraPlugins")||[],o=e.get("substitutePlugins")||[];return this.plugins.init(i.concat(r),s,o).then(l=>(a(this),l));function a(l){const c=l.config.get("licenseKey");if(c==="GPL")return;const u=XL(c);if(!u)return;const d=[...l.plugins].map(([h])=>h).find(h=>!h.pluginName||!h.licenseFeatureCode?!1:$he(u,h.licenseFeatureCode));d&&(l.enableReadOnlyMode(Symbol("invalidLicense")),l._showLicenseError("pluginNotAllowed",d.pluginName))}}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(i=>this.once("ready",i))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(e,...i){try{return this.commands.execute(e,...i)}catch(s){/* istanbul ignore next -- @preserve */ee.rethrowUnexpectedError(s,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}_showLicenseError(e,i){setTimeout(()=>{if(e=="invalid")throw new ee("invalid-license-key");if(e=="expired")throw new ee("license-key-expired");
455if(e=="domainLimit")throw new ee("license-key-domain-limit");if(e=="pluginNotAllowed"){const s=i.replace(/(Editing|UI)$/,""),r=this.plugins.has(s);throw new ee("license-key-plugin-not-allowed",null,{pluginName:r?s:i})}if(e=="featureNotAllowed")throw new ee("license-key-feature-not-allowed",null,{featureName:i});if(e=="evaluationLimit")throw new ee("license-key-evaluation-limit");if(e=="trialLimit")throw new ee("license-key-trial-limit");if(e=="developmentLimit")throw new ee("license-key-development-limit");if(e=="usageLimit")throw new ee("license-key-usage-limit");if(e=="distributionChannel")throw new ee("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,i){const s=new Headers({"Content-Type":"application/json"}),r=await fetch(new URL(e),{method:"POST",headers:s,body:JSON.stringify(i)});if(!r.ok)throw new Error(`HTTP Response: ${r.status}`);return r.json()}}y(rf,"defaultConfig"),y(rf,"builtinPlugins"),y(rf,"Context",GE),y(rf,"EditorWatchdog",d4),y(rf,"ContextWatchdog",Ape);function Bpe(n){const t=Mpe(n);function e(i,s){if($c(t,i)!==void 0)throw new ee("editor-usage-data-path-already-set",{path:i});G$(t,i,s)}return n.fire("collectUsageData",{setUsageData:e}),t}function Vpe(n){if(!VE(n.updateSourceElement))throw new ee("attachtoform-missing-elementapi-interface",n);const t=n.sourceElement;if(Hpe(t)&&t.form){let e;const i=t.form,s=()=>n.updateSourceElement();VE(i.submit)&&(e=i.submit,i.submit=()=>{s(),e.apply(i)}),i.addEventListener("submit",s),n.on("destroy",()=>{i.removeEventListener("submit",s),e&&(i.submit=e)})}}function Hpe(n){return!!n&&n.tagName.toLowerCase()==="textarea"}function zpe(n){class t extends n{constructor(){super(...arguments);y(this,"sourceElement")}updateSourceElement(s){if(!this.sourceElement)throw new ee("editor-missing-sourceelement",this);const r=this.config.get("updateSourceElementOnDestroy"),o=this.sourceElement instanceof HTMLTextAreaElement;if(!r&&!o){HL(this.sourceElement,"");return}const a=typeof s=="string"?s:this.data.get();HL(this.sourceElement,a)}}return t}class zF extends f4{constructor(){super(...arguments);y(this,"_actions")}static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new er({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new ee("pendingactions-add-invalid-message",this);const i=new(Ut());return i.set("message",e),this._actions.add(i),this.hasAny=!0,i}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}/** 456 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 457 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 458 */let $pe=class extends Ut(){constructor(){super();y(this,"total");y(this,"_reader");y(this,"_data");const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=i=>{this.loaded=i.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const i=this._reader;return this.total=e.size,new Promise((s,r)=>{i.onload=()=>{const o=i.result;this._data=o,s(o)},i.onerror=()=>{r("error")},i.onabort=()=>{r("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}};class kc extends we{constructor(){super(...arguments);y(this,"loaders",new er);y(this,"_loadersMap",new Map);y(this,"_pendingAction",null)}static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[zF]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,i)=>i?e/i*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return Dt("filerepository-no-upload-adapter"),null;const i=new $F(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(i),this._loadersMap.set(e,i),e instanceof Promise&&i.file.then(s=>{this._loadersMap.set(s,i)}).catch(()=>{}),i.on("change:uploaded",()=>{let s=0;for(const r of this.loaders)s+=r.uploaded;this.uploaded=s}),i.on("change:uploadTotal",()=>{let s=0;for(const r of this.loaders)r.uploadTotal&&(s+=r.uploadTotal);this.uploadTotal=s}),i}destroyLoader(e){const i=e instanceof $F?e:this.getLoader(e);
458i._destroy(),this.loaders.remove(i),this._loadersMap.forEach((s,r)=>{s===i&&this._loadersMap.delete(r)})}_updatePendingAction(){const e=this.editor.plugins.get(zF);if(this.loaders.length){if(!this._pendingAction){const i=this.editor.t,s=r=>`${i("Upload in progress")} ${parseInt(r)}%.`;this._pendingAction=e.add(s(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",s)}}else e.remove(this._pendingAction),this._pendingAction=null}}class $F extends Ut(){constructor(e,i){super();y(this,"id");y(this,"_filePromiseWrapper");y(this,"_adapter");y(this,"_reader");this.id=is(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=i(this),this._reader=new $pe,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(s,r)=>r?s/r*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new ee("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new ee("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const i={};return i.promise=new Promise((s,r)=>{i.rejecter=r,i.isFulfilled=!1,e.then(o=>{i.isFulfilled=!0,s(o)}).catch(o=>{i.isFulfilled=!0,r(o)})}),i}}class Wpe extends we{static get requires(){return[kc]}static get pluginName(){return"Base64UploadAdapter"}static get licenseFeatureCode(){return"B64A"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){this.editor.plugins.get(kc).createUploadAdapter=t=>new Upe(t)}}let Upe=class{constructor(t){y(this,"loader");y(this,"reader");this.loader=t}upload(){return new Promise((t,e)=>{const i=this.reader=new window.FileReader;i.addEventListener("load",()=>{t({default:i.result})}),i.addEventListener("error",s=>{e(s)}),i.addEventListener("abort",()=>{e()}),this.loader.file.then(s=>{i.readAsDataURL(s)})})}abort(){this.reader.abort()}};/** 459 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 460 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 461 */var WF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 6.628a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M8.5 9.125a.3.3 0 0 0-.253-.296L5.11 8.327a.75.75 0 1 1 .388-1.449l4.04.716c.267.072.624.08.893.009l4.066-.724a.75.75 0 1 1 .388 1.45l-3.132.5a.3.3 0 0 0-.253.296v1.357a.3.3 0 0 0 .018.102l1.615 4.438a.75.75 0 0 1-1.41.513l-1.35-3.71a.3.3 0 0 0-.281-.197h-.209a.3.3 0 0 0-.282.198l-1.35 3.711a.75.75 0 0 1-1.41-.513l1.64-4.509a.3.3 0 0 0 .019-.103z"/><path d="M10 18.5a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17m0 1.5c5.523 0 10-4.477 10-10S15.523 0 10 0 0 4.477 0 10s4.477 10 10 10" clip-rule="evenodd"/></svg>',jpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75m0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75"/></svg>',g4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.187 17H5.773q-.956 0-1.364-.415-.41-.416-.409-1.323V4.738q0-.926.419-1.332.418-.405 1.354-.406h4.68q1.035 0 1.793.124.76.124 1.36.478.512.296.906.75a3.26 3.26 0 0 1 .808 2.162q0 2.102-2.167 3.075 2.846.879 2.847 3.421a3.76 3.76 0 0 1-2.296 3.504 6 6 0 0 1-1.517.377q-.857.11-2 .11zm-.217-6.217H7v4.087h3.069q2.965 0 2.965-2.072 0-1.061-.768-1.537-.768-.478-2.296-.478M7 5.13v3.619h2.606q1.093 0 1.69-.2a1.
4616 1.6 0 0 0 .91-.765q.247-.4.247-.897 0-1.06-.778-1.409-.778-.348-2.375-.348z"/></svg>',Gpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75m-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75m6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75m-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75"/></svg>',Ype='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414z"/></svg>',qpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2"/><path fill-opacity=".6" d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492z"/></svg>',Kpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.972 16.615a1 1 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a1 1 0 0 1-.745.292"/></svg>',Xpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7zM0 7h1v2H0zm15 0h1v2h-1zm-8 8h2v1H7z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>',Jpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5 3.25a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m-7 6.75a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"/></svg>',XT='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136z"/></svg>',Zpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.66 9.118a.693.693 0 0 1 .956.032l3.65 3.411 2.422-2.238a.695.695 0 0 1 .945 0L17.5 13.6V2.5h-15v11.1zM17.8 1c.652 0 1.2.47 1.2 1.1v14.362c0 .64-.532 1.038-1.184 1.038H2.184C1.532 17.5 1 17.103 1 16.462V2.1C1 1.47 1.537 1 2.2 1zm-5.655 6a2.13 2.13 0 0 1 .157-2.364A2.133 2.133 0 1 1 12.145 7"/></svg>',Qpe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M1.201 1C.538 1 0 1.47 0 2.1v14.363c0 .64.534 1.037 1.186 1.037h9.494a3 3 0 0 1-.414-.287 3 3 0 0 1-1.055-2.03 3 3 0 0 1 .693-2.185l.383-.455-.02.018-3.65-3.41a.695.695 0 0 0-.957-.034L1.5 13.6V2.5h15v5.535a2.97 2.97 0 0 1 1.412.932l.088.105V2.1c0-.63-.547-1.1-1.2-1.1zm11.713 2.803a2.146 2.146 0 0 0-2.049 1.992 2.14 2.14 0 0 0 1.28 2.096 2.13 2.13 0 0 0 2.644-3.11 2.13 2.13 0 0 0-1.875-.978"/><path d="M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.8.8 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79"/><path d="M15.522 19.1a.79.79 0 0 0 .79-.79v-5.373l2.059 2.455a.79.79 0 1 0 1.211-1.015l-3.352-3.995a.79.79 0 0 0-.995-.179.8.8 0 0 0-.299.221l-3.35 3.99a.79.79 0 1 0 1.21 1.017l1.936-2.306v5.185c0 .436.353.79.79.79"/></svg>',ebe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M19 4.5 14 0H3v12.673l.868-1.041c.185-.222.4-.402.632-.54V1.5h8v5h5v7.626a2.24 2.24 0 0 1 1.5.822zM14 5V2l3.3 3zm-3.692 12.5q.093.157.213.303L11.52 19H8v-.876a2.24 2.24 0 0 0 1.82-.624zm7.518-.657a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0zm-15.056-.38a.75.75 0 0 1-.096-1.056l2.346-2.815a.95.95 0 0 1 1.46 0l2.346 2.815a.75.75 0 1 1-1.152.96L6.5 14.96V20H5v-5.04l-1.174 1.408a.75.75 0 0 1-1.056.096Z"/></svg>',tbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m9.586 14.633.021.004q-.054.502.393.962.123.125.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15q.711-.106 1.005-.334.235-.
461182.404-.597l2.416-9.55a1.05 1.05 0 0 0-.281-.823 1.1 1.1 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195q-.564.084-.823.296-.323.263-.623.79z"/></svg>',m4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.8.8 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.7.7 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294zm5.494-5.335a.8.8 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.8.8 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955m-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184"/></svg>',p4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382z"/></svg>',nbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75M3.5 3v5H2V3.7H1v-1h2.5zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001q-.073.607-.333.988-.263.381-1.244 1.312H4.3v1h-4zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75"/></svg>',pI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H6.5V12h6.997z"/></svg>',ibe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1m-1.505.5H3.504V12h12.991z"/></svg>',b4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z" opacity=".5"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H3.5V12h6.997z"/></svg>',bI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z" opacity=".5"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H9.5V12h6.997z"/></svg>',w4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z" opacity=".5"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H3.5V12h6.997z"/></svg>',v4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H3.5V12h6.997z"/></svg>',y4='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2 3h16v1.5H2zm0 12h16v1.5H2z" opacity=".5"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1m-1.506.5H9.5V12h6.997z"/></svg>',sbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.95 1.43a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h.75v6.3H.95a.95.95 0 0 0-.95.95v3.1a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-.65h1.932l1.539-1.5H5v-.95a.95.95 0 0 0-.95-.95H3.2v-6.3h.85A.95.95 0 0 0 5 5.48v-.55h10v.55a.95.95 0 0 0 .95.95h3.1a.95.95 0 0 0 .95-.95v-3.1a.95.95 0 0 0-.95-.95h-3.1a.95.95 0 0 0-.95.95v1.05H5V2.38a.95.95 0 0 0-.95-.95zm.55 3.5v-2h2v2zm0 9.3v2h2v-2zm15-11.3v2h2v-2zM8.139 20.004v-2.388l7.045-7.048 2.391 2.391-7.046 7.046zm11.421-9.101a.6.6 0 0 1-.138.206l-1.165 1.168-2.391-2.391 1.167-1.163a.6.6 0 0 1 .206-.138.6.6 0 0 1 .243-.049.63.63 0 0 1 .449.187l1.491 1.488c.059.059.108.129.138.206s.049.16.049.243a.6.6 0 0 1-.049.243"/></svg>',rbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15.5v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm-19-2v1H0v-1zm19 0v1h-1v-1zm0-2v1h-1v-1zm-19 0v1H0v-1zM14.5 2v1h-1V2zm2 0v1h-1V2zm2 0v1h-1V2zm-8 0v1h-1V2zm-2 0v1h-1V2zm-2 0v1h-1V2zm-2 0v1h-1V2zm8 0v1h-1V2zm-10 0v1h-1V2z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2m0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.49.49 0 0 1-.476-.5V4c0-.276.213-.5.476-.5z"/></svg>',obe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 16.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15v1H0v-1zm19 0v1h-1v-1zM1 13v1H0v-1zm19 0v1h-1v-1zM1 11v1H0v-1zm19 0v1h-1v-1zM1 9v1H0V9zm19 0v1h-1V9zM1 7v1H0V7zm19 0v1h-1V7zM1 5v1H0V5zm19 0v1h-1V5zm0-2v1h-1V3zM1 3v1H0V3zm13.5-1.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm-8 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm8 0v1h-1v-1zm-10 0v1h-1v-1z"/><path d="M13 5.5H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2M13 7a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-8A.5.5 0 0 1 2 7z"/></svg>',abe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 16.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15v1H0v-1zm19 0v1h-1v-1zM1 13v1H0v-1zm19 0v1h-1v-1zM1 11v1H0v-1zm19 0v1h-1v-1zM1 9v1H0V9zm19 0v1h-1V9zM1 7v1H0V7zm19 0v1h-1V7zM1 5v1H0V5zm19 0v1h-1V5zm0-2v1h-1V3zM1 3v1H0V3zm13.5-1.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm-8 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm8 0v1h-1v-1zm-10 0v1h-1v-1z"/><path d="M10 7.5H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2M10 9a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6A.5.5 0 0 1 2 9z"/></svg>',lbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 16.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zM1 15v1H0v-1zm19 0v1h-1v-1zM1 13v1H0v-1zm19 0v1h-1v-1zM1 11v1H0v-1zm19 0v1h-1v-1zM1 9v1H0V9zm19 0v1h-1V9zM1 7v1H0V7zm19 0v1h-1V7zM1 5v1H0V5zm19 0v1h-1V5zm0-2v1h-1V3zM1 3v1H0V3zm13.5-1.5v1h-1v-1zm2 0v1h-1v-1zm2 0v1h-1v-1zm-8 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm-2 0v1h-1v-1zm8 0v1h-1v-1zm-10 0v1h-1v-1z"/>
461<path d="M7 9.5H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2M7 11a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4A.5.5 0 0 1 2 11z"/></svg>',cbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5M5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"/></svg>',ube='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m7.3 17.37-.061.088a1.52 1.52 0 0 1-.934.535l-4.178.663-.806-4.153a1.5 1.5 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346zM6.07 16.512l-3.276-2.295.53 2.73zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328M8 18.5 9.375 17H19v1.5z"/></svg>',dbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4"/></svg>',hbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10 2a1 1 0 0 0-1 1v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V3a1 1 0 0 0-1-1"/></svg>',Rm='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>',fbe=`<svg xmlns="http://www.w3.org/2000/svg" width="53" height="10" viewBox="0 0 53 10"><path fill="#1C2331" d="M31.724 1.492a15.139 15.139 0 0 0 .045 1.16 2.434 2.434 0 0 0-.687-.34 3.68 3.68 0 0 0-1.103-.166 2.332 2.332 0 0 0-1.14.255 1.549 1.549 0 0 0-.686.87c-.15.41-.225.98-.225 1.712 0 .939.148 1.659.444 2.161.297.503.792.754 1.487.754.452.015.9-.094 1.294-.316.296-.174.557-.4.771-.669l.14.852h1.282V.007h-1.623v1.485ZM31 6.496a1.77 1.77 0 0 1-.494.061.964.964 0 0 1-.521-.127.758.758 0 0 1-.296-.466 3.984 3.984 0 0 1-.093-.992 4.208 4.208 0 0 1 .098-1.052.753.753 0 0 1 .307-.477 1.08 1.08 0 0 1 .55-.122c.233-.004.466.026.69.089l.483.144v2.553c-.11.076-.213.143-.307.2a1.73 1.73 0 0 1-.417.189ZM35.68 0l-.702.004c-.322.002-.482.168-.48.497l.004.581c.002.33.164.493.486.49l.702-.004c.322-.002.481-.167.48-.496L36.165.49c-.002-.33-.164-.493-.486-.491ZM36.145 2.313l-1.612.01.034 5.482 1.613-.01-.035-5.482ZM39.623.79 37.989.8 38 2.306l-.946.056.006 1.009.949-.006.024 2.983c.003.476.143.844.419 1.106.275.26.658.39 1.148.387.132 0 .293-.01.483-.03.19-.02.38-.046.57-.08.163-.028.324-.068.482-.119l-.183-1.095-.702.004a.664.664 0 0 1-.456-.123.553.553 0 0 1-.14-.422l-.016-2.621 1.513-.01-.006-1.064-1.514.01-.01-1.503ZM46.226 2.388c-.41-.184-.956-.274-1.636-.27-.673.004-1.215.101-1.627.29-.402.179-.72.505-.888.91-.18.419-.268.979-.264 1.68.004.688.1 1.24.285 1.655.172.404.495.724.9.894.414.18.957.268 1.63.264.68-.004 1.224-.099 1.632-.284.4-.176.714-.501.878-.905.176-.418.263-.971.258-1.658-.004-.702-.097-1.261-.28-1.677a1.696 1.696 0 0 0-.888-.9Zm-.613 3.607a.77.77 0 0 1-.337.501 1.649 1.649 0 0 1-1.317.009.776.776 0 0 1-.343-.497 4.066 4.066 0 0 1-.105-1.02 4.136 4.136 0 0 1 .092-1.03.786.786 0 0 1 .337-.507 1.59 1.59 0 0 1 1.316-.008.79.79 0 0 1 .344.502c.078.337.113.683.105 1.03.012.343-.019.685-.092 1.02ZM52.114 2.07a2.67 2.67 0 0 0-1.128.278c-.39.191-.752.437-1.072.73l-.157-.846-1.273.008.036 5.572 1.623-.01-.024-3.78c.35-.124.646-.22.887-.286.26-.075.53-.114.8-.118l.45-.003.144-1.546-.286.001ZM22.083 7.426l-1.576-2.532a2.137 2.137 0 0 0-.172-.253 1.95 1.95 0 0 0-.304-.29.138.138 0 0 1 .042-.04 1.7 1.7 0 0 0 .328-.374l1.75-2.71c.01-.015.025-.028.024-.048-.01-.01-.021-.007-.031-.007L20.49 1.17a.078.078 0 0 0-.075.045l-.868 1.384c-.23.366-.46.732-.688 1.099a.108.108 0 0 1-.112.06c-.098-.005-.196-.001-.294-.002-.018 0-.038.006-.055-.007.002-.02.002-.039.005-.058a4.6 4.6 0 0 0 .046-.701V1.203c0-.02-.009-.032-.03-.03h-.033L16.93 1.17c-.084 0-.073-.01-.073.076v6.491c-.001.018.006.028.025.027h1.494c.083 0 .072.007.072-.071v-2.19c0-.055-.003-.11-.004-.166a3.366 3.366 0 0 0-.05-.417h.06c.104 0 .209.002.313-.002a.082.082 0 0 1 .084.05c.535.913 1.07 1.824
4611.607 2.736a.104.104 0 0 0 .103.062c.554-.003 1.107-.002 1.66-.002l.069-.003-.019-.032-.188-.304ZM27.112 6.555c-.005-.08-.004-.08-.082-.08h-2.414c-.053 0-.106-.003-.159-.011a.279.279 0 0 1-.246-.209.558.558 0 0 1-.022-.15c0-.382 0-.762-.002-1.143 0-.032.007-.049.042-.044h2.504c.029.003.037-.012.034-.038V3.814c0-.089.013-.078-.076-.078h-2.44c-.07 0-.062.003-.062-.06v-.837c0-.047.004-.093.013-.14a.283.283 0 0 1 .241-.246.717.717 0 0 1 .146-.011h2.484c.024.002.035-.009.036-.033l.003-.038.03-.496c.01-.183.024-.365.034-.548.005-.085.003-.087-.082-.094-.218-.018-.437-.038-.655-.05a17.845 17.845 0 0 0-.657-.026 72.994 72.994 0 0 0-1.756-.016 1.7 1.7 0 0 0-.471.064 1.286 1.286 0 0 0-.817.655c-.099.196-.149.413-.145.633v3.875c0 .072.003.144.011.216a1.27 1.27 0 0 0 .711 1.029c.228.113.48.167.734.158.757-.005 1.515.002 2.272-.042.274-.016.548-.034.82-.053.03-.002.043-.008.04-.041-.008-.104-.012-.208-.019-.312a69.964 69.964 0 0 1-.05-.768ZM16.14 7.415l-.127-1.075c-.004-.03-.014-.04-.044-.037a13.125 13.125 0 0 1-.998.073c-.336.01-.672.02-1.008.016-.116-.001-.233-.014-.347-.039a.746.746 0 0 1-.45-.262c-.075-.1-.132-.211-.167-.33a3.324 3.324 0 0 1-.126-.773 9.113 9.113 0 0 1-.015-.749c0-.285.022-.57.065-.852.023-.158.066-.312.127-.46a.728.728 0 0 1 .518-.443 1.64 1.64 0 0 1 .397-.048c.628-.001 1.255.003 1.882.05.022.001.033-.006.036-.026l.003-.031.06-.55c.019-.177.036-.355.057-.532.004-.034-.005-.046-.04-.056a5.595 5.595 0 0 0-1.213-.21 10.783 10.783 0 0 0-.708-.02c-.24-.003-.48.01-.719.041a3.477 3.477 0 0 0-.625.14 1.912 1.912 0 0 0-.807.497c-.185.2-.33.433-.424.688a4.311 4.311 0 0 0-.24 1.096c-.031.286-.045.572-.042.86-.006.43.024.86.091 1.286.04.25.104.497.193.734.098.279.26.53.473.734.214.205.473.358.756.446.344.11.702.17 1.063.177a8.505 8.505 0 0 0 1.578-.083 6.11 6.11 0 0 0 .766-.18c.03-.008.047-.023.037-.057a.157.157 0 0 1-.003-.025Z"/><path fill="#AFE229" d="M6.016 6.69a1.592 1.592 0 0 0-.614.21c-.23.132-.422.32-.56.546-.044.072-.287.539-.287.539l-.836 1.528.009.006c.038.025.08.046.123.063.127.046.26.07.395.073.505.023 1.011-.007 1.517-.003.29.009.58.002.869-.022a.886.886 0 0 0 .395-.116.962.962 0 0 0 .312-.286c.056-.083.114-.163.164-.249.24-.408.48-.816.718-1.226.075-.128.148-.257.222-.386l.112-.192a1.07 1.07 0 0 0 .153-.518l-1.304.023s-1.258-.005-1.388.01Z"/><path fill="#771BFF" d="m2.848 9.044.76-1.39.184-.352c-.124-.067-.245-.14-.367-.21-.346-.204-.706-.384-1.045-.6a.984.984 0 0 1-.244-.207c-.108-.134-.136-.294-.144-.46-.021-.409-.002-.818-.009-1.227-.003-.195 0-.39.003-.585.004-.322.153-.553.427-.713l.833-.488c.22-.13.44-.257.662-.385.05-.029.105-.052.158-.077.272-.128.519-.047.76.085l.044.028c.123.06.242.125.358.196.318.178.635.357.952.537.095.056.187.117.275.184.194.144.254.35.266.578.016.284.007.569.006.853-.001.28.004.558 0 .838.592-.003 1.259 0 1.259 0l.723-.013c-.003-.292-.007-.584-.007-.876 0-.524.015-1.048-.016-1.571-.024-.42-.135-.8-.492-1.067a5.02 5.02 0 0 0-.506-.339A400.52 400.52 0 0 0 5.94.787C5.722.664 5.513.524 5.282.423 5.255.406 5.228.388 5.2.373 4.758.126 4.305-.026 3.807.21c-.097.046-.197.087-.29.14A699.896 699.896 0 0 0 .783 1.948c-.501.294-.773.717-.778 1.31-.004.36-.009.718-.001 1.077.016.754-.017 1.508.024 2.261.016.304.07.6.269.848.127.15.279.28.448.382.622.4 1.283.734 1.92 1.11l.183.109Z"/></svg> 462`,gbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003z"/></svg>',UF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.75.75 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.8.8 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032z"/></svg>',mbe='<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',pbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75m18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75m-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2z"/></svg>',bbe=`<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.734 6.375H1.75a.75.75 0 0 1 0-1.5h1.984a2.626 2.626 0 0 1 5.032 0h9.48a.75.75 0 0 1 0 1.5h-9.48a2.626 2.626 0 0 1-5.032 0Zm1.141-.75a1.375 1.375 0 1 1 2.75 0 1.375 1.375 0 0 1-2.75 0ZM16.263 14.625h1.983a.75.75 0 0 1 0 1.5h-1.983a2.626 2.626 0 0 1-5.033 0H1.75a.75.75 0 0 1 0-1.5h9.48a2.626 2.626 0 0 1 5.033 0Zm-1.142.75a1.375 1.375 0 1 1-2.75 0 1.375 1.375 0 0 1 2.75 0Z"/></svg> 463`,wbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z" opacity=".6"/><path d="M18 7v1H2V7zm0 5v1H2v-1z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1m-2 1H8v4h4zm0 6H8v4h4zm0 6H8v4h4z"/></svg>',vbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z" opacity=".6"/><path d="M7 2h1v16H7zm5 0h1v7h-1zm6 5v1H2V7zM8 12v1H2v-1z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1m1 2v9h10V9z"/></svg>',ybe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1M2 2v16h16V2z" opacity=".6"/><path d="M7 2h1v16H7zm5 0h1v16h-1z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1m1 2v4h4V8zm6 0v4h4V8zm6 0v4h4V8z"/></svg>',jF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3 5.5v3h4v-3zm0 4v3h4v-3zm0 4v3h4v-3zm5 3h4v-3H8zm5 0h4v-3h-4zm4-4v-3h-4v3zm0-4v-3h-4v3zm1.5 8A1.5 1.5 0 0 1 17 18H3a1.5 1.5 0 0 1-1.5-1.5V3c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5zm-6.5-4v-3H8v3zm0-4v-3H8v3z"/></svg>',_be='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3.035 1C2.446 1 2 1.54 2 2.098V10.5h1.5v-8h13v8H18V2.098C18 1.539 17.48 1 16.9 1zm10.453 2.61a1.89 1.89 0 0 0-1.442.736 1.89 1.89 0 0 0 1.011 2.976 1.9 1.9 0 0 0 2.253-1.114 1.887 1.887 0 0 0-1.822-2.598M7.463 8.163a.6.6 0 0 0-.432.154L5.071 10.5h5.119L7.88 8.348a.63.63 0 0 0-.417-.185m6.236 1.059a.62.62 0 0 0-.42.164L12.07 10.5h2.969l-.92-1.113a.62.62 0 0 0-.42-.165M.91 11.5a.91.91 0 0 0-.91.912v6.877c0 .505.405.91.91.91h18.178a.91.91 0 0 0 .912-.91v-6.877a.91.91 0 0 0-.912-.912zM3.668 13h1.947l2.135 5.7H5.898l-.28-.946H3.601l-.278.945H1.516zm4.947 0h1.801v4.3h2.7v1.4h-4.5zm4.5 0h5.4v1.4h-1.798v4.3h-1.701v-4.3h-1.9zm-8.517 1.457-.614 2.059h1.262z"/></svg>',Ebe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.816 11.5 7.038 4.785 4.261 11.5zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663z"/><path d="m12.09 17-.534-1.292.848-1.971.545 1.319L12.113 17zm1.142-5.187.545 1.319L15.5 9.13l1.858 4.316h-3.45l.398.965h3.467L18.887 17H20l-3.873-9h-1.254z"/></svg>',uO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>',Sbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8s3.4
463-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4"/></svg>',GF='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.75.75 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.8.8 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032z"/></svg>',Tbe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.8.8 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.7.7 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294zm5.494-5.335a.8.8 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.8.8 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955m-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184m4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06z"/></svg>';const wI={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87
463],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const n in wI)Object.freeze(wI[n]);Object.freeze(wI);const vI={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const n in vI)Object.freeze(vI[n]);const qb=Object.freeze(vI),_4={};for(const n of Object.keys(qb))_4[qb[n]]=n;const Me={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},dl=(6/29)**3;function If(n){const t=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,t),1)}function Pf(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(const n of Object.keys(Me)){if(!("channels"in Me[n]))throw new Error("missing channels property: "+n);if(!("labels"in Me[n]))throw new Error("missing channel labels property: "+n);if(Me[n].labels.length!==Me[n].channels)throw new Error("channel and label counts mismatch: "+n);const{channels:t,labels:e}=Me[n];delete Me[n].channels,delete Me[n].labels,Object.defineProperty(Me[n],"channels",{value:t}
463),Object.defineProperty(Me[n],"labels",{value:e})}Me.rgb.hsl=function(n){const t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s;let a,l;switch(r){case s:{a=0;break}case t:{a=(e-i)/o;break}case e:{a=2+(i-t)/o;break}case i:{a=4+(t-e)/o;break}}a=Math.min(a*60,360),a<0&&(a+=360);const c=(s+r)/2;return r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};Me.rgb.hsv=function(n){let t,e,i,s,r;const o=n[0]/255,a=n[1]/255,l=n[2]/255,c=Math.max(o,a,l),u=c-Math.min(o,a,l),d=function(h){return(c-h)/6/u+1/2};if(u===0)s=0,r=0;else{switch(r=u/c,t=d(o),e=d(a),i=d(l),c){case o:{s=i-e;break}case a:{s=1/3+t-i;break}case l:{s=2/3+e-t;break}}s<0?s+=1:s>1&&(s-=1)}return[s*360,r*100,c*100]};Me.rgb.hwb=function(n){const t=n[0],e=n[1];let i=n[2];const s=Me.rgb.hsl(n)[0],r=1/255*Math.min(t,Math.min(e,i));return i=1-1/255*Math.max(t,Math.max(e,i)),[s,r*100,i*100]};Me.rgb.oklab=function(n){const t=Pf(n[0]/255),e=Pf(n[1]/255),i=Pf(n[2]/255),s=Math.cbrt(.4122214708*t+.5363325363*e+.0514459929*i),r=Math.cbrt(.2119034982*t+.6806995451*e+.1073969566*i),o=Math.cbrt(.0883024619*t+.2817188376*e+.6299787005*i),a=.2104542553*s+.793617785*r-.0040720468*o,l=1.9779984951*s-2.428592205*r+.4505937099*o,c=.0259040371*s+.7827717662*r-.808675766*o;return[a*100,l*100,c*100]};Me.rgb.cmyk=function(n){const t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(1-t,1-e,1-i),r=(1-t-s)/(1-s)||0,o=(1-e-s)/(1-s)||0,a=(1-i-s)/(1-s)||0;return[r*100,o*100,a*100,s*100]};function xbe(n,t){return(n[0]-t[0])**2+(n[1]-t[1])**2+(n[2]-t[2])**2}Me.rgb.keyword=function(n){const t=_4[n];if(t)return t;let e=Number.POSITIVE_INFINITY,i;for(const s of Object.keys(qb)){const r=qb[s],o=xbe(n,r);o<e&&(e=o,i=s)}return i};Me.keyword.rgb=function(n){return qb[n]};Me.rgb.xyz=function(n){const t=Pf(n[0]/255),e=Pf(n[1]/255),i=Pf(n[2]/255),s=t*.4124564+e*.3575761+i*.1804375,r=t*.2126729+e*.7151522+i*.072175,o=t*.0193339+e*.119192+i*.9503041;return[s*100,r*100,o*100]};Me.rgb.lab=function(n){const t=Me.rgb.xyz(n);let e=t[0],i=t[1],s=t[2];e/=95.047,i/=100,s/=108.883,e=e>dl?e**(1/3):7.787*e+16/116,i=i>dl?i**(1/3):7.787*i+16/116,s=s>dl?s**(1/3):7.787*s+16/116;const r=116*i-16,o=500*(e-i),a=200*(i-s);return[r,o,a]};Me.hsl.rgb=function(n){const t=n[0]/360,e=n[1]/100,i=n[2]/100;let s,r;if(e===0)return r=i*255,[r,r,r];const o=i<.5?i*(1+e):i+e-i*e,a=2*i-o,l=[0,0,0];for(let c=0;c<3;c++)s=t+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?r=a+(o-a)*6*s:2*s<1?r=o:3*s<2?r=a+(o-a)*(2/3-s)*6:r=a,l[c]=r*255;return l};Me.hsl.hsv=function(n){const t=n[0];let e=n[1]/100,i=n[2]/100,s=e;const r=Math.max(i,.01);i*=2,e*=i<=1?i:2-i,s*=r<=1?r:2-r;const o=(i+e)/2,a=i===0?2*s/(r+s):2*e/(i+e);return[t,a*100,o*100]};Me.hsv.rgb=function(n){const t=n[0]/60,e=n[1]/100;let i=n[2]/100;const s=Math.floor(t)%6,r=t-Math.floor(t),o=255*i*(1-e),a=255*i*(1-e*r),l=255*i*(1-e*(1-r));switch(i*=255,s){case 0:return[i,l,o];case 1:return[a,i,o];case 2:return[o,i,l];case 3:return[o,a,i];case 4:return[l,o,i];case 5:return[i,o,a]}};Me.hsv.hsl=function(n){const t=n[0],e=n[1]/100,i=n[2]/100,s=Math.max(i,.01);let r,o;o=(2-e)*i;const a=(2-e)*s;return r=e*s,r/=a<=1?a:2-a,r=r||0,o/=2,[t,r*100,o*100]};Me.hwb.rgb=function(n){const t=n[0]/360;let e=n[1]/100,i=n[2]/100;const s=e+i;let r;s>1&&(e/=s,i/=s);const o=Math.floor(6*t),a=1-i;r=6*t-o,o&1&&(r=1-r);const l=e+r*(a-e);let c,u,d;switch(o){default:case 6:case 0:{c=a,u=l,d=e;break}case 1:{c=l,u=a,d=e;break}case 2:{c=e,u=a,d=l;break}case 3:{c=e,u=l,d=a;break}case 4:{c=l,u=e,d=a;break}case 5:{c=a,u=e,d=l;break}}return[c*255,u*255,d*255]};Me.cmyk.rgb=function(n){const t=n[0]/100,e=n[1]/100,i=n[2]/100,s=n[3]/100,r=1-Math.min(1,t*(1-s)+s),o=1-Math.min(1,e*(1-s)+s),a=1-Math.min(1,i*(1-s)+s);return[r*255,o*255,a*255]};Me.xyz.rgb=function(n){const t=n[0]/100,e=n[1]/100,i=n[2]/100;let s,r,o;return s=t*3.2404542+e*-1.5371385+i*-.4985314,r=t*-.969266+e*1.8760108+i*.041556,o=t*.0556434+e*-.2040259+i*1.0572252,s=If(s),r=If(r),o=If(o),[s*255,r*255,o*255]};Me.xyz.lab=function(n){let t=n[0],e=n[1],i=n[2];t/=95.047,e/=100,i/=108.883,t=t>dl?t**(1/3):7.787*t+16/116,e=e>dl?e**(1/3):7.787*e+16/116,i=i>dl?i**(1/3):7.787*i+16/116;const s=116*e-16,r=500*(t-e),o=200*(e-i);return[s,r,o]};Me.xyz.oklab=function(n){const t=n[0]/100,e=n[1]/100,i=n[2]/100,s=Math.cbrt(.8189330101*t+.3618667424*e-.1288597137*i),r=M
463ath.cbrt(.0329845436*t+.9293118715*e+.0361456387*i),o=Math.cbrt(.0482003018*t+.2643662691*e+.633851707*i),a=.2104542553*s+.793617785*r-.0040720468*o,l=1.9779984951*s-2.428592205*r+.4505937099*o,c=.0259040371*s+.7827717662*r-.808675766*o;return[a*100,l*100,c*100]};Me.oklab.oklch=function(n){return Me.lab.lch(n)};Me.oklab.xyz=function(n){const t=n[0]/100,e=n[1]/100,i=n[2]/100,s=(.999999998*t+.396337792*e+.215803758*i)**3,r=(1.000000008*t-.105561342*e-.063854175*i)**3,o=(1.000000055*t-.089484182*e-1.291485538*i)**3,a=1.227013851*s-.55779998*r+.281256149*o,l=-.040580178*s+1.11225687*r-.071676679*o,c=-.076381285*s-.421481978*r+1.58616322*o;return[a*100,l*100,c*100]};Me.oklab.rgb=function(n){const t=n[0]/100,e=n[1]/100,i=n[2]/100,s=(t+.3963377774*e+.2158037573*i)**3,r=(t-.1055613458*e-.0638541728*i)**3,o=(t-.0894841775*e-1.291485548*i)**3,a=If(4.0767416621*s-3.3077115913*r+.2309699292*o),l=If(-1.2684380046*s+2.6097574011*r-.3413193965*o),c=If(-.0041960863*s-.7034186147*r+1.707614701*o);return[a*255,l*255,c*255]};Me.oklch.oklab=function(n){return Me.lch.lab(n)};Me.lab.xyz=function(n){const t=n[0],e=n[1],i=n[2];let s,r,o;r=(t+16)/116,s=e/500+r,o=r-i/200;const a=r**3,l=s**3,c=o**3;return r=a>dl?a:(r-16/116)/7.787,s=l>dl?l:(s-16/116)/7.787,o=c>dl?c:(o-16/116)/7.787,s*=95.047,r*=100,o*=108.883,[s,r,o]};Me.lab.lch=function(n){const t=n[0],e=n[1],i=n[2];let s;s=Math.atan2(i,e)*360/2/Math.PI,s<0&&(s+=360);const o=Math.sqrt(e*e+i*i);return[t,o,s]};Me.lch.lab=function(n){const t=n[0],e=n[1],s=n[2]/360*2*Math.PI,r=e*Math.cos(s),o=e*Math.sin(s);return[t,r,o]};Me.rgb.ansi16=function(n,t=null){const[e,i,s]=n;let r=t===null?Me.rgb.hsv(n)[2]:t;if(r=Math.round(r/50),r===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(i/255)<<1|Math.round(e/255));return r===2&&(o+=60),o};Me.hsv.ansi16=function(n){return Me.rgb.ansi16(Me.hsv.rgb(n),n[2])};Me.rgb.ansi256=function(n){const t=n[0],e=n[1],i=n[2];return t>>4===e>>4&&e>>4===i>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5)};Me.ansi16.rgb=function(n){n=n[0];let t=n%10;if(t===0||t===7)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const e=(Math.trunc(n>50)+1)*.5,i=(t&1)*e*255,s=(t>>1&1)*e*255,r=(t>>2&1)*e*255;return[i,s,r]};Me.ansi256.rgb=function(n){if(n=n[0],n>=232){const r=(n-232)*10+8;return[r,r,r]}n-=16;let t;const e=Math.floor(n/36)/5*255,i=Math.floor((t=n%36)/6)/5*255,s=t%6/5*255;return[e,i,s]};Me.rgb.hex=function(n){const e=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(e.length)+e};Me.hex.rgb=function(n){const t=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let e=t[0];t[0].length===3&&(e=[...e].map(a=>a+a).join(""));const i=Number.parseInt(e,16),s=i>>16&255,r=i>>8&255,o=i&255;return[s,r,o]};Me.rgb.hcg=function(n){const t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.max(Math.max(t,e),i),r=Math.min(Math.min(t,e),i),o=s-r;let a;const l=o<1?r/(1-o):0;return o<=0?a=0:s===t?a=(e-i)/o%6:s===e?a=2+(i-t)/o:a=4+(t-e)/o,a/=6,a%=1,[a*360,o*100,l*100]};Me.hsl.hcg=function(n){const t=n[1]/100,e=n[2]/100,i=e<.5?2*t*e:2*t*(1-e);let s=0;return i<1&&(s=(e-.5*i)/(1-i)),[n[0],i*100,s*100]};Me.hsv.hcg=function(n){const t=n[1]/100,e=n[2]/100,i=t*e;let s=0;return i<1&&(s=(e-i)/(1-i)),[n[0],i*100,s*100]};Me.hcg.rgb=function(n){const t=n[0]/360,e=n[1]/100,i=n[2]/100;if(e===0)return[i*255,i*255,i*255];const s=[0,0,0],r=t%1*6,o=r%1,a=1-o;let l=0;switch(Math.floor(r)){case 0:{s[0]=1,s[1]=o,s[2]=0;break}case 1:{s[0]=a,s[1]=1,s[2]=0;break}case 2:{s[0]=0,s[1]=1,s[2]=o;break}case 3:{s[0]=0,s[1]=a,s[2]=1;break}case 4:{s[0]=o,s[1]=0,s[2]=1;break}default:s[0]=1,s[1]=0,s[2]=a}return l=(1-e)*i,[(e*s[0]+l)*255,(e*s[1]+l)*255,(e*s[2]+l)*255]};Me.hcg.hsv=function(n){const t=n[1]/100,e=n[2]/100,i=t+e*(1-t);let s=0;return i>0&&(s=t/i),[n[0],s*100,i*100]};Me.hcg.hsl=function(n){const t=n[1]/100,i=n[2]/100*(1-t)+.5*t;let s=0;return i>0&&i<.5?s=t/(2*i):i>=.5&&i<1&&(s=t/(2*(1-i))),[n[0],s*100,i*100]};Me.hcg.hwb=function(n){const t=n[1]/100,e=n[2]/100,i=t+e*(1-t);return[n[0],(i-t)*100,(1-i)*100]};Me.hwb.hcg=function(n){const t=n[1]/100,i=1-n[2]/100,s=i-t;let r=0;return s<1&&(r=(i-s)/(1-s)),[n[0],s*100,r*100]};Me.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};Me.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};Me.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};Me.gray.hsl=function(n){return[0,0,n[0]]};Me.gray.hsv=Me.gray.hsl;Me.gray.hwb=function(n){return[0,100,n[0]]};Me.gray.cmyk=function(n){return[0,0,0,n[0]]};Me.gray.lab=function(n){return[n[0],0,0]};Me.gray.hex=function(n){const t=Math.round(n[0]/100*255)&255,i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(i.length)+i};Me.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};function Abe(){const n={},t=Object.keys(Me);for(let{length:e}=t,i=0;i<e;i++)n[t[i]]={distance:-1,parent:null};return n}function Cbe(n){const t=Abe(),e=[n];for(t[n].distance=0;e.length>0;){const i=e.pop(),s=Object.keys(Me[i]);for(let{length:r}=s,o=0;o<r;o++){const a=s[o],l=t[a];l.distance===-1&&(l.distance=t[i].distance+1,l.parent=i,e.unshift(a))}}return t}function kbe(n,t){return function(e){return t(n(e))}}function Ibe(n,t){const e=[t[n].parent,n];let i=Me[t[n].parent][n],s=t[n].parent;for(;t[s].parent;)e.unshift(t[s].parent),i=kbe(Me[t[s].parent][s],i),s=t[s].parent;return i.conversion=e,i}function Pbe(n){const t=Cbe(n),e={},i=Object.keys(t);for(let{length:s}=i,r=0;r<s;r++){const o=i[r];t[o].parent!==null&&(e[o]=Ibe(o,t))}return e}const wp={},Mbe=Object.keys(Me);function Obe(n){const t=function(...e){const i=e[0];return i==null?i:(i.length>1&&(e=i),n(e))};return"conversion"in n&&(t.conversion=n.conversion),t}function Dbe(n){const t=function(...e){const i=e[0];if(i==null)return i;i.length>1&&(e=i);const s=n(e);if(typeof s=="object")for(let{length:r}=s,o=0;o<r;o++)s[o]=Math.round(s[o]);return s};return"conversion"in n&&(t.conversion=n.conversion),t}for(const n of Mbe){wp[n]={},Object.defineProperty(wp[n],"channels",{value:Me[n].channels}),Object.defineProperty(wp[n],"labels",{value:Me[n].labels});const t=Pbe(n),e=Object.keys(t);for(const i of e){const s=t[i];wp[n][i]=Dbe(s),wp[n][i].raw=Obe(s)}}/** 464 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 465 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 466 */class tr extends er{constructor(e=[]){super(e,{idProperty:"viewUid"});y(this,"_parentElement");this.on("add",(i,s,r)=>{this._renderViewIntoCollectionParent(s,r)}),this.on("remove",(i,s)=>{s.element&&this._parentElement&&s.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const i of this)this._renderViewIntoCollectionParent(i)}delegate(...e){if(!e.length||!Rbe(e))throw new ee("ui-viewcollection-delegate-wrong-events",this);return{to:i=>{for(const s of this)for(const r of e)s.delegate(r).to(i);this.on("add",(s,r)=>{for(const o of e)r.delegate(o).to(i)}),this.on("remove",(s,r)=>{for(const o of e)r.stopDelegating(o,i)})}}}_renderViewIntoCollectionParent(e,i){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[i])}remove(e){return super.remove(e)}}function Rbe(n){return n.every(t=>typeof t=="string")}const Lbe="http://www.w3.org/1999/xhtml";class ro extends Gt(){constructor(e){super();y(this,"ns");y(this,"tag");y(this,"text");y(this,"attributes");y(this,"children");y(this,"eventListeners");y(this,"_isRendered");y(this,"_revertData");Object.assign(this,qF(YF(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=JF(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new ee("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(i){if(i.children)for(const s of i.children)YE(s)?yield s:dO(s)&&(yield*e(s))}yield*e(this)}static bind(e,i){return{to(s,r){return new Fbe({eventNameOrFunction:s,attribute:s,observable:e,emitter:i,callback:r})},if(s,r,o){return new E4({observable:e,emitter:i,attribute:s,valueIfTrue:r,callback:o})}}}static extend(e,i){if(e._isRendered)throw new ee("template-extend-render",[this,e]);
466A4(e,qF(YF(i)))}_renderNode(e){let i;if(e.node?i=this.tag&&this.text:i=this.tag?this.text:!this.text,i)throw new ee("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let i=e.node;return i||(i=e.node=document.createElementNS(this.ns||Lbe,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),i}_renderText(e){let i=e.node;return i?e.revertData.text=i.textContent:i=e.node=document.createTextNode(""),U0(this.text)?this._bindToObservable({schema:this.text,updater:Bbe(i),data:e}):i.textContent=this.text.join(""),i}_renderAttributes(e){if(!this.attributes)return;const i=e.node,s=e.revertData;for(const r in this.attributes){const o=i.getAttribute(r),a=this.attributes[r];s&&(s.attributes[r]=o);const l=XF(a)?a[0].ns:null;if(U0(a)){const c=XF(a)?a[0].value:a;s&&ZF(r)&&c.unshift(o),this._bindToObservable({schema:c,updater:Vbe(i,r,l),data:e})}else if(r=="style"&&typeof a[0]!="string")this._renderStyleAttribute(a[0],e);else{s&&o&&ZF(r)&&a.unshift(o);const c=a.map(u=>u&&(u.value||u)).reduce((u,d)=>u.concat(d),[]).reduce(x4,"");_m(c)||i.setAttributeNS(l,r,c)}}}_renderStyleAttribute(e,i){const s=i.node;for(const r in e){const o=e[r];U0(o)?this._bindToObservable({schema:[o],updater:Hbe(s,r),data:i}):yI(r)?s.style.setProperty(r,o):s.style[r]=o}}_renderElementChildren(e){const i=e.node,s=e.intoFragment?document.createDocumentFragment():i,r=e.isApplying;let o=0;for(const a of this.children)if(hO(a)){if(!r){a.setParent(i);for(const l of a)s.appendChild(l.element)}}else if(YE(a))r||(a.isRendered||a.render(),s.appendChild(a.element));else if(Uc(a))s.appendChild(a);else if(r){const l=e.revertData,c=JF();l.children.push(c),a._renderNode({intoFragment:!1,node:s.childNodes[o++],isApplying:!0,revertData:c})}else s.appendChild(a.render());e.intoFragment&&i.appendChild(s)}_setUpListeners(e){if(this.eventListeners)for(const i in this.eventListeners){const s=this.eventListeners[i].map(r=>{const[o,a]=i.split("@");return r.activateDomEventListener(o,a,e)});e.revertData&&e.revertData.bindings.push(s)}}_bindToObservable({schema:e,updater:i,data:s}){const r=s.revertData;S4(e,i,s);const o=e.filter(a=>!_m(a)).filter(a=>a.observable).map(a=>a.activateAttributeListener(e,i,s));r&&r.bindings.push(o)}_revertTemplateFromNode(e,i){for(const r of i.bindings)for(const o of r)o();if(i.text){e.textContent=i.text;return}const s=e;for(const r in i.attributes){const o=i.attributes[r];o===null?s.removeAttribute(r):s.setAttribute(r,o)}for(let r=0;r<i.children.length;++r)this._revertTemplateFromNode(s.childNodes[r],i.children[r])}}class Ly{constructor(t){y(this,"attribute");y(this,"observable");y(this,"emitter");y(this,"callback");this.attribute=t.attribute,this.observable=t.observable,this.emitter=t.emitter,this.callback=t.callback}getValue(t){const e=this.observable[this.attribute];return this.callback?this.callback(e,t):e}activateAttributeListener(t,e,i){const s=()=>S4(t,e,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,s),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,s)}}}class Fbe extends Ly{constructor(e){super(e);y(this,"eventNameOrFunction");this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,i,s){const r=(o,a)=>{(!i||a.target.matches(i))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(a):this.observable.fire(this.eventNameOrFunction,a))};return this.emitter.listenTo(s.node,e,r),()=>{this.emitter.stopListening(s.node,e,r)}}}class E4 extends Ly{constructor(e){super(e);y(this,"valueIfTrue");this.valueIfTrue=e.valueIfTrue}getValue(e){const i=super.getValue(e);return _m(i)?!1:this.valueIfTrue||!0}}function U0(n){return n?(n.value&&(n=n.value),Array.isArray(n)?n.some(U0):n instanceof Ly):!1}function yI(n){return/^--[a-zA-Z_-][\w-]*$/.test(n)}function Nbe(n,t){return n.map(e=>e instanceof Ly?e.getValue(t):e)}function S4(n,t,{node:e}){const i=Nbe(n,e);let s;n.length==1&&n[0]instanceof E4?s=i[0]:s=i.reduce(x4,""),_m(s)?t.remove():t.set(s)}function Bbe(n){return{set(t){n.textContent=t},remove(){n.textContent=""}}}function Vbe(n,t,e){return{set(i){n.setAttributeNS(e,t,i)},remove(){n.removeAttributeNS(e,t)}}}function Hbe(n,t){return{set(e){yI(t)?n.style.setProperty(t,e):n.style[t]=e},remove(){yI(t)?n.style.removeProperty(t):n.style[t]=null}}}function YF(n){return GT(n,e=>{if(e&&(e instanceof Ly||dO(e)||YE(e)||hO(e)))return e})}function qF(n){if(typeof n=="string"?n=Wbe(n):n.text&&Ube(n),n.on&&(n.eventListeners=$be(n.on),delete n.on),!n.text){n.attributes&&zbe(n.attributes);const t=[];if(n.children)if(hO(n.children))t.push(n.children);else for(const e of n.children)dO(e)||YE(e)||Uc(e)?t.push(e):t.push(new ro(e));n.children=t}return n}function zbe(n){for(const t in n)n[t].value&&(n[t].value=bn(n[t].value)),T4(n,t)}function $be(n){for(const t in n)T4(n,t);return n}function Wbe(n){return{text:[n]}}function Ube(n){n.text=bn(n.text)}function T4(n,t){n[t]=bn(n[t])}function x4(n,t){return _m(t)?n:_m(n)?t:`${n} ${t}`}function KF(n,t){for(const e in t)n[e]?n[e].push(...t[e]):n[e]=t[e]}function A4(n,t){if(t.attributes&&(n.attributes||(n.attributes={}),KF(n.attributes,t.attributes)),t.eventListeners&&(n.eventListeners||(n.eventListeners={}),KF(n.eventListeners,t.eventListeners)),t.text&&n.text.push(...t.text),t.children&&t.children.length){if(n.children.length!=t.children.length)throw new ee("ui-template-extend-children-mismatch",n);let e=0;for(const i of t.children)A4(n.children[e++],i)}}function _m(n){return!n&&n!==0}function YE(n){return n instanceof Ye}function dO(n){return n instanceof ro}function hO(n){return n instanceof tr}function XF(n){return ys(n[0])&&n[0].ns}function JF(){return{children:[],bindings:[],attributes:{}}}function ZF(n){return n=="class"||n=="style"}class Ye extends Qs(Ut()){constructor(e){super();y(this,"element");y(this,"isRendered");y(this,"locale");y(this,"t");y(this,"template");y(this,"_viewCollections");y(this,"_unboundChildren");y(this,"_bindTemplate");this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new er,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(i,s)=>{s.locale=e,s.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=ro.bind(this,this)}createCollection(e){const i=new tr(e);return this._viewCollections.add(i),i}registerChild(e){qs(e)||(e=[e]);for(const i of e)this._unboundChildren.add(i)}deregisterChild(e){qs(e)||(e=[e]);for(const i of e)this._unboundChildren.remove(i)}setTemplate(e){this.template=new ro(e)}extendTemplate(e){ro.extend(this.template,e)}
466render(){if(this.isRendered)throw new ee("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}const QF={POLITE:"polite",ASSERTIVE:"assertive"};class jbe{constructor(t){y(this,"editor");y(this,"view");this.editor=t,t.once("ready",()=>{for(const e of Object.values(QF))this.announce("",e)})}announce(t,e=QF.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new Gbe(i.locale),i.ui.view.body.add(this.view));const{politeness:s,isUnsafeHTML:r}=typeof e=="string"?{politeness:e}:e;let o=this.view.regionViews.find(a=>a.politeness===s);o||(o=new Ybe(i,s),this.view.regionViews.add(o)),o.announce({announcement:t,isUnsafeHTML:r})}}class Gbe extends Ye{constructor(e){super(e);y(this,"regionViews");this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class Ybe extends Ye{constructor(e,i){super(e.locale);y(this,"politeness");y(this,"_domConverter");y(this,"_pruneAnnouncementsInterval");this.setTemplate({tag:"div",attributes:{"aria-live":i,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{this._pruneAnnouncementsInterval!==null&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=i,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:i}){if(!e.trim().length)return;const s=document.createElement("li");i?this._domConverter.setContentOf(s,e):s.innerText=e,this._listElement.appendChild(s)}get _listElement(){return this.element.querySelector("ul")}}/** 467 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 468 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 469 */function Fy({emitter:n,activator:t,callback:e,contextElements:i,listenerOptions:s}){n.listenTo(document,"mousedown",(r,o)=>{if(!t())return;const a=typeof o.composedPath=="function"?o.composedPath():[],l=typeof i=="function"?i():i;for(const c of l)if(c.contains(o.target)||a.includes(c))return;e()},s)}/** 470 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 471 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 472 */function qE(n){class t extends n{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...i){super(...i),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return t}function qbe(n){class t extends n{constructor(...s){super(...s);y(this,"_onDragBound",this._onDrag.bind(this));y(this,"_onDragEndBound",this._onDragEnd.bind(this));y(this,"_lastDraggingCoordinates",{x:0,y:0});this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(Ie.document,"mouseup",this._onDragEndBound),this.listenTo(Ie.document,"touchend",this._onDragEndBound),this.listenTo(Ie.document,"mousemove",this._onDragBound),this.listenTo(Ie.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(Ie.document,"mouseup",this._onDragEndBound),this.stopListening(Ie.document,"touchend",this._onDragEndBound),this.stopListening(Ie.document,"mousemove",this._onDragBound),this.stopListening(Ie.document,"touchmove",this._onDragBound)}_onDragStart(s,r){if(!this._isHandleElementPressed(r))return;this._attachDragListeners();let o=0,a=0;r instanceof MouseEvent?(o=r.clientX,a=r.clientY):(o=r.touches[0].clientX,a=r.touches[0].clientY),this._lastDraggingCoordinates={x:o,y:a},this.isDragging=!0}_onDrag(s,r){if(!this.isDragging){this._detachDragListeners();return}let o=0,a=0;r instanceof MouseEvent?(o=r.clientX,a=r.clientY):(o=r.touches[0].clientX,a=r.touches[0].clientY),r.preventDefault(),this.fire("drag",{deltaX:Math.round(o-this._lastDraggingCoordinates.x),deltaY:Math.round(a-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:o,y:a}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(s){return this.dragHandleElement?this.dragHandleElement===s.target||s.target instanceof HTMLElement&&this.dragHandleElement.contains(s.target):!1}}return t}/** 473 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 474 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 475 */function JT({view:n}){n.listenTo(n.element,"submit",(t,e)=>{e.preventDefault(),n.fire("submit")},{useCapture:!0})}/** 476 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 477 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 478 */function Kbe({keystrokeHandler:n,focusTracker:t,gridItems:e,numberOfColumns:i,uiLanguageDirection:s}){const r=typeof i=="number"?()=>i:i;n.set("arrowright",o((c,u)=>s==="rtl"?l(c,u.length):a(c,u.length))),n.set("arrowleft",o((c,u)=>s==="rtl"?a(c,u.length):l(c,u.length))),n.set("arrowup",o((c,u)=>{let d=c-r();return d<0&&(d=c+r()*Math.floor(u.length/r()),d>
478u.length-1&&(d-=r())),d})),n.set("arrowdown",o((c,u)=>{let d=c+r();return d>u.length-1&&(d=c%r()),d}));function o(c){return u=>{const d=e.find(p=>p.element===t.focusedElement),h=e.getIndex(d),f=c(h,e);e.get(f).focus(),u.stopPropagation(),u.preventDefault()}}function a(c,u){return c===u-1?0:c+1}function l(c,u){return c===0?u-1:c-1}}class ZT extends Ye{constructor(e){super(e);y(this,"id");this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${is()}`;const i=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:i.to("for")},children:[{text:i.to("text")}]})}}class Xbe extends Ye{constructor(t,e){super(t);const i=t.t,s=new ZT;s.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":s.id,role:"document",tabindex:-1},children:[Rr(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(e.values())),s]})}focus(){this.element.focus()}_createCategories(t){return t.map(e=>{const i=[Rr(document,"h3",{},e.label),...Array.from(e.groups.values()).map(s=>this._createGroup(s)).flat()];return e.description&&i.splice(1,0,Rr(document,"p",{},e.description)),Rr(document,"section",{},i)})}_createGroup(t){const e=t.keystrokes.sort((s,r)=>s.label.localeCompare(r.label)).map(s=>this._createGroupRow(s)).flat(),i=[Rr(document,"dl",{},e)];return t.label&&i.unshift(Rr(document,"h4",{},t.label)),i}_createGroupRow(t){const e=this.locale.t,i=Rr(document,"dt"),s=Rr(document,"dd"),r=Zbe(t.keystroke),o=[];for(const a of r)o.push(a.map(Jbe).join(""));return i.innerHTML=t.label,s.innerHTML=o.join(", ")+(t.mayRequireFn&&Ge.isMac?` ${e("(may require <kbd>Fn</kbd>)")}`:""),[i,s]}}function Jbe(n){return zE(n).split("+").map(t=>`<kbd>${t}</kbd>`).join("+")}function Zbe(n){return typeof n=="string"?[[n]]:typeof n[0]=="string"?[n]:n}const US=class US extends Ye{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",t.if("isVisible","ck-hidden",e=>!e),"ck-reset_all-excluded",t.if("isColorInherited","ck-icon_inherit-color")],viewBox:t.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!e)throw new ee("ui-iconview-invalid-svg",this);const i=e.getAttribute("viewBox");i&&(this.viewBox=i);for(const{name:s,value:r}of Array.from(e.attributes))US.presentationalAttributeNames.includes(s)&&this.element.setAttribute(s,r);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}};y(US,"presentationalAttributeNames",["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode
478-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"]);let ea=US;class C4 extends Ye{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:t.to("style"),id:t.to("id")},children:[{text:t.to("text")}]})}}class pt extends Ye{constructor(e,i=new C4){super(e);y(this,"children");y(this,"labelView");y(this,"iconView");y(this,"keystrokeView");y(this,"_focusDelayed",null);const s=this.bindTemplate,r=is();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${r}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(i),this.iconView=new ea,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const o={tag:"button",attributes:{class:["ck","ck-button",s.to("class"),s.if("isEnabled","ck-disabled",a=>!a),s.if("isVisible","ck-hidden",a=>!a),s.to("isOn",a=>a?"ck-on":"ck-off"),s.if("withText","ck-button_with-text"),s.if("withKeystroke","ck-button_with-keystroke")],role:s.to("role"),type:s.to("type",a=>a||"button"),tabindex:s.to("tabindex"),"aria-checked":s.to("_ariaChecked"),"aria-pressed":s.to("_ariaPressed"),"aria-label":s.to("ariaLabel"),"aria-labelledby":s.to("ariaLabelledBy"),"aria-disabled":s.if("isEnabled",!0,a=>!a),"data-cke-tooltip-text":s.to("_tooltipString"),"data-cke-tooltip-position":s.to("tooltipPosition")},children:this.children,on:{click:s.to(a=>{this.isEnabled?this.fire("execute"):a.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(a,l,c)=>!l||eN(c)?!1:String(!!a)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(a,l,c)=>!l||!eN(c)?!1:String(!!a)),Ge.isSafari&&(this._focusDelayed||(this._focusDelayed=qM(()=>this.focus(),0)),o.on.mousedown=s.to(()=>{this._focusDelayed()}),o.on.mouseup=s.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(o)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,i,s,r)=>{s&&!r?this.children.add(this.iconView,0):!s&&r&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new Ye;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",i=>zE(i))}]}),e}_getTooltipString(e,i,s){return e?typeof e=="string"?e:(s&&(s=zE(s)),e instanceof Function?e(i,s):`${i}${s?` (${s})`:""}`):""}}function eN(n){switch(n){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class Lm extends Ye{constructor(e,i={}){super(e);y(this,"children");y(this,"iconView");const s=this.bindTemplate;this.set("label",i.label||""),this.set("class",i.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",s.to("class")]},children:this.children}),i.icon&&(this.iconView=new ea,this.iconView.content=i.icon,this.children.add(this.iconView));const r=new Ye(e);r.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:s.to("label")}]}),this.children.add(r)}}class po extends Gt(){constructor(e){super();y(this,"focusables");y(this,"focusTracker");y(this,"keystrokeHandler");y(this,"actions");
478if(this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const i in e.actions){let s=e.actions[i];typeof s=="string"&&(s=[s]);for(const r of s)e.keystrokeHandler.set(r,(o,a)=>{this[i](),a()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(AA)||null}get last(){return this.focusables.filter(AA).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((i,s)=>{const r=i.element===this.focusTracker.focusedElement;return r&&(e=s),r}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const i=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",s=>{const r=i();this.focusNext(),r!==i()&&s.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",s=>{const r=i();this.focusPrevious(),r!==i()&&s.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,i){e&&this.focusTracker.focusedElement!==e.element&&e.focus(i)}_getDomFocusableItem(e){const i=this.focusables.length;if(!i)return null;const s=this.current;if(s===null)return this[e===1?"first":"last"];let r=this.focusables.get(s),o=(s+i+e)%i;do{const a=this.focusables.get(o);if(AA(a)){r=a;break}o=(o+i+e)%i}while(o!==s);return r}}function AA(n){return Ny(n)&&wl(n.element)}function Ny(n){return"focus"in n&&typeof n.focus=="function"}function Qbe(n){return Ny(n)&&"focusCycler"in n&&n.focusCycler instanceof po}class ewe extends Ye{constructor(e){super(e);y(this,"children");y(this,"keystrokes");y(this,"focusCycler");y(this,"_focusTracker");y(this,"_focusables");this.children=this.createCollection(),this.keystrokes=new rs,this._focusTracker=new fi,this._focusables=new tr,this.focusCycler=new po({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const i of e){const s=new pt(this.locale);let r;s.on("execute",()=>i.onExecute()),i.onCreate&&i.onCreate(s);for(r in i)r!="onExecute"&&r!="onCreate"&&s.set(r,i[r]);this.children.add(s)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class twe extends Ye{constructor(e){super(e);y(this,"children");this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const Pr={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},tN=Ry("px"),jS=class jS extends qbe(Ye){constructor(e,{getCurrentDomRoot:i,getViewportOffset:s,keystrokeHandlerOptions:r}){super(e);y(this,"parts");y(this,"headerView");y(this,"closeButtonView");y(this,"actionsView");y(this,"contentView");y(this,"keystrokes");y(this,"focusTracker");y(this,"wasMoved",!1);y(this,"_getCurrentDomRoot");y(this,"_getViewportOffset");y(this,"_focusables");y(this,"_focusCycler");const o=this.bindTemplate,a=e.t;this.set("className",""),this.set("ariaLabel",a("Editor dialog")),this.set("isModal",!1),this.set("position",Pr.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=i,this._getViewportOffset=s,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new rs,this.focusTracker=new fi,this._focusables=new tr,this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:r}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",o.if("isModal","ck-dialog-overlay__transparent",l=>!l),o.if("_isVisible","ck-hidden",l=>!l)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",o.if("isModal","ck-dialog_modal"),o.to("className")],role:"dialog","aria-label":o.to("ariaLabel"),style:{to
478p:o.to("_top",l=>tN(l)),left:o.to("_left",l=>tN(l)),visibility:o.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,i)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),i())}),this.on("drag",(e,{deltaX:i,deltaY:s})=>{this.wasMoved=!0,this.moveBy(i,s)}),this.listenTo(Ie.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(Ie.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,i,s)=>{s&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:i,hasCloseButton:s=!0,content:r,actionButtons:o}){i&&(this.headerView=new Lm(this.locale,{icon:e}),s&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=i,this.ariaLabel=i,this.parts.add(this.headerView,0)),r&&(r instanceof Ye&&(r=[r]),this.contentView=new twe(this.locale),this.contentView.children.addMany(r),this.parts.add(this.contentView)),o&&(this.actionsView=new ewe(this.locale),this.actionsView.setButtons(o),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,i){const s=this._getViewportRect(),r=this._getDialogRect();e+r.width>s.right&&(e=s.right-r.width),e<s.left&&(e=s.left),i<s.top&&(i=s.top),this._moveTo(e,i)}_moveTo(e,i){this._left=e,this._top=i}moveBy(e,i){this.moveTo(this._left+e,this._top+i)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;const e=this._getViewportRect();let i=this.position,s;this._getCurrentDomRoot()?s=this._getVisibleDomRootRect(e):i=Pr.SCREEN_CENTER;const r=jS.defaultOffset,o=this._getDialogRect();if(this.position!=null){if(typeof this.position=="function"){const a=this.position(o,s);if(a==null){this._moveOffScreen();return}this._moveTo(a.left,a.top);return}switch(i){case Pr.EDITOR_TOP_SIDE:{if(s){const a=this.locale.contentLanguageDirection==="ltr"?s.right-o.width-r:s.left+r;this.moveTo(a,s.top+r)}else this._moveOffScreen();break}case Pr.EDITOR_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-o.width/2),Math.round(s.top+s.height/2-o.height/2)):this._moveOffScreen();break}case Pr.SCREEN_CENTER:{this.moveTo(Math.round((e.width-o.width)/2),Math.round((e.height-o.height)/2));break}case Pr.EDITOR_TOP_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-o.width/2),s.top+r):this._moveOffScreen();break}case Pr.EDITOR_BOTTOM_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-o.width/2),s.bottom-o.height-r):this._moveOffScreen();break}case Pr.EDITOR_ABOVE_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-o.width/2),s.top-o.height-r):this._moveOffScreen();break}case Pr.EDITOR_BELOW_CENTER:{s?this.moveTo(Math.round(s.left+s.width/2-o.width/2),s.bottom+r):this._moveOffScreen();break}}}}_getVisibleDomRootRect(e){let i=new tt(this._getCurrentDomRoot()).getVisible();if(i){if(i=e.getIntersection(i),!i)return null}else return null;return i}_getDialogRect(){return new tt(this.element.firstElementChild)}_getViewportRect(){const e=new tt(Ie.window);return this.isModal?e:dW(this._getViewportOffset())}_updateFocusCyclableItems(){const e=[];if(this.contentView)for(const i of this.contentView.children)Ny(i)&&e.push(i);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(i=>{this._focusables.add(i),this.focusTracker.add(i.element),Qbe(i)&&this._focusCycler.chain(i.focusCycler)})}_createCloseButton(){const e=new pt(this.locale),i=this.locale.t;return e.set({label:i("Close"),tooltip:!0,icon:Ype}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}};y(jS,"defaultOffset",15);let Kb=jS;const Or=class Or extends we{constructor(e){super(e);y(this,"view");y(this,"_onHide");const i=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:i("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),Or._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,i)=>{this._show(i)}),this.on("show",(e,i)=>{i.onShow&&i.onShow(this)},{priority:"low"}),this.on("hide",()=>{Or._visibleDialogPlugin&&Or._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",(i,s)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),s())})}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;
478const i=e.document.differ.getChangedRoots();for(const s of i)s.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:i,title:s,hasCloseButton:r=!0,content:o,actionButtons:a,className:l,isModal:c,position:u,onHide:d,keystrokeHandlerOptions:h}){const f=this.editor;this.view=new Kb(f.locale,{getCurrentDomRoot:()=>f.editing.view.getDomRoot(f.model.document.selection.anchor.root.rootName),getViewportOffset:()=>f.ui.viewportOffset,keystrokeHandlerOptions:h});const p=this.view;p.on("close",()=>{this.hide()}),f.ui.view.body.add(p),f.keystrokes.listenTo(p.element),u||(u=c?Pr.SCREEN_CENTER:Pr.EDITOR_CENTER),c&&this._lockBodyScroll(),p.set({position:u,_isVisible:!0,className:l,isModal:c}),p.setupParts({icon:i,title:s,hasCloseButton:r,content:o,actionButtons:a}),this.id=e,d&&(this._onHide=d),this.isOpen=!0,Or._visibleDialogPlugin=this}hide(){Or._visibleDialogPlugin&&Or._visibleDialogPlugin.fire(`hide:${Or._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,i=this.view;i.isModal&&this._unlockBodyScroll(),i.contentView&&i.contentView.reset(),e.ui.view.body.remove(i),e.ui.focusTracker.remove(i.element),e.keystrokes.stopListening(i.element),i.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,Or._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}};y(Or,"_visibleDialogPlugin");let _I=Or;class Fm extends pt{constructor(e,i=new C4){super(e,i);y(this,"_checkIconHolderView",new nwe);this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const s=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",s.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(r,o)=>r||o)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,i,s)=>{const{children:r,_checkIconHolderView:o}=this;s?r.add(o,0):r.remove(o)})}}class nwe extends Ye{constructor(){super();y(this,"children");y(this,"_checkIconView",this._createCheckIconView());const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",i=>i?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,i,s)=>{const{children:r,_checkIconView:o}=this;s&&!r.has(o)?r.add(o):!s&&r.has(o)&&r.remove(o)})}_createCheckIconView(){const e=new ea;return e.content=Kpe,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class Cr extends Fm{constructor(t){super(t),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class iwe extends we{constructor(){super(...arguments);y(this,"contentView",null)}static get requires(){return[_I]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{const s=this._createButton(pt);return s.set({tooltip:!0,withText:!1,label:i("Accessibility help")}),s}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{const s=this._createButton(Cr);return s.label=i("Accessibility"),s}),e.keystrokes.set("Alt+0",(s,r)=>{this._toggleDialog(),r()}),this._setupRootLabels()}_createButton(e){const i=this.editor,s=i.plugins.get("Dialog"),r=i.locale,o=new e(r);return o.set({keystroke:"Alt+0",icon:WF,isToggleable:!0}),o.on("execute",()=>this._toggleDialog()),o.bind("isOn").to(s,"id",a=>a==="accessibilityHelp"),o}_setupRootLabels(){const e=this.editor,i=e.editing.view,s=e.t;e.ui.on("ready",()=>{i.change(o=>{for(const a of i.document.roots)r(o,a)}),e.on("addRoot",(o,a)=>{const l=e.editing.view.document.getRoot(a.rootName);i.change(c=>r(c,l))},{priority:"low"})});function r(o,a){const c=[a.getAttribute("aria-label"),s("Press %0 for help.",[zE("Alt+0")])].filter(u=>u).join(". ");o.setAttribute("aria-label",c,a)}}_toggleDialog(){const e=this.editor,i=e.plugins.get("Dialog"),s=e.locale.t;this.contentView||(this.contentView=new Xbe(e.locale,e.accessibility.keystrokeInfos)),i.id==="accessibilityHelp"?i.hide():i.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:s("Accessibility help"),icon:WF,hasCloseButton:!0,content:this.contentView})}}const ur=class ur extends tr{constructor(e,i=[]){super(i);y(this,"locale");y(this,"_bodyCollectionContainer");this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new ro({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!ur._bodyWrapper||!ur._bodyWrapper.isConnected)&&(ur._bodyWrapper=Rr(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(ur._bodyWrapper)),ur._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),ur._bodyWrapper&&!ur._bodyWrapper.childElementCount&&(ur._bodyWrapper.remove(),delete ur._bodyWrapper)}};y(ur,"_bodyWrapper");let EI=ur;const nN=Ry("px"),swe={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}
478},xs=class xs extends Ye{constructor(e){super(e);y(this,"content");y(this,"_pinWhenIsVisibleCallback");y(this,"_resizeObserver");const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",i.to("position",s=>`ck-balloon-panel_${s}`),i.if("isVisible","ck-balloon-panel_visible"),i.if("withArrow","ck-balloon-panel_with-arrow"),i.to("class")],style:{top:i.to("top",nN),left:i.to("left",nN)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const i=j0(e.target);if(i&&!wl(i))return!1;this.show();const s=xs.defaultPositions,r=Object.assign({},{element:this.element,positions:[s.southArrowNorth,s.southArrowNorthMiddleWest,s.southArrowNorthMiddleEast,s.southArrowNorthWest,s.southArrowNorthEast,s.northArrowSouth,s.northArrowSouthMiddleWest,s.northArrowSouthMiddleEast,s.northArrowSouthWest,s.northArrowSouthEast,s.viewportStickyNorth],limiter:Ie.document.body,fitInViewport:!0},e),o=xs._getOptimalPosition(r)||swe,a=parseInt(o.left),l=parseInt(o.top),c=o.name,u=o.config||{},{withArrow:d=!0}=u;return this.top=l,this.left=a,this.position=c,this.withArrow=d,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let i=j0(e.target);const s=e.limiter?j0(e.limiter):Ie.document.body;if(this.listenTo(Ie.document,"scroll",(r,o)=>{const a=o.target,l=i&&a.contains(i),c=s&&a.contains(s);(l||c||!i||!s)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(Ie.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(i&&mn(i)&&(i=i.parentElement),i)){const r=()=>{wl(i)||this.unpin()};this._resizeObserver=new WM(i,r)}return!0}_stopPinning(){this.stopListening(Ie.document,"scroll"),this.stopListening(Ie.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:i=xs.arrowSideOffset,heightOffset:s=xs.arrowHeightOffset,stickyVerticalOffset:r=xs.stickyVerticalOffset,config:o}=e;return{northWestArrowSouthWest:(c,u)=>({top:a(c,u),left:c.left-i,name:"arrow_sw",...o&&{config:o}}),northWestArrowSouthMiddleWest:(c,u)=>({top:a(c,u),left:c.left-u.width*.25-i,name:"arrow_smw",...o&&{config:o}}),northWestArrowSouth:(c,u)=>({top:a(c,u),left:c.left-u.width/2,name:"arrow_s",...o&&{config:o}}),northWestArrowSouthMiddleEast:(c,u)=>({top:a(c,u),left:c.left-u.width*.75+i,name:"arrow_sme",...o&&{config:o}}),northWestArrowSouthEast:(c,u)=>({top:a(c,u),left:c.left-u.width+i,name:"arrow_se",...o&&{config:o}}),northArrowSouthWest:(c,u)=>({top:a(c,u),left:c.left+c.width/2-i,name:"arrow_sw",...o&&{config:o}}),northArrowSouthMiddleWest:(c,u)=>({top:a(c,u),left:c.left+c.width/2-u.width*.25-i,name:"arrow_smw",...o&&{config:o}}),northArrowSouth:(c,u)=>({top:a(c,u),left:c.left+c.width/2-u.width/2,name:"arrow_s",...o&&{config:o}}),northArrowSouthMiddleEast:(c,u)=>({top:a(c,u),left:c.left+c.width/2-u.width*.75+i,name:"arrow_sme",...o&&{config:o}}),northArrowSouthEast:(c,u)=>({top:a(c,u),left:c.left+c.width/2-u.width+i,name:"arrow_se",...o&&{config:o}}),northEastArrowSouthWest:(c,u)=>({top:a(c,u),left:c.right-i,name:"arrow_sw",...o&&{config:o}}),northEastArrowSouthMiddleWest:(c,u)=>({top:a(c,u),left:c.right-u.width*.25-i,name:"arrow_smw",...o&&{config:o}}),northEastArrowSouth:(c,u)=>({top:a(c,u),left:c.right-u.width/2,name:"arrow_s",...o&&{config:o}}),northEastArrowSouthMiddleEast:(c,u)=>({top:a(c,u),left:c.right-u.width*.75+i,name:"arrow_sme",...o&&{config:o}}),northEastArrowSouthEast:(c,u)=>({top:a(c,u),left:c.right-u.width+i,name:"arrow_se",...o&&{config:o}}),southWestArrowNorthWest:c=>({top:l(c),left:c.left-i,name:"arrow_nw",...o&&{config:o}}),southWestArrowNorthMiddleWest:(c,u)=>({top:l(c),left:c.left-u.width*.25-i,name:"arrow_nmw",...o&&{config:o}}),southWestArrowNorth:(c,u)=>({top:l(c),left:c.left-u.width/2,name:"arrow_n",...o&&{config:o}}),southWestArrowNorthMiddleEast:(c,u)=>({top:l(c),left:c.left-u.width*.75+i,name:"arrow_nme",...o&&{config:o}}),southWestArrowNorthEast:(c,u)=>({top:l(c),left:c.left-u.width+i,name:"arrow_ne",...o&&{config:o}}),southArrowNorthWest:c=>({top:l(c),left:c.left+c.width/2-i,name:"arrow_nw",...o&&{config:o}}),southArrowNorthMiddleWest:(c,u)=>({top:l(c),left:c.left+c.width/2-u.width*.25-i,name:"arrow_nmw",...o&&{config:o}}),southArrowNorth:(c,u)=>({top:l(c),left:c.left+c.width/2-u.width/2,name:"arrow_n",...o&&{config:o}}),southArrowNorthMiddleEast:(c,u)=>({top:l(c),left:c.left+c.width/2-u.width*.75+i,name:"arrow_nme",...o&&{config:o}}),southArrowNorthEast:(c,u)=>({top:l(c),left:c.left+c.width/2-u.width+i,name:"arrow_ne",...o&&{config:o}}),southEastArrowNorthWest:c=>({top:l(c),left:c.right-i,name:"arrow_nw",...o&&{config:o}}),southEastArrowNorthMiddleWest:(c,u)=>({top:l(c),left:c.right-u.width*.25-i,name:"arrow_nmw",...o&&{config:o}}),southEastArrowNorth:(c,u)=>({top:l(c),left:c.right-u.width/2,name:"arrow_n",...o&&{config:o}}),southEastArrowNorthMiddleEast:(c,u)=>({top:l(c),left:c.right-u.width*.75+i,name:"arrow_nme",...o&&{config:o}}),southEastArrowNorthEast:(c,u)=>({top:l(c),left:c.right-u.width+i,name:"arrow_ne",...o&&{config:o}}),westArrowEast:(c,u)=>({top:c.top+c.height/2-u.height/2,left:c.left-u.width-s,name:"arrow_e",...o&&{config:o}}),eastArrowWest:(c,u)=>({top:c.top+c.height/2-u.height/2,left:c.right+s,name:"arrow_w",...o&&{config:o}}),viewportStickyNorth:(c,u,d)=>{const h=new tt(Ie.document.body).getIntersection(d.getVisible());if(!h)return null;const f=h.getVisible();return!c.getIntersection(f)||!(f.top-c.top-r<u.height&&f.bottom-c.bottom<u.height)?null:{top:f.top+r,left:c.left+c.width/2-u.width/2,name:"arrowless",config:{withArrow:!1,...o}}}};function a(c,u){return c.top-u.height-s}function l(c){return c.bottom+s}}};y(xs,"arrowSideOffset",25),y(xs,"arrowHeightOffset",10),y(xs,"stickyVerticalOffset",20),y(xs,"_getOptimalPosition",UM),y(xs,"defaultPositions",xs.generatePositions());let jc=xs;function j0(n){return Wc(n)?n:YT(n)?n.commonAncestorContainer:typeof n=="function"?j0(n()):null}const rwe=50,owe=350;class k4 extends Qs(){constructor(e,i={}){super();y(this,"editor");y(this,"_balloonView",null);y(this,"_showBalloonThrottled",Vb(()=>this._showBalloon(),50,{leading:!0}));y(this,"_lastFocusedEditableElement",null);y(this,"_balloonClass");this.editor=e,this._balloonClass=i.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(i,s,r)=>{this._updateLastFocusedEditableElement(),r?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(i,s,r)=>{this._updateLastFocusedEditableElement(),r&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,i=new jc,s=this._createBadgeContent();return i.content.add(s),this._balloonClass&&(i.class=this._balloonClass),e.ui.view.body.add(i),i}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),i=e.side==="right"?awe(this._lastFocusedEditableElement,e):lwe(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[i]}}_updateLastFocusedEditableElement(){const e=this.editor,i=e.ui.focusTracker.isFocused,s=e.ui.focusTracker.focusedElement;if(!i||!s){this._lastFocusedEditableElement=null;return}const r=Array.from(e.ui.getEditableElementsNames()).map(o=>e.ui.getEditableElement(o));r.includes(s)?this._lastFocusedEditableElement=s:this._lastFocusedEditableElement=r[0]}}function awe(n,t){return I4(n,t,(e,i)=>e.left+e.width-i.width-t.horizontalOffset)}function lwe(n,t){return I4(n,t,e=>e.left+t.horizontalOffset)}function I4(n,t,e){return(i,s)=>{const r=new tt(n);if(r.width<owe||r.height<rwe)return null;let o;t.position==="inside"?o=r.bottom-s.height:o=r.bottom-s.height/2,o-=t.verticalOffset;const a=e(r,s),c=i.clone().moveTo(a,o).getIntersection(s.clone().moveTo(a,o)).getVisible();return!c||c.getArea()<s.getArea()?null:{top:o,left:a,name:`position_${t.position}-side_${t.side}`,config:{withArrow:!1}
478}}}const cwe="Powered by";class uwe extends k4{constructor(t){super(t,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){const t=this.editor;if(t.config.get("ui.poweredBy.forceVisible"))return!0;const i=t.config.get("licenseKey");if(i=="GPL")return!0;const s=KM(i.split(".")[1]);return s?!s.whiteLabel:!0}_createBadgeContent(){return new dwe(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){const t=super._getNormalizedConfig(),e=this.editor.config.get("ui.poweredBy")||{},i=e.position||t.position,s=i==="inside"?5:t.verticalOffset;return{position:i,side:e.side||t.side,label:e.label===void 0?cwe:e.label,verticalOffset:e.verticalOffset!==void 0?e.verticalOffset:s,horizontalOffset:e.horizontalOffset!==void 0?e.horizontalOffset:t.horizontalOffset,forceVisible:!!e.forceVisible}}}class dwe extends Ye{constructor(t,e){super(t);const i=new ea,s=this.bindTemplate;i.set({content:fbe,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...e?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[e]}]:[],i],on:{dragstart:s.to(r=>r.preventDefault())}}]})}}class QT extends pt{constructor(e){super(e);y(this,"toggleSwitchView");this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Ye;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class iN extends P4(pt){}class hwe extends P4(Fm){}function P4(n){class t extends n{constructor(...s){super(...s);y(this,"_fileInputView");this._fileInputView=new fwe(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return t}class fwe extends Ye{constructor(t){super(t),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{var i,s;(s=(i=this.element)==null?void 0:i.files)!=null&&s.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class gwe extends Ye{constructor(e,i){super(e);y(this,"buttonView");y(this,"children");const s=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),i&&this.children.addMany(i),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",s.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:s.if("isCollapsed","hidden"),"aria-labelledby":s.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new pt(this.locale),i=e.bindTemplate;return e.set({withText:!0,icon:XT}),e.extendTemplate({attributes:{"aria-expanded":i.to("isOn",s=>String(s))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",s=>!s),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}class KE extends Ye{constructor(e,i){super(e);y(this,"fieldView");y(this,"labelView");y(this,"statusView");y(this,"fieldWrapperChildren");const s=`ck-labeled-field-view-${is()}`,r=`ck-labeled-field-view-status-${is()}`;this.fieldView=i(this,s,r),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(s),this.statusView=this._createStatusView(r),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(a,l)=>a||l);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",a=>!a),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focu
478sed"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const i=new ZT(this.locale);return i.for=e,i.bind("text").to(this,"label"),i}_createStatusView(e){const i=new Ye(this.locale),s=this.bindTemplate;return i.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",s.if("errorText","ck-labeled-field-view__status_error"),s.if("_statusText","ck-hidden",r=>!r)],id:e,role:s.if("errorText","alert")},children:[{text:s.to("_statusText")}]}),i}focus(e){this.fieldView.focus(e)}}class mwe extends Ye{constructor(e){super(e);y(this,"focusTracker");this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new fi,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const i=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",i.if("isFocused","ck-input_focused"),i.if("isEmpty","ck-input-text_empty"),i.if("hasError","ck-error")],id:i.to("id"),placeholder:i.to("placeholder"),tabindex:i.to("tabIndex"),readonly:i.to("isReadOnly"),"aria-invalid":i.if("hasError",!0),"aria-describedby":i.to("ariaDescribedById"),"aria-label":i.to("ariaLabel")},on:{input:i.to((...s)=>{this.fire("input",...s),this._updateIsEmpty()}),change:i.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,i,s)=>{this._setDomElementValue(s),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=pwe(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}}function pwe(n){return!n.value}class M4 extends mwe{constructor(t){super(t),this.set("inputMode","text");const e=this.bindTemplate;this.extendTemplate({attributes:{inputmode:e.to("inputMode")}})}}class bwe extends M4{constructor(t){super(t),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class wwe extends M4{constructor(t,{min:e,max:i,step:s}={}){super(t);const r=this.bindTemplate;this.set("min",e),this.set("max",i),this.set("step",s),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:r.to("min"),max:r.to("max"),step:r.to("step")}})}}class vwe extends Ye{constructor(e){super(e);y(this,"children");const i=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",i.to("position",s=>`ck-dropdown__panel_${s}`),i.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:i.to(s=>{const r=s.target;r instanceof Element&&r.tagName.toLocaleLowerCase()==="input"||s.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():Dt("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}const bf=class bf extends Ye{constructor(e,i,s){super(e);y(this,"buttonView");y(this,"panelView");y(this,"focusTracker");y(this,"keystrokes");y(this,"listView");y(this,"toolbarView");y(this,"menuView");const r=this.bindTemplate;this.buttonView=i,this.panelView=s,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new rs,this.focusTracker=new fi,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",r.to("class"),r.if("isEnabled","ck-disabled",o=>!o)],id:r.to("id"),"aria-describedby":r.to("ariaDescribedById")},children:[i,s]}),i.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":r.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(i,s,r)=>{if(r)if(this.panelPosition==="auto"){const o=bf._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const e=(i,s)=>{this.isOpen&&(this.isOpen=!1,s())};this.keystrokes.set("arrowdown",(i,s)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,s())}),this.keystrokes.set("arrowright",(i,s)=>{this.isOpen&&s()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:i,southEast:s,southWest:r,northEast:o,northWest:a,southMiddleEast:l,southMiddleWest:c,northMiddleEast:u,northMiddleWest:d}=bf.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[s,r,l,c,e,o,a,u,d,i]:[r,s,c,l,e,a,o,d,u,i]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}};y(bf,"defaultPanelPositions",{south:(e,i)=>({top:e.bottom,left:e.left-(i.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,i)=>({top:e.bottom,left:e.left-i.width+e.width,name:"sw"}),southMiddleEast:(e,i)=>({top:e.bottom,left:e.left-(i.width-e.width)/4,name:"sme"}),southMiddleWest:(e,i)=>({top:e.bottom,left:e.left-(i.width-e.width)*3/4,name:"smw"}),north:(e,i)=>({top:e.top-i.height,left:e.left-(i.width-e.width)/2,name:"n"}),northEast:(e,i)=>({top:e.top-i.height,left:e.left,name:"ne"}),northWest:(e,i)=>({top:e.top-i.height,left:e.left-i.width+e.width,name:"nw"}),northMiddleEast:(e,i)=>({top:e.top-i.height,left:e.left-(i.width-e.width)/4,name:"nme"}),northMiddleWest:(e,i)=>({top:e.top-i.height,left:e.left-(i.width-e.width)*3/4,name:"nmw"})}),y(bf,"_getOptimalPosition",UM);let SI=bf;class O4 extends pt{constructor(e){super(e);y(this,"arrowView");this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new ea;return e.content=XT,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class ho extends Ye{constructor(e){super(e);y(this,"children");const i=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",i.if("isVisible","ck-hidden",s=>!s)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class fO extends Ye{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class G0 extends Ye{constructor(e,i=new ZT){super(e);y(this,"labelView");y(this,"items");y(this,"children");const s=this.bindTemplate,r=new Nm(e);this.set({label:"",isVisible:!0}),this.labelView=i,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,r]),r.set({role:"group",ariaLabelledBy:i.id}),r.focusTracker.destroy(),r.keystrokes.destroy(),this.items=r.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",s.if("isVisible","ck-hidden",o=>!o)]},children:this.children})}focus(){if(this.items){const e=this.items.find(i=>!(i instanceof fO));e&&e.focus()}}}class Nm extends Ye{constructor(e){super(e);y(this,"focusables");y(this,"items");y(this,"focusTracker");y(this,"keystrokes");y(this,"_focusCycler");y(this,"_listItemGroupToChangeListeners",new WeakMap);const i=this.bindTemplate;this.focusables=new tr,this.items=this.createCollection(),this.focusTracker=new fi,this.keystrokes=new rs,this._focusCycler=new po({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:i.to("role"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof G0?this._registerFocusableItemsGroup(e):e instanceof ho&&this._registerFocusableListItem(e);this.items.on("change",(e,i)=>{for(const s of i.removed)s instanceof G0?this._deregisterFocusableItemsGroup(s):s instanceof ho&&this._deregisterFocusableListItem(s);for(const s of Array.from(i.added).reverse())s instanceof G0?this._registerFocusableItemsGroup(s,i.index):this._registerFocusableListItem(s,i.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,i){this.focusTracker.add(e.element),this.focusables.add(e,i)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(i,s)=>{for(const r of s.removed)this._deregisterFocusableListItem(r);for(const r of Array.from(s.added).reverse())this._registerFocusableListItem(r,this.items.getIndex(e)+s.index)}}
478_registerFocusableItemsGroup(e,i){Array.from(e.items).forEach((r,o)=>{const a=typeof i<"u"?i+o:void 0;this._registerFocusableListItem(r,a)});const s=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,s),e.items.on("change",s)}_deregisterFocusableItemsGroup(e){for(const i of e.items)this._deregisterFocusableListItem(i);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class D4 extends Ye{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class ywe extends Ye{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}/** 479 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 480 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 481 */function _we(n){return n.bindTemplate.to(t=>{t.target===n.element&&t.preventDefault()})}/** 482 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 483 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 484 */function R4(n){if(Array.isArray(n))return{items:n,removeItems:[]};const t={items:[],removeItems:[]};return n?{...t,...n}:t}const Ewe=(()=>({alignLeft:jpe,bold:g4,importExport:ebe,paragraph:cbe,plus:hbe,text:Ebe,threeVerticalDots:uO,pilcrow:dbe,dragIndicator:Jpe}))();class ex extends Ye{constructor(e,i){super(e);y(this,"options");y(this,"items");y(this,"focusTracker");y(this,"keystrokes");y(this,"itemsView");y(this,"children");y(this,"focusables");y(this,"_focusCycler");y(this,"_behavior");const s=this.bindTemplate,r=this.t;this.options=i||{},this.set("ariaLabel",r("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new fi,this.keystrokes=new rs,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new Swe(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o=e.uiLanguageDirection==="rtl";this._focusCycler=new po({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const a=["ck","ck-toolbar",s.to("class"),s.if("isCompact","ck-toolbar_compact"),s.if("isGrouping","ck-toolbar_grouping"),s.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&a.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:a,role:s.to("role"),"aria-label":s.to("ariaLabel"),style:{maxWidth:s.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:_we(this)}}),this._behavior=this.options.shouldGroupWhenFull?new rN(this):new sN(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",(e,i)=>{this.focusTracker.add(i)}),this.items.on("remove",(e,i)=>{this.focusTracker.remove(i)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,i,s){this.items.addMany(this._buildItemsFromConfig(e,i,s))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new rN(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new sN(this),this._behavior.render(this)))}_buildItemsFromConfig(e,i,s){const r=R4(e),o=s||r.removeItems;return this._cleanItemsConfiguration(r.items,i,o).map(l=>ys(l)?this._createNestedToolbarDropdown(l,i,o):l==="|"?new D4:l==="-"?new ywe:i.create(l)).filter(l=>!!l)}_cleanItemsConfiguration(e,i,s){const r=e.filter((o,a,l)=>o==="|"?!0:s.indexOf(o)!==-1?!1:o==="-"?this.options.shouldGroupWhenFull?(Dt("toolbarview-line-break-ignored-when-grouping-items",l),!1):!0:!ys(o)&&!i.has(o)?(Dt("toolbarview-item-unavailable",{item:o}),!1):!0);return this._cleanSeparatorsAndLineBreaks(r)}_cleanSeparatorsAndLineBreaks(e){const i=a=>a!=="-"&&a!=="|",s=e.length,r=e.findIndex(i);if(r===-1)return[];const o=s-e.slice().reverse().findIndex(i);return e.slice(r,o).filter((a,l,c)=>i(a)?!0:!(l>0&&c[l-1]===a))}_createNestedToolbarDropdown(e,i,s){let{label:r,icon:o,items:a,tooltip:l=!0,withText:c=!1}=e;if(a=this._cleanItemsConfiguration(a,i,s),!a.length)return null;const u=this.locale,d=hl(u);return r||Dt("toolbarview-nested-toolbar-dropdown-missing-label",e),d.class="ck-toolbar__nested-toolbar-dropdown",d.buttonView.set({label:r,tooltip:l,withText:!!c}),o!==!1?d.buttonView.icon=Ewe[o]||o||uO:d.buttonView.withText=!0,gO(d,()=>
484d.toolbarView._buildItemsFromConfig(a,i,s)),d}}class Swe extends Ye{constructor(e){super(e);y(this,"children");this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class sN{constructor(t){y(this,"type","static");t.isGrouping=!1,t.itemsView.children.bindTo(t.items).using(e=>e),t.focusables.bindTo(t.items).using(e=>Ny(e)?e:null)}render(){}destroy(){}}class rN{constructor(t){y(this,"type","dynamic");y(this,"view");y(this,"viewChildren");y(this,"viewFocusables");y(this,"viewItemsView");y(this,"viewFocusTracker");y(this,"viewLocale");y(this,"ungroupedItems");y(this,"groupedItems");y(this,"groupedItemsDropdown");y(this,"resizeObserver",null);y(this,"cachedPadding",null);y(this,"shouldUpdateGroupingOnNextResize",!1);y(this,"viewElement");this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.view.isGrouping=!0,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),t.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),t.children.on("change",this._updateFocusCyclableItems.bind(this)),t.items.on("change",(e,i)=>{const s=i.index,r=Array.from(i.added);for(const o of i.removed)s>=this.ungroupedItems.length?this.groupedItems.remove(o):this.ungroupedItems.remove(o);for(let o=s;o<s+r.length;o++){const a=r[o-s];o>this.ungroupedItems.length?this.groupedItems.add(a,o-this.ungroupedItems.length):this.ungroupedItems.add(a,o)}this._updateGrouping()})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const t=this.view;if(t.items.length){for(let e=0;e<t.items.length;e++){const i=[...t.items][e];this.ungroupedItems.add(i,e)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!wl(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new tt(t.lastChild),s=new tt(t);if(!this.cachedPadding){const r=Ie.window.getComputedStyle(t),o=e==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[o])}return e==="ltr"?i.right>s.right-this.cachedPadding:i.left<s.left+this.cachedPadding}_enableGroupingOnResize(){let t;this.resizeObserver=new WM(this.viewElement,e=>{(!t||t!==e.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new D4),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,i=hl(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=t.uiLanguageDirection==="ltr"?"sw":"se",gO(i,this.groupedItems),i.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:t.uiLanguageDirection==="rtl"?"se":"sw",icon:uO}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{Ny(t)&&this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class tx extends Ye{constructor(e,i){super(e);y(this,"children");y(this,"actionView");y(this,"arrowView");y(this,"keystrokes");y(this,"focusTracker");const s=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(i),this.arrowView=this._createArrowView(),this.keystrokes=new rs,this.focusTracker=new fi,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",s.to("class"),s.if("isVisible","ck-hidden",r=>!r),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,i)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),i())}),this.keystrokes.set("arrowleft",(e,i)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),i())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const i=e||new pt;return e||i.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),i.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),i.delegate("execute").to(this),i}_createArrowView(){const e=new pt,i=e.bindTemplate;return e.icon=XT,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":i.to("isOn"),"aria-haspopup":!0,"aria-expanded":i.to("isOn",s=>String(s))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function hl(n,t=O4){const e=typeof t=="function"?new t(n):t,i=new vwe(n),s=new SI(n,e,i);return e.bind("isEnabled").to(s),e instanceof tx?e.arrowView.bind("isOn").to(s,"isOpen"):e.bind("isOn").to(s,"isOpen"),Twe(s),s}function gO(n,t,e={}){n.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),n.isOpen?oN(n,t,e):n.once("change:isOpen",()=>oN(n,t,e),{priority:"highest"}),e.enableActiveItemFocusOnDropdownOpen&&L4(n,()=>n.toolbarView.items.find(i=>i.isOn))}function oN(n,t,e){const i=n.locale,s=i.t,r=n.toolbarView=new ex(i),o=typeof t=="function"?t():t;r.ariaLabel=e.ariaLabel||s("Dropdown toolbar"),e.maxWidth&&(r.maxWidth=e.maxWidth),e.class&&(r.class=e.class),e.isCompact&&(r.isCompact=e.isCompact),e.isVertical&&(r.isVertical=!0),o
484instanceof tr?r.items.bindTo(o).using(a=>a):r.items.addMany(o),n.panelView.children.add(r),n.focusTracker.add(r),r.items.delegate("execute").to(n)}function mO(n,t,e={}){n.isOpen?aN(n,t,e):n.once("change:isOpen",()=>aN(n,t,e),{priority:"highest"}),L4(n,()=>n.listView.items.find(i=>i instanceof ho?i.children.first.isOn:!1))}function aN(n,t,e){const i=n.locale,s=n.listView=new Nm(i),r=typeof t=="function"?t():t;s.ariaLabel=e.ariaLabel,s.role=e.role,N4(n,s.items,r,i),n.panelView.children.add(s),s.items.delegate("execute").to(n)}function L4(n,t){n.on("change:isOpen",()=>{if(!n.isOpen)return;const e=t();e&&(typeof e.focus=="function"?e.focus():Dt("ui-dropdown-focus-child-on-open-child-missing-focus",{view:e}))},{priority:Dc.low-10})}function Twe(n){xwe(n),Awe(n),Cwe(n),kwe(n),Iwe(n),Pwe(n)}function xwe(n){Fy({emitter:n,activator:()=>n.isRendered&&n.isOpen,callback:()=>{n.isOpen=!1},contextElements:()=>[n.element,...F4(n.focusTracker).filter(t=>!n.element.contains(t))]})}function F4(n){return[...n.elements,...n.externalViews.flatMap(t=>F4(t.focusTracker))]}function Awe(n){n.on("execute",t=>{t.source instanceof QT||(n.isOpen=!1)})}function Cwe(n){n.focusTracker.on("change:isFocused",(t,e,i)=>{i||!n.isOpen||(n.isOpen=!1)})}function kwe(n){n.keystrokes.set("arrowdown",(t,e)=>{n.isOpen&&(n.panelView.focus(),e())}),n.keystrokes.set("arrowup",(t,e)=>{n.isOpen&&(n.panelView.focusLast(),e())})}function Iwe(n){n.on("change:isOpen",(t,e,i)=>{if(i)return;n.focusTracker.elements.some(r=>r.contains(Ie.document.activeElement))&&n.buttonView.focus()})}function Pwe(n){n.on("change:isOpen",(t,e,i)=>{i&&n.panelView.focus()},{priority:"low"})}function N4(n,t,e,i){Mwe(t),t.bindTo(e).using(s=>{if(s.type==="separator")return new fO(i);if(s.type==="group"){const r=new G0(i);return r.set({label:s.label}),N4(n,r.items,s.items,i),r.items.delegate("execute").to(n),r}else if(s.type==="button"||s.type==="switchbutton"){const r=s.model.role==="menuitemcheckbox"||s.model.role==="menuitemradio",o=new ho(i);let a;return s.type==="button"?(a=new Fm(i,s.labelView),a.set({isToggleable:r})):a=new QT(i),a.bind(...Object.keys(s.model)).to(s.model),a.delegate("execute").to(o),o.children.add(a),o}return null})}function Mwe(n){let t=0;const e=r=>!(r instanceof ho)||!(r.children.first instanceof Fm)?null:r.children.first,i=r=>{const o=e(r);return!o||!o.isToggleable?null:o},s=r=>{for(const o of n){const a=e(o);a&&(a.hasCheckSpace=r)}};n.on("change",(r,o)=>{const a=t>0;for(const c of o.removed)i(c)&&t--;for(const c of o.added){const u=e(c);u&&(u.isToggleable&&t++,u.hasCheckSpace=t>0)}const l=t>0;a!==l&&s(l)})}const TI=(n,t,e)=>{const i=new bwe(n.locale);return i.set({id:t,ariaDescribedById:e}),i.bind("isReadOnly").to(n,"isEnabled",s=>!s),i.bind("hasError").to(n,"errorText",s=>!!s),i.on("input",()=>{n.errorText=null}),n.bind("isEmpty","isFocused","placeholder").to(i),i},Owe=(n,t,e)=>{const i=new wwe(n.locale);return i.set({id:t,ariaDescribedById:e,inputMode:"numeric"}),i.bind("isReadOnly").to(n,"isEnabled",s=>!s),i.bind("hasError").to(n,"errorText",s=>!!s),i.on("input",()=>{n.errorText=null}),n.bind("isEmpty","isFocused","placeholder").to(i),i};class Dwe{constructor(t){y(this,"editor");y(this,"_components",new Map);this.editor=t}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(CA(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new ee("componentfactory-item-missing",this,{name:t});return this._components.get(CA(t)).callback(this.editor.locale)}has(t){return this._components.has(CA(t))}}function CA(n){return String(n).toLowerCase()}const lN="ck-tooltip",ei=class ei extends Qs(){constructor(e){super();y(this,"tooltipTextView");y(this,"balloonPanelView");y(this,"_currentElementWithTooltip",null);y(this,"_currentTooltipPosition",null);y(this,"_mutationObserver",null);y(this,"_pinTooltipDebounced");y(this,"_unpinTooltipDebounced");y(this,"_watchdogExcluded");if(ei._editors.add(e),ei._instance)return ei._instance;ei._instance=this,this.tooltipTextView=new Ye(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new jc(e.locale),this.balloonPanelView.class=lN,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=Rwe(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=ph(this._pinTooltip,600),this._unpinTooltipDebounced=ph(this._unpinTooltip,400),this.listenTo(Ie.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(Ie.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(Ie.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(Ie.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(Ie.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(Ie.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const i=e.ui.view&&e.ui.view.body;ei._editors.delete(e),this.stopListening(e.ui),i&&i.has(this.balloonPanelView)&&i.remove(this.balloonPanelView),ei._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),ei._instance=null)}static getPositioningFunctions(e){const i=ei.defaultBalloonPositions;return{s:[i.southArrowNorth,i.southArrowNorthEast,i.southArrowNorthWest],n:[i.northArrowSouth],e:[i.eastArrowWest],w:[i.westArrowEast],sw:[i.southArrowNorthEast],se:[i.southArrowNorthWest]}[e]}_onKeyDown(e,i){i.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),i.stopPropagation())}_onEnterOrFocus(e,{target:i}){const s=kA(i);if(!s){e.name==="focus"&&this._unpinTooltip();return}if(s===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!s.matches(":hover")||s.matches("[data-cke-tooltip-instant]")?this._pinTooltip(s,IA(s)):this._pinTooltipDebounced(s,IA(s))}_onLeaveOrBlur(e,{target:i,relatedTarget:s}){if(e.name==="mouseleave"){if(!Wc(i))return;const r=this.balloonPanelView.element,o=r&&(r===s||r.contains(s)),a=!o&&i===r;if(o){this._unpinTooltipDebounced.cancel();return}if(!a&&this._currentElementWithTooltip&&i!==this._currentElementWithTooltip)return;const l=kA(i),c=kA(s);(a||l&&l!==c)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||l&&l.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&i!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:i}){this._currentElementWithTooltip&&(i.contains(this.balloonPanelView.element)&&i.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:i,position:s,cssClass:r}){this._unpinTooltip();const o=$i(ei._editors.values()).ui.view.body;o.has(this.balloonPanelView)||o.add(this.balloonPanelView),this.tooltipTextView.text=i,this.balloonPanelView.class=[lN,r].filter(a=>a).join(" "),this.balloonPanelView.pin({target:e,positions:ei.getPositioningFunctions(s)}),this._mutationObserver.attach(e);for(const a of ei._editors)this.listenTo(a.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=s}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of ei._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=IA(this._currentElementWithTooltip);if(!wl(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:ei.getPositioningFunctions(e.position)})}};y(ei,"defaultBalloonPositions",jc.generatePositions({heightOffset:5,sideOffset:13})),y(ei,"_editors",new Set),y(ei,"_instance",null);let xI=ei;function kA(n){return Wc(n)?n.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function IA(n){return{text:n.dataset.ckeTooltipText,position:n.dataset.ckeTooltipPosition||"s",cssClass:n.dataset.ckeTooltipClass||""}}function Rwe(n){const t=new MutationObserver(()=>{n()});return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}class Lwe extends k4{constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"});y(this,"licenseTypeMessage",{evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"})}_isEnabled(){const i=this.editor.config.get("licenseKey"),s=cN(i);return!!(s&&this.licenseTypeMessage[s])}_createBadgeContent(){const e=this.editor.config.get("licenseKey"),i=cN(e);return new Fwe(this.editor.locale,this.licenseTypeMessage[i])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),i=this.editor.config.get("ui.poweredBy")||{},s=i.position||e.position,r=i.side||e.side;return{position:s,side:r==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class Fwe extends Ye{constructor(t,e){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[e]}]})}}function cN(n){if(n=="GPL")return"GPL";const t=KM(n.split(".")[1]);return t?t.licenseType||"production":null}class nx extends ho{constructor(t,e){super(t);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(e)}}const R_=5,Wh={toggleMenusAndFocusItemsOnHover(n){n.on("menu:mouseenter",t=>{if(!(!n.isFocusBorderEnabled&&!n.isOpen)){if(n.isOpen)for(const e of n.menus){const i=t.path[0],s=i instanceof nx&&i.children.first===e;e.isOpen=(t.path.includes(e)||s)&&e.isEnabled}
484t.source.focus()}})},focusCycleMenusOnArrows(n){const t=n.locale.uiLanguageDirection==="rtl";n.on("menu:arrowright",i=>{e(i.source,t?-1:1)}),n.on("menu:arrowleft",i=>{e(i.source,t?1:-1)});function e(i,s){const r=n.children.getIndex(i),o=i.isOpen,a=n.children.length,l=n.children.get((r+a+s)%a);i.isOpen=!1,o&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(n){n.on("change:isOpen",()=>{n.isOpen||n.menus.forEach(t=>{t.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(n){n.on("menu:change:isOpen",(t,e,i)=>{i&&n.menus.filter(s=>t.source.parentMenuView===s.parentMenuView&&t.source!==s&&s.isOpen).forEach(s=>{s.isOpen=!1})})},closeOnClickOutside(n){Fy({emitter:n,activator:()=>n.isOpen,callback:()=>n.close(),contextElements:()=>n.children.map(t=>t.element)})},enableFocusHighlightOnInteraction(n){let t=!1;n.on("change:isOpen",(e,i,s)=>{s||(t||(n.isFocusBorderEnabled=!1),t=!1)}),n.listenTo(n.element,"keydown",()=>{t=!0},{useCapture:!0}),n.listenTo(n.element,"keyup",()=>{t=!1},{useCapture:!0}),n.listenTo(n.element,"focus",()=>{t&&(n.isFocusBorderEnabled=!0)},{useCapture:!0})}},Dl={openAndFocusPanelOnArrowDownKey(n){n.keystrokes.set("arrowdown",(t,e)=>{n.isEnabled&&n.focusTracker.focusedElement===n.buttonView.element&&(n.isOpen||(n.isOpen=!0),n.panelView.focus(),e())})},openOnArrowRightKey(n){const t=n.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";n.keystrokes.set(t,(e,i)=>{n.focusTracker.focusedElement!==n.buttonView.element||!n.isEnabled||(n.isOpen||(n.isOpen=!0),n.panelView.focus(),i())})},openOnButtonClick(n){n.buttonView.on("execute",()=>{n.isOpen=!0})},toggleOnButtonClick(n){n.buttonView.on("execute",()=>{n.isOpen=!n.isOpen})},openAndFocusOnEnterKeyPress(n){n.keystrokes.set("enter",(t,e)=>{n.focusTracker.focusedElement===n.buttonView.element&&(n.isOpen=!0,n.panelView.focus(),e())})},closeOnArrowLeftKey(n){const t=n.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";n.keystrokes.set(t,(e,i)=>{n.isOpen&&(n.isOpen=!1,n.focus(),i())})},closeOnEscKey(n){n.keystrokes.set("esc",(t,e)=>{n.isOpen&&(n.isOpen=!1,n.focus(),e())})},closeOnParentClose(n){n.parentMenuView.on("change:isOpen",(t,e,i)=>{!i&&t.source===n.parentMenuView&&(n.isOpen=!1)})}},Nwe={southEast:n=>({top:n.bottom,left:n.left,name:"se"}),southWest:(n,t)=>({top:n.bottom,left:n.left-t.width+n.width,name:"sw"}),northEast:(n,t)=>({top:n.top-t.height,left:n.left,name:"ne"}),northWest:(n,t)=>({top:n.top-t.height,left:n.left-t.width+n.width,name:"nw"}),eastSouth:n=>({top:n.top,left:n.right-R_,name:"es"}),eastNorth:(n,t)=>({top:n.top-t.height,left:n.right-R_,name:"en"}),westSouth:(n,t)=>({top:n.top,left:n.left-t.width+R_,name:"ws"}),westNorth:(n,t)=>({top:n.top-t.height,left:n.left-t.width+R_,name:"wn"})},Bwe=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]}
484,{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Vwe(n){let t;return!("items"in n)||!n.items?t={items:_s(Bwe),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...n}:t={items:n.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...n},t}function Hwe({normalizedConfig:n,locale:t,componentFactory:e,extraItems:i}){const s=_s(n);return uN(n,s,i),zwe(n,s),uN(n,s,s.addItems),$we(n,s,e),B4(n,s),Wwe(s,t),s}function zwe(n,t){const e=t.removeItems,i=[];t.items=t.items.filter(({menuId:s})=>e.includes(s)?(i.push(s),!1):!0),Bm(t.items,s=>{s.groups=s.groups.filter(({groupId:r})=>e.includes(r)?(i.push(r),!1):!0);for(const r of s.groups)r.items=r.items.filter(o=>{const a=V4(o);return e.includes(a)?(i.push(a),!1):!0})});for(const s of e)i.includes(s)||Dt("menu-bar-item-could-not-be-removed",{menuBarConfig:n,itemName:s})}function uN(n,t,e){const i=[];if(e.length!=0){for(const s of e){const r=Gwe(s.position),o=Ywe(s.position);if(Uwe(s))if(!o)r==="start"?(t.items.unshift(s.menu),i.push(s)):r==="end"&&(t.items.push(s.menu),i.push(s));else{const a=t.items.findIndex(l=>l.menuId===o);a!=-1?r==="before"?(t.items.splice(a,0,s.menu),i.push(s)):r==="after"&&(t.items.splice(a+1,0,s.menu),i.push(s)):dN(t,s.menu,o,r)&&i.push(s)}else jwe(s)?Bm(t.items,a=>{if(a.menuId===o)r==="start"?(a.groups.unshift(s.group),i.push(s)):r==="end"&&(a.groups.push(s.group),i.push(s));else{const l=a.groups.findIndex(c=>c.groupId===o);l!==-1&&(r==="before"?(a.groups.splice(l,0,s.group),i.push(s)):r==="after"&&(a.groups.splice(l+1,0,s.group),i.push(s)))}}):dN(t,s.item,o,r)&&i.push(s)}for(const s of e)i.includes(s)||Dt("menu-bar-item-could-not-be-added",{menuBarConfig:n,addedItemConfig:s})}}function dN(n,t,e,i){let s=!1;return Bm(n.items,r=>{for(const{groupId:o,items:a}of r.groups){if(s)return;if(o===e)i==="start"?(a.unshift(t),s=!0):i==="end"&&(a.push(t),s=!0);else{const l=a.findIndex(c=>V4(c)===e);l!==-1&&(i==="before"?(a.splice(l,0,t),s=!0):i==="after"&&(a.splice(l+1,0,t),s=!0))}}}),s}function $we(n,t,e){Bm(t.items,i=>{for(const s of i.groups)s.items=s.items.filter(r=>{const o=typeof r=="string"&&!e.has(r);return o&&!t.isUsingDefaultConfig&&Dt("menu-bar-item-unavailable",{menuBarConfig:n,parentMenuConfig:_s(i),componentName:r}),!o})})}function B4(n,t){const e=t.isUsingDefaultConfig;let i=!1;if(t.items=t.items.filter(s=>s.groups.length?!0:(PA(n,s,e),!1)),!t.items.length){PA(n,n,e);return}Bm(t.items,s=>{s.groups=s.groups.filter(r=>r.items.length?!0:(i=!0,!1));for(const r of s.groups)r.items=r.items.filter(o=>H4(o)&&!o.groups.length?(PA(n,o,e),i=!0,!1):!0)}),i&&B4(n,t)}function PA(n,t,e){e||Dt("menu-bar-menu-empty",{menuBarConfig:n,emptyMenuConfig:t})}function Wwe(n,t){const e=t.t,i={File:e({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:e({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:e({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:e({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:e({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:e({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:e({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:e({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:e({string:"Font",id:"MENU_BAR_MENU_FONT"})};Bm(n.items,s=>{s.label in i&&(s.label=i[s.label])})}function Bm(n,t){if(Array.isArray(n))for(const i of n)e(i);function e(i){t(i);for(const s of i.groups)for(const r of s.items)H4(r)&&e(r)}}function Uwe(n){return typeof n=="object"&&"menu"in n}function jwe(n){return typeof n=="object"&&"group"in n}function Gwe(n){return n.startsWith("start")?"start":n.startsWith("end")?"end":n.startsWith("after")?"after":"before"}function Ywe(n){const t=n.match(/^[^:]+:(.+)/);return t?t[1]:null}function V4(n){return typeof n=="string"?n:n.menuId}function H4(n){return typeof n=="object"&&"menuId"in n}class qwe extends Ut(){constructor(e){super();y(this,"editor");y(this,"componentFactory");y(this,"focusTracker");y(this,"tooltipManager");y(this,"poweredBy");y(this,"evaluationBadge");y(this,"ariaLiveAnnouncer");y(this,"isReady",!1);y(this,"_editableElementsMap",new Map);y(this,"_focusableToolbarDefinitions",[]);y(this,"_extraMenuBarElements",[]);y(this,"_lastFocusedForeignElement",null);y(this,"_domEmitter");const i=e.editing.view;this.editor=e,this.componentFactory=new Dwe(e),this.focusTracker=new fi,this.tooltipManager=new xI(e),this.poweredBy=new uwe(e),this.evaluationBadge=new Lwe(e),this.ariaLiveAnnouncer=new jbe(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(i.document,"layoutChanged",this.update.bind(this)),this.listenTo(i,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}
484get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,i){this._editableElementsMap.set(e,i),i.ckeditorInstance||(i.ckeditorInstance=this.editor),this.focusTracker.add(i);const s=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(i)};this.isReady?s():this.once("ready",s)}removeEditableElement(e){const i=this._editableElementsMap.get(e);i&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(i),this.focusTracker.remove(i),i.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,i={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:i})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const i=e.element;this.focusTracker.add(i),this.editor.keystrokes.listenTo(i);const s=Vwe(this.editor.config.get("menuBar")||{});e.fillFromConfig(s,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(r,o)=>{i.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),o())}),this.editor.keystrokes.set("Alt+F9",(r,o)=>{i.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),o())})}_readViewportOffsetFromConfig(){const e=this.editor,i=e.config.get("ui.viewportOffset");if(i)return i;const s=e.config.get("toolbar.viewportTopOffset");return s?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:s}):{top:0}}_initFocusTracking(){const e=this.editor;let i;e.keystrokes.set("Alt+F10",(s,r)=>{this._saveLastFocusedForeignElement();const o=this._getCurrentFocusedToolbarDefinition();(!o||!i)&&(i=this._getFocusableCandidateToolbarDefinitions());for(let a=0;a<i.length;a++){const l=i.shift();if(i.push(l),l!==o&&this._focusFocusableCandidateToolbar(l)){o&&o.options.afterBlur&&o.options.afterBlur();break}}r()}),e.keystrokes.set("Esc",(s,r)=>{const o=this._getCurrentFocusedToolbarDefinition();o&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),o.options.afterBlur&&o.options.afterBlur(),r())})}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const i of this._focusableToolbarDefinitions){const{toolbarView:s,options:r}=i;(wl(s.element)||r.beforeFocus)&&e.push(i)}return e.sort((i,s)=>hN(i)-hN(s)),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:i,options:{beforeFocus:s}}=e;return s&&s(),wl(i.element)?(i.focus(),!0):!1}_handleScrollToTheSelection(e,i){const s={top:0,bottom:0,left:0,right:0,...this.viewportOffset};i.viewportOffset.top+=s.top,i.viewportOffset.bottom+=s.bottom,i.viewportOffset.left+=s.left,i.viewportOffset.right+=s.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const i of e)this.focusTracker.add(i.element);e.on("add",(i,s)=>{this.focusTracker.add(s.element)}),e.on("remove",(i,s)=>{this.focusTracker.remove(s.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(i,s,r)=>{const o=this._getVisualViewportTopOffset(r);r.visualTop!==o&&(i.return={...r,visualTop:o})}),this.set("viewportOffset",e)}
484_initVisualViewportSupport(){if(!Ie.window.visualViewport)return;const e=()=>{const i=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==i&&(this.viewportOffset={...this.viewportOffset,visualTop:i})};this._domEmitter=new(Qs()),this._domEmitter.listenTo(Ie.window.visualViewport,"scroll",e),this._domEmitter.listenTo(Ie.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const i=$0().top,s=e.top||0;return i>s?0:s-i}}function hN(n){const{toolbarView:t,options:e}=n;let i=10;return wl(t.element)&&i--,e.isContextual&&(i-=2),i}class Kwe extends Ye{constructor(e){super(e);y(this,"body");y(this,"menuBarView");y(this,"toolbar");this.body=new EI(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Xwe extends Kwe{constructor(e){super(e);y(this,"top");y(this,"main");y(this,"_voiceLabelView");this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,i=new ZT;return i.text=e("Rich Text Editor"),i.extendTemplate({attributes:{class:"ck-voice-label"}}),i}}class Jwe extends Ye{constructor(e,i,s){super(e);y(this,"name",null);y(this,"_editingView");y(this,"_editableElement");y(this,"_hasExternalElement");this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=s,this._hasExternalElement=!!this._editableElement,this._editingView=i}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;e.isRenderingInProgress?s(this):i(this);function i(r){e.change(o=>{const a=e.document.getRoot(r.name);o.addClass(r.isFocused?"ck-focused":"ck-blurred",a),o.removeClass(r.isFocused?"ck-blurred":"ck-focused",a)})}function s(r){e.once("change:isRenderingInProgress",(o,a,l)=>{l?s(r):i(r)})}}}class Zwe extends Jwe{constructor(e,i,s,r={}){super(e,i,s);y(this,"_options");this._options=r,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change(i=>{const s=e.document.getRoot(this.name);i.setAttribute("aria-label",this.getEditableAriaLabel(),s)})}getEditableAriaLabel(){const e=this.locale.t,i=this._options.label,s=this._editableElement,r=this.name;if(typeof i=="string")return i;if(typeof i=="object")return i[r];if(typeof i=="function")return i(this);if(s){const o=s.getAttribute("aria-label");if(o)return o}return e("Rich Text Editor. Editing area: %0",r)}}class XE extends Ye{constructor(e,i={}){super(e);y(this,"children");const s=this.bindTemplate;this.set("class",["ck","ck-form__row",...bn(i.class||[])]),this.children=this.createCollection(),i.children&&i.children.forEach(r=>this.children.add(r)),this.set("_role",null),this.set("_ariaLabelledBy",null),i.labelView&&this.set({_role:"group",_ariaLabelledBy:i.labelView.id}),this.setTemplate({tag:"div",attributes:{class:s.to("class",r=>r.join(" ")),role:s.to("_role"),"aria-labelledby":s.to("_ariaLabelledBy")},children:this.children})}}class fN extends f4{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e=t.namespace?`show:${t.type}:${t.namespace}`:`show:${t.type}`;this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class JE extends Ut(){constructor(t,e){super(),e&&X$(this,e),t&&this.set(t)}}const L_=Ry("px");class Xb extends we{constructor(e){super(e);y(this,"positionLimiter");y(this,"visibleStack");y(this,"_viewToStack",new Map);y(this,"_idToStack",new Map);y(this,"_view",null);y(this,"_rotatorView",null);y(this,"_fakePanelsView",null);this.positionLimiter=()=>{const i=this.editor.editing.view,r=i.document.selection.editableElement;return r?i.domConverter.mapViewToDom(r.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new ee("contextualballoon-add-view-exist",[this,e]);const i=e.stackId||"main";if(!this._idToStack.has(i)){this._idToStack.set(i,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(i)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(i);return}const s=this._idToStack.get(i);e.singleViewMode&&this.showStack(i),s.set(e.view,e),this._viewToStack.set(e.view,s),s===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new ee("contextualballoon-remove-view-not-exist",[this,e]);const i=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(i.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(i.values())[i.size-2])),i.size===1?(this._idToStack.delete(this._getStackId(i)),this._numberOfStacks=this._idToStack.size):i.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const i=this._idToStack.get(e);if(!i)throw new ee("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==i&&this._showView(Array.from(i.values()).pop())}_createPanelView(){this._view=new jc(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(s=>s[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let i=e.indexOf(this._visibleStack)+1;e[i]||(i=0),this.showStack(this._getStackId(e[i]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let i=e.indexOf(this._visibleStack)-1;e[i]||(i=e.length-1),this.showStack(this._getStackId(e[i]))}_createRotatorView(){const e=new Qwe(this.editor.locale),i=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(s,r)=>!r&&s>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(s,r)=>{if(r<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return i("%0 of %1",[o,r])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new eve(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(i,s)=>!s&&i>=2?Math.min(i-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:i="",withArrow:s=!0,singleViewMode:r=!1}){this.view.class=i,this.view.withArrow=s,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),r&&(this._singleViewMode=!0)}}class Qwe extends Ye{constructor(e){super(e);y(this,"focusTracker");y(this,"buttonPrevView");y(this,"buttonNextView");y(this,"content");const i=e.t,s=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new fi,this.buttonPrevView=this._createButtonView(i("Previous"),Rm),this.buttonNextView=this._createButtonView(i("Next"),p4),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",s.to("isNavigationVisible",r=>r?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:s.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,i){const s=new pt(this.locale);return s.set({label:e,icon:i,tooltip:!0}),s}}class eve extends Ye{constructor(e,i){super(e);y(this,"content");y(this,"_balloonPanelView");const s=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=i,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",s.to("numberOfPanels",r=>
484r?"":"ck-hidden")],style:{top:s.to("top",L_),left:s.to("left",L_),width:s.to("width",L_),height:s.to("height",L_)}},children:this.content}),this.on("change:numberOfPanels",(r,o,a,l)=>{a>l?this._addPanels(a-l):this._removePanels(l-a),this.updatePosition()})}_addPanels(e){for(;e--;){const i=new Ye;i.setTemplate({tag:"div"}),this.content.add(i),this.registerChild(i)}}_removePanels(e){for(;e--;){const i=this.content.last;this.content.remove(i),this.deregisterChild(i),i.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:i}=this._balloonPanelView,{width:s,height:r}=new tt(this._balloonPanelView.element);Object.assign(this,{top:e,left:i,width:s,height:r})}}}const Uh=Ry("px");class tve extends Ye{constructor(e){super(e);y(this,"content");y(this,"contentPanelElement");y(this,"_contentPanelPlaceholder");const i=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new ro({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:i.to("isSticky",s=>s?"block":"none"),height:i.to("isSticky",s=>s?Uh(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new ro({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",i.if("isSticky","ck-sticky-panel__content_sticky"),i.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:i.to("isSticky",s=>s?Uh(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:i.to("_stickyTopOffset",s=>s&&Uh(s)),bottom:i.to("_stickyBottomOffset",s=>s&&Uh(s)),marginLeft:i.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(Ie.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),Ie.window.visualViewport&&(this.listenTo(Ie.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(Ie.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}const e=new tt(this.limiterElement);let i=e.getVisible();if(i){const o=new tt(Ie.window);o.top+=this.viewportTopOffset,o.height-=this.viewportTopOffset,i=i.getIntersection(o)}const{left:s,top:r}=$0();if(e.moveBy(s,r),i&&i.moveBy(s,r),i&&e.top<i.top)if(this._contentPanelRect.height+this.limiterBottomOffset>i.height){const o=Math.max(e.bottom-i.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+o+1<e.height?this._stickToBottomOfLimiter(o):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(i.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=Uh(-Ie.window.scrollX+$0().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=Uh(-Ie.window.scrollX+$0().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new tt(this.contentPanelElement)}}class nve extends Fm{constructor(e){super(e);y(this,"arrowView");const i=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",s=>String(s)),"data-cke-tooltip-disabled":i.to("isOn")},on:{mouseenter:i.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new ea;return e.content=XT,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class ive extends Ye{constructor(e){super(e);y(this,"children");const i=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",i.to("position",s=>`ck-menu-bar__menu__panel_position_${s}`),i.if("isVisible","ck-hidden",s=>!s)],tabindex:"-1"},children:this.children,on:{selectstart:i.to(s=>{s.target.tagName.toLocaleLowerCase()!=="input"&&s.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}}const GS=class GS extends Ye{constructor(e){super(e);y(this,"buttonView");y(this,"panelView");y(this,"focusTracker");y(this,"keystrokes");const i=this.bindTemplate;this.buttonView=new nve(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new ive(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new rs,this.focusTracker=new fi,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",i.to("class"),i.if("isEnabled","ck-disabled",s=>!s),i.if("parentMenuView","ck-menu-bar__menu_top-level",s=>!s)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Dl.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Dl.openOnButtonClick(this),Dl.openOnArrowRightKey(this),Dl.closeOnArrowLeftKey(this),Dl.openAndFocusOnEnterKeyPress(this),Dl.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Dl.openAndFocusPanelOnArrowDownKey(this),Dl.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,i)=>{this.fire("arrowright"),i()}),this.keystrokes.set("arrowleft",(e,i)=>{this.fire("arrowleft"),i()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,i,s)=>{if(!s)return;const r=GS._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=r?r.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:i,northEast:s,northWest:r,westSouth:o,eastSouth:a,westNorth:l,eastNorth:c}=Nwe;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[a,c,o,l]:[e,i,s,r]:this.parentMenuView?[o,l,a,c]:[i,e,r,s]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}};y(GS,"_getOptimalPosition",UM);let Lc=GS;class ZE extends Nm{constructor(t){super(t),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const t=Array.from(this.items).some(e=>{const i=gN(e);return i&&i.isToggleable});
484this.items.forEach(e=>{const i=gN(e);i&&(i.hasCheckSpace=t)})}}function gN(n){return n instanceof ho?n.children.map(t=>sve(t)?t.buttonView:t).find(t=>t instanceof Fm):null}function sve(n){return typeof n=="object"&&"buttonView"in n&&n.buttonView instanceof pt}class z4 extends hwe{constructor(t){super(t),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const mN=["mouseenter","arrowleft","arrowright","change:isOpen"];class rve extends Ye{constructor(e){super(e);y(this,"children");y(this,"menus",[]);const i=e.t,s=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",s.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":i("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,i,s=[]){const r=this.locale,a=Hwe({normalizedConfig:e,locale:r,componentFactory:i,extraItems:s}).items.map(l=>this._createMenu({componentFactory:i,menuDefinition:l}));this.children.addMany(a)}render(){super.render(),Wh.toggleMenusAndFocusItemsOnHover(this),Wh.closeMenusWhenTheBarCloses(this),Wh.closeMenuWhenAnotherOnTheSameLevelOpens(this),Wh.focusCycleMenusOnArrows(this),Wh.closeOnClickOutside(this),Wh.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,i=null){i?(e.delegate(...mN).to(i),e.parentMenuView=i):e.delegate(...mN).to(this,s=>"menu:"+s),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:i,parentMenuView:s}){const r=this.locale,o=new Lc(r);return this.registerMenu(o,s),o.buttonView.set({label:i.label}),o.once("change:isOpen",()=>{const a=new ZE(r);a.ariaLabel=i.label,o.panelView.children.add(a),a.items.addMany(this._createMenuItems({menuDefinition:i,parentMenuView:o,componentFactory:e}))}),o}_createMenuItems({menuDefinition:e,parentMenuView:i,componentFactory:s}){const r=this.locale,o=[];for(const a of e.groups){for(const l of a.items){const c=new nx(r,i);if(ys(l))c.children.add(this._createMenu({componentFactory:s,menuDefinition:l,parentMenuView:i}));else{const u=this._createMenuItemContentFromFactory({componentName:l,componentFactory:s,parentMenuView:i});if(!u)continue;c.children.add(u)}o.push(c)}a!==e.groups[e.groups.length-1]&&o.push(new fO(r))}return o}_createMenuItemContentFromFactory({componentName:e,parentMenuView:i,componentFactory:s}){const r=s.create(e);return r instanceof Lc||r instanceof Cr||r instanceof z4?(this._registerMenuTree(r,i),r.on("execute",()=>{this.close()}),r):(Dt("menu-bar-component-unsupported",{componentName:e,componentView:r}),null)}_registerMenuTree(e,i){if(!(e instanceof Lc)){e.delegate("mouseenter").to(i);return}this.registerMenu(e,i);const s=e.panelView.children.filter(o=>o instanceof ZE)[0];if(!s){e.delegate("mouseenter").to(i);return}const r=s.items.filter(o=>o instanceof ho);for(const o of r)this._registerMenuTree(o.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(i,s,r)=>{clearTimeout(e),r?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(o=>o.isOpen)},0)})}}/** 485 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 486 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 487 *//** 488 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 489 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 490 */class $4{constructor(t,e=20){y(this,"model");y(this,"limit");y(this,"_isLocked");y(this,"_size");y(this,"_batch",null);y(this,"_changeCallback");y(this,"_selectionChangeCallback");this.model=t,this._size=0,this.limit=e,this._isLocked=!1,this._changeCallback=(i,s)=>{s.isLocal&&s.isUndoable&&s!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(t){this._size+=t,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("
490change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t=!1){(!this.isLocked||t)&&(this._batch=null,this._size=0)}}class ove extends _t{constructor(e,i){super(e);y(this,"_buffer");this._buffer=new $4(e.model,i),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const i=this.editor.model,s=i.document,r=e.text||"",o=r.length;let a=s.selection;if(e.selection?a=e.selection:e.range&&(a=i.createSelection(e.range)),!i.canEditAt(a))return;const l=e.resultRange;i.enqueueChange(this._buffer.batch,c=>{this._buffer.lock();const u=Array.from(s.selection.getAttributes());i.deleteContent(a),r&&i.insertContent(c.createText(r,u),a),l?c.setSelection(l):a.is("documentSelection")||c.setSelection(a),this._buffer.unlock(),this._buffer.input(o)})}}const W4=["insertText","insertReplacementText"],ave=[...W4,"insertCompositionText"];class lve extends ia{constructor(e){super(e);y(this,"focusObserver");this.focusObserver=e.getObserver(UE);const i=Ge.isAndroid?ave:W4,s=e.document;s.on("beforeinput",(r,o)=>{if(!this.isEnabled)return;const{data:a,targetRanges:l,inputType:c,domEvent:u,isComposing:d}=o;if(!i.includes(c))return;this.focusObserver.flush();const h=new bl(s,"insertText");s.fire(h,new bh(e,u,{text:a,selection:e.createSelection(l),isComposing:d})),h.stop.called&&r.stop()}),Ge.isAndroid||s.on("compositionend",(r,{data:o,domEvent:a})=>{this.isEnabled&&o&&s.fire("insertText",new bh(e,a,{text:o,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}}class U4 extends we{constructor(){super(...arguments);y(this,"_typingQueue")}static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.model,s=e.editing.view,r=e.editing.mapper,o=i.document.selection;this._typingQueue=new cve(e),s.addObserver(lve);const a=new ove(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",a),e.commands.add("input",a),this.listenTo(s.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(s.document,"insertText",(l,c)=>{const{text:u,selection:d}=c;if(s.document.selection.isFake&&d&&s.document.selection.isSimilar(d)&&c.preventDefault(),d&&Array.from(d.getRanges()).some(v=>!v.isCollapsed)&&c.preventDefault(),!a.isEnabled){c.preventDefault();return}let h;d&&(h=Array.from(d.getRanges()).filter(v=>v.root.is("rootElement")).map(v=>r.toModelRange(v)).map(v=>oO(v,i.schema)||v)),(!h||!h.length)&&(h=Array.from(o.getRanges()));let f=u;if(Ge.isAndroid){const v=Array.from(h[0].getItems()).reduce((E,x)=>E+(x.is("$textProxy")?x.data:""),"");if(v&&(v.length<=f.length?f.startsWith(v)&&(f=f.substring(v.length),h[0].start=h[0].start.getShiftedBy(v.length)):v.startsWith(f)&&(h[0].start=h[0].start.getShiftedBy(f.length),f="")),f.length==0&&h[0].isCollapsed)return}const p={text:f,selection:i.createSelection(h)};this._typingQueue.push(p,!!c.isComposing),c.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),Ge.isAndroid?this.listenTo(s.document,"keydown",(l,c)=>{o.isCollapsed||c.keyCode!=229||!s.document.isComposing||pN(i,a)}):this.listenTo(s.document,"compositionstart",()=>{o.isCollapsed||pN(i,a)},{priority:"high"}),this.listenTo(s.document,"mutations",(l,{mutations:c})=>{if(this._typingQueue.hasAffectedElements())for(const{node:u}of c){const d=dve(u,r),h=r.toModelElement(d);if(this._typingQueue.isElementAffected(h)){this._typingQueue.flush("mutations");return}}}),this.listenTo(s.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(s.document,"compositionend",()=>{this._typingQueue.flush("after composition end");const l=[];if(this._typingQueue.hasAffectedElements())for(const c of this._typingQueue.flushAffectedElements()){const u=r.toViewElement(c);u&&l.push({type:"children",node:u})}(l.length||!Ge.isAndroid)&&s.document.fire("mutations",{mutations:l})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}}class cve{constructor(t){y(this,"editor");y(this,"flushDebounced",ph(()=>this.flush("timeout"),50));y(this,"_queue",[]);y(this,"_isComposing",!1);y(this,"_affectedElements",new Set);this.editor=t}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(t,e){const i={text:t.text};
490if(t.selection){i.selectionRanges=[];for(const s of t.selection.getRanges())i.selectionRanges.push(js.fromRange(s)),this._affectedElements.add(s.start.parent)}this._queue.push(i),this._isComposing||(this._isComposing=e),this.flushDebounced()}shift(){const t=this._queue.shift(),e={text:t.text};if(t.selectionRanges){const i=t.selectionRanges.map(s=>uve(s)).filter(s=>!!s);i.length&&(e.selection=this.editor.model.createSelection(i))}return e}flush(t){const e=this.editor,i=e.model,s=e.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const o=e.commands.get("insertText").buffer;i.enqueueChange(o.batch,()=>{for(o.lock();this._queue.length;){const a=this.shift();e.execute("insertText",a)}o.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),s.scrollToTheSelection()}isElementAffected(t){return this._affectedElements.has(t)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){const t=Array.from(this._affectedElements);return this._affectedElements.clear(),t}}function pN(n,t){if(!t.isEnabled)return;const e=t.buffer;e.lock(),n.enqueueChange(e.batch,()=>{n.deleteContent(n.document.selection)}),e.unlock()}function uve(n){const t=n.toRange();return n.detach(),t.root.rootName=="$graveyard"?null:t}function dve(n,t){let e=n.is("$text")?n.parent:n;for(;!t.toModelElement(e);)e=e.parent;return e}class bN extends _t{constructor(e,i){super(e);y(this,"direction");y(this,"_buffer");this.direction=i,this._buffer=new $4(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const i=this.editor.model,s=i.document;i.enqueueChange(this._buffer.batch,r=>{this._buffer.lock();const o=r.createSelection(e.selection||s.selection);if(!i.canEditAt(o))return;const a=e.sequence||1,l=o.isCollapsed;if(o.isCollapsed&&i.modifySelection(o,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(a)){this._replaceEntireContentWithParagraph(r);return}if(this._shouldReplaceFirstBlockWithParagraph(o,a)){this.editor.execute("paragraph",{selection:o});return}if(o.isCollapsed)return;let c=0;
490o.getFirstRange().getMinimalFlatRanges().forEach(u=>{c+=oI(u.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),i.deleteContent(o,{doNotResetEntireContent:l,direction:this.direction}),this._buffer.input(c),r.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const i=this.editor.model,r=i.document.selection,o=i.schema.getLimitElement(r);if(!(r.isCollapsed&&r.containsEntireContent(o))||!i.schema.checkChild(o,"paragraph"))return!1;const l=o.getChild(0);return!(l&&l.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){const i=this.editor.model,r=i.document.selection,o=i.schema.getLimitElement(r),a=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(a,o),e.setSelection(a,0)}_shouldReplaceFirstBlockWithParagraph(e,i){const s=this.editor.model;if(i>1||this.direction!="backward"||!e.isCollapsed)return!1;const r=e.getFirstPosition(),o=s.schema.getLimitElement(r),a=o.getChild(0);return!(r.parent!=a||!e.containsEntireContent(a)||!s.schema.checkChild(o,"paragraph")||a.name=="paragraph")}}const hve="character",wN="word",fve="codePoint",Fl="selection",of="backward",qp="forward",j4={deleteContent:{unit:Fl,direction:of},deleteContentBackward:{unit:fve,direction:of},deleteWordBackward:{unit:wN,direction:of},deleteHardLineBackward:{unit:Fl,direction:of},deleteSoftLineBackward:{unit:Fl,direction:of},deleteContentForward:{unit:hve,direction:qp},deleteWordForward:{unit:wN,direction:qp},deleteHardLineForward:{unit:Fl,direction:qp},deleteSoftLineForward:{unit:Fl,direction:qp}};class gve extends ia{constructor(t){super(t);const e=t.document;let i=0;e.on("keydown",()=>{i++}),e.on("keyup",()=>{i=0}),e.on("beforeinput",(s,r)=>{if(!this.isEnabled)return;const{targetRanges:o,domEvent:a,inputType:l}=r,c=j4[l];if(!c)return;const u={direction:c.direction,unit:c.unit,sequence:i};u.unit==Fl&&(u.selectionToRemove=t.createSelection(o[0])),l==="deleteContentBackward"&&(Ge.isAndroid&&(u.sequence=1),pve(o)&&(u.unit=Fl,u.selectionToRemove=t.createSelection(o)));const d=new Ch(e,"delete",o[0]);e.fire(d,new bh(t,a,u)),d.stop.called&&s.stop()}),Ge.isBlink&&mve(this)}observe(){}stopObserving(){}}function mve(n){const t=n.view,e=t.document;let i=null,s=!1;e.on("keydown",(a,{keyCode:l})=>{i=l,s=!1}),e.on("keyup",(a,{keyCode:l,domEvent:c})=>{const u=e.selection,d=n.isEnabled&&l==i&&r(l)&&!u.isCollapsed&&!s;if(i=null,d){const h=u.getFirstRange(),f=new Ch(e,"delete",h),p={unit:Fl,direction:o(l),selectionToRemove:u};e.fire(f,new bh(t,c,p))}}),e.on("beforeinput",(a,{inputType:l})=>{const c=j4[l];r(i)&&c&&c.direction==o(i)&&(s=!0)},{priority:"high"}),e.on("beforeinput",(a,{inputType:l,data:c})=>{i==ft.delete&&l=="insertText"&&c=="�"&&a.stop()},{priority:"high"});function r(a){return a==ft.backspace||a==ft.delete}function o(a){return a==ft.backspace?of:qp}}function pve(n){if(n.length!=1||n[0].isCollapsed)return!1;const t=n[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let e=0;for(const{nextPosition:i,item:s}of t){if(i.parent.is("$text")){const r=i.parent.data,o=i.offset;if(XM(r,o)||JM(r,o)||bW(r,o))continue;e++}else(s.is("containerElement")||s.is("emptyElement"))&&e++;if(e>1)return!0}return!1}class Ih extends we{constructor(){super(...arguments);y(this,"_undoOnBackspace")}static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.editing.view,s=i.document,r=e.model.document;i.addObserver(gve),this._undoOnBackspace=!1;const o=new bN(e,"forward");e.commands.add("deleteForward",o),e.commands.add("forwardDelete",o),e.commands.add("delete",new bN(e,"backward")),this.listenTo(s,"delete",(a,l)=>{s.isComposing||l.preventDefault();const{direction:c,sequence:u,selectionToRemove:d,unit:h}=l,f=c==="forward"?"deleteForward":"delete",p={sequence:u};if(h=="selection"){const v=Array.from(d.getRanges()).map(E=>e.editing.mapper.toModelRange(E)).map(E=>oO(E,e.model.schema)||E);p.selection=e.model.createSelection(v)}else p.unit=h;e.execute(f,p),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(s,"keydown",(a,l)=>{if(s.isComposing||l.keyCode!=ft.backspace||!r.selection.isCollapsed)return;const c=e.model.schema.getLimitElement(r.selection),u=e.model.createPositionAt(c,0);if(u.isTouching(r.selection.getFirstPosition())){l.preventDefault();const d=e.model.schema.getNearestSelectionRange(u,"forward");if(!d)return;const h=i.createSelection(e.editing.mapper.toViewRange(d)),f=h.getFirstRange(),p=new Ch(document,"delete",f),v={unit:"selection",direction:"backward",selectionToRemove:h};s.fire(p,new bh(i,l.domEvent,v))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(s,"delete",(a,l)=>
490{this._undoOnBackspace&&l.direction=="backward"&&l.sequence==1&&l.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),l.preventDefault(),a.stop())},{context:"$capture"}),this.listenTo(r,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class bve extends we{static get requires(){return[U4,Ih]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}/** 491 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 492 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 493 */function G4(n,t){let e=n.start;return{text:Array.from(n.getWalker({ignoreElementEnd:!1})).reduce((s,{item:r})=>r.is("$text")||r.is("$textProxy")?s+r.data:(e=t.createPositionAfter(r),""),""),range:t.createRange(e,n.end)}}class wve extends Ut(){constructor(e,i){super();y(this,"model");y(this,"testCallback");y(this,"_hasMatch");this.model=e,this.testCallback=i,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const i=this.model.document;this.listenTo(i.selection,"change:range",(s,{directChange:r})=>{if(r){if(!i.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(i,"change:data",(s,r)=>{r.isUndo||!r.isLocal||this._evaluateTextBeforeSelection("data",{batch:r})})}_evaluateTextBeforeSelection(e,i={}){const s=this.model,o=s.document.selection,a=s.createRange(s.createPositionAt(o.focus.parent,0),o.focus),{text:l,range:c}=G4(a,s),u=this.testCallback(l);if(!u&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!u,u){const d=Object.assign(i,{text:l,range:c});typeof u=="object"&&Object.assign(d,u),this.fire(`matched:${e}`,d)}}}class vN extends we{constructor(e){super(e);y(this,"attributes");y(this,"_overrideUid");y(this,"_isNextGravityRestorationSkipped",!1);this.attributes=new Set,this._overrideUid=null}static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.model,s=e.editing.view,r=e.locale,o=i.document.selection;this.listenTo(s.document,"arrowKey",(a,l)=>{if(!o.isCollapsed||l.shiftKey||l.altKey||l.ctrlKey)return;const c=l.keyCode==ft.arrowright,u=l.keyCode==ft.arrowleft;if(!c&&!u)return;const d=r.contentLanguageDirection;let h=!1;d==="ltr"&&c||d==="rtl"&&u?h=this._handleForwardMovement(l):h=this._handleBackwardMovement(l),h===!0&&a.stop()},{context:"$text",priority:"highest"}),this.listenTo(o,"change:range",(a,l)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!l.directChange&&cr(o.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const i=this.attributes,s=this.editor.model,r=s.document.selection,o=r.getFirstPosition();return this._isGravityOverridden||o.isAtStart&&ua(r,i)?!1:cr(o,i)?(e&&yp(e),ua(r,i)&&cr(o,i,!0)?vp(s,i):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){const i=this.attributes,s=this.editor.model,r=s.document.selection,o=r.getFirstPosition();return this._isGravityOverridden?(e&&yp(e),this._restoreGravity(),cr(o,i,!0)?vp(s,i):F_(s,i,o),!0):o.isAtStart?ua(r,i)?(e&&yp(e),F_(s,i,o),!0):!1:!ua(r,i)&&cr(o,i,!0)?(e&&yp(e),F_(s,i,o),!0):yN(o,i)?o.isAtEnd&&!ua(r,i)&&cr(o,i)?(e&&yp(e),F_(s,i,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){const e=this.editor,i=e.model,s=i.document.selection,r=e.editing.view.document;e.editing.view.addObserver(lO),e.editing.view.addObserver(Epe);let o=!1,a=!1;this.listenTo(r,"touchstart",()=>{a=!1,o=!0}),this.listenTo(r,"mousedown",()=>{a=!0}),this.listenTo(r,"selectionChange",()=>{const l=this.attributes;if(!a&&!o||(a=!1,o=!1,!s.isCollapsed)||!ua(s,l))return;const c=s.getFirstPosition();cr(c,l)&&(c.isAtStart||cr(c,l,!0)?vp(i,l):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const i=this.editor.model,s=i.document.selection,r=this.attributes;this.listenTo(i,"insertContent",()=>{const o=s.getFirstPosition();ua(s,r)&&cr(o,r)&&vp(i,r)},{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,i=e.model,s=i.document.selection,r=e.editing.view;let o=!1,a=!1;this.listenTo(r.document,"delete",(l,c)=>{o=c.direction==="backward"},{priority:"high"}),this.listenTo(i,"deleteContent",()=>{if(!o)return;const l=s.getFirstPosition();a=ua(s,this.attributes)&&!yN(l,this.attributes)},{priority:"high"}),this.listenTo(i,"deleteContent",()=>{o&&(o=!1,!a&&e.model.enqueueChange(()=>{const l=s.getFirstPosition();ua(s,this.attributes)&&cr(l,this.attributes)&&(l.isAtStart||cr(l,this.attributes,!0)?vp(i,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function ua(n,t){for(const e of t)if(n.hasAttribute(e))return!0;return!1}function F_(n,t,e){const i=e.nodeBefore;n.change(s=>{if(i){const r=[],o=n.schema.isObject(i)&&n.schema.isInline(i);for(const[a,l]of i.getAttributes())n.schema.checkAttribute("$text",a)&&(!o||n.schema.getAttributeProperties(a).copyFromObject!==!1)&&r.push([a,l]);s.setSelectionAttribute(r)}else s.removeSelectionAttribute(t)})}function vp(n,t){n.change(e=>{e.removeSelectionAttribute(t)})}function yp(n){n.preventDefault()}function yN(n,t){const e=n.getShiftedBy(-1);return cr(e,t)}function cr(n,t,e=!1){const{nodeBefore:i,nodeAfter:s}=n;for(const r of t){const o=i?i.getAttribute(r):void 0,a=s?s.getAttribute(r):void 0;if(!(e&&(o===void 0||a===void 0))&&a!==o)return!0}return!1}/** 494 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 495 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 496 */function ix(n,t,e,i){return i.createRange(_N(n,t,e,!0,i),_N(n,t,e,!1,i))}function _N(n,t,e,i,s){let r=n.textNode||(i?n.nodeBefore:n.nodeAfter),o=null;for(;r&&r.getAttribute(t)==e;)o=r,r=i?r.previousSibling:r.nextSibling;return o?s.createPositionAt(o,i?"before":"after"):n}function vve(n,t,e,i){const s=n.editing.view,r=new Set;s.document.registerPostFixer(o=>{const a=n.model.document.selection;let l=!1;if(a.hasAttribute(t)){const c=ix(a.getFirstPosition(),t,a.getAttribute(t),n.model),u=n.editing.mapper.toViewRange(c);for(const d of u.getItems())d.is("element",e)&&!d.hasClass(i)&&(o.addClass(i,d),r.add(d),l=!0)}return l}),n.conversion.for("editingDowncast").add(o=>{o.on("insert",a,{priority:"highest"}),o.on("remove",a,{priority:"highest"}),o.on("attribute",a,{priority:"highest"}),o.on("selection",a,{priority:"highest"});function a(){s.change(l=>{for(const c of r.values())l.removeClass(i,c),r.delete(c)})}})}/** 497 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 498 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 499 */class pO extends _t{constructor(e,i){super(e);y(this,"attributeKey");this.attributeKey=i}refresh(){const e=this.editor.model,i=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(i.selection,this.attributeKey)}execute(e={}){const i=this.editor.model,r=i.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;i.change(a=>{if(r.isCollapsed)o?a.setSelectionAttribute(this.attributeKey,!0):a.removeSelectionAttribute(this.attributeKey);else{const l=i.schema.getValidRanges(r.getRanges(),this.attributeKey);for(const c of l)o?a.setAttribute(this.attributeKey,o,c):a.removeAttribute(this.attributeKey,c)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,i=e.schema,s=e.document.selection;if(s.isCollapsed)return s.hasAttribute(this.attributeKey);for(const r of s.getRanges())for(const o of r.getItems())if(i.checkAttribute(o,this.attributeKey))return o.hasAttribute(this.attributeKey);return!1}}const jh="bold";class yve extends we{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:jh}),t.model.schema.setAttributeProperties(jh,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:jh,view:"strong",upcastAlso:["b",i=>{const s=i.getStyle("font-weight");return s&&(s=="bold"||Number(s)>=600)?{name:!0,styles:["font-weight"]}:null}]}),t.commands.add(jh,new pO(t,jh)),t.keystrokes.set("CTRL+B",jh),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Bold text"),keystroke:"CTRL+B"}]})}}function bO({editor:n,commandName:t,plugin:e,icon:i,label:s,keystroke:r}){return o=>{const a=n.commands.get(t),l=new o(n.locale);return l.set({label:s,icon:i,keystroke:r,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof Cr?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),e.listenTo(l,"execute",()=>{n.execute(t),n.editing.view.focus()}),l}}const MA="bold";class _ve extends we{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=bO({editor:t,commandName:MA,plugin:this,icon:g4,label:e("Bold"),keystroke:"CTRL+B"});
499t.ui.componentFactory.add(MA,()=>i(pt)),t.ui.componentFactory.add("menuBar:"+MA,()=>i(Cr))}}class Eve extends we{static get requires(){return[yve,_ve]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}}const Gh="italic";class Sve extends we{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:Gh}),t.model.schema.setAttributeProperties(Gh,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:Gh,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add(Gh,new pO(t,Gh)),t.keystrokes.set("CTRL+I",Gh),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Italic text"),keystroke:"CTRL+I"}]})}}const OA="italic";class Tve extends we{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=bO({editor:t,commandName:OA,plugin:this,icon:tbe,keystroke:"CTRL+I",label:e("Italic")});t.ui.componentFactory.add(OA,()=>i(pt)),t.ui.componentFactory.add("menuBar:"+OA,()=>i(Cr))}}class xve extends we{static get requires(){return[Sve,Tve]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}}const _p="underline";class Ave extends we{static get pluginName(){return"UnderlineEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t;t.model.schema.extend("$text",{allowAttributes:_p}),t.model.schema.setAttributeProperties(_p,{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:_p,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add(_p,new pO(t,_p)),t.keystrokes.set("CTRL+U","underline"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Underline text"),keystroke:"CTRL+U"}]})}}const DA="underline";class Cve extends we{static get pluginName(){return"UnderlineUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale.t,i=bO({editor:t,commandName:DA,plugin:this,icon:Sbe,label:e("Underline"),keystroke:"CTRL+U"});t.ui.componentFactory.add(DA,()=>i(pt)),t.ui.componentFactory.add("menuBar:"+DA,()=>i(Cr))}}class kve extends we{static get requires(){return[Ave,Cve]}static get pluginName(){return"Underline"}static get isOfficialPlugin(){return!0}}/** 500 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 501 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 502 *//** 503 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 504 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 505 */function*Y4(n,t){for(const e of t)e&&n.getAttributeProperties(e[0]).copyOnEnter&&(yield e)}class Ive extends _t{execute(){this.editor.model.change(t=>{this.enterBlock(t),this.fire("afterExecute",{writer:t})})}enterBlock(t){const e=this.editor.model,i=e.document.selection,s=e.schema,r=i.isCollapsed,o=i.getFirstRange(),a=o.start.parent,l=o.end.parent;if(s.isLimit(a)||s.isLimit(l))return!r&&a==l&&e.deleteContent(i),!1;if(r){const c=Y4(t.model.schema,i.getAttributes());return EN(t,o.start),t.setSelectionAttribute(c),!0}else{const c=!(o.start.isAtStart&&o.end.isAtEnd),u=a==l;if(e.deleteContent(i,{leaveUnmerged:c}),c){if(u)return EN(t,i.focus),!0;t.setSelection(l,0)}}return!1}}function EN(n,t){n.split(t),n.setSelection(t.parent.nextSibling,0)}const Pve={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class q4 extends ia{constructor(t){super(t);const e=this.document;let i=!1;e.on("keydown",(s,r)=>{i=r.shiftKey}),e.on("beforeinput",(s,r)=>{if(!this.isEnabled)return;let o=r.inputType;Ge.isSafari&&i&&o=="insertParagraph"&&(o="insertLineBreak");const a=r.domEvent,l=Pve[o];if(!l)return;const c=new Ch(e,"enter",r.targetRanges[0]);e.fire(c,new bh(t,a,{isSoft:l.isSoft})),c.stop.called&&s.stop()})}observe(){}stopObserving(){}}class sx extends we{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.editing.view,i=e.document,s=this.editor.t;e.addObserver(q4),t.commands.add("enter",new Ive(t)),this.listenTo(i,"enter",(r,o)=>{i.isComposing||o.preventDefault(),!o.isSoft&&(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Mve extends _t{execute(){const t=this.editor.model,e=t.document;t.change(i=>
505{Dve(t,i,e.selection),this.fire("afterExecute",{writer:i})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=Ove(t.schema,e.selection)}}function Ove(n,t){if(t.rangeCount>1)return!1;const e=t.anchor;if(!e||!n.checkChild(e,"softBreak"))return!1;const i=t.getFirstRange(),s=i.start.parent,r=i.end.parent;return!((AI(s,n)||AI(r,n))&&s!==r)}function Dve(n,t,e){const i=e.isCollapsed,s=e.getFirstRange(),r=s.start.parent,o=s.end.parent,a=r==o;if(i){const l=Y4(n.schema,e.getAttributes());SN(n,t,s.end),t.removeSelectionAttribute(e.getAttributeKeys()),t.setSelectionAttribute(l)}else{const l=!(s.start.isAtStart&&s.end.isAtEnd);n.deleteContent(e,{leaveUnmerged:l}),a?SN(n,t,e.focus):l&&t.setSelection(o,0)}}function SN(n,t,e){const i=t.createElement("softBreak");n.insertContent(i,e),t.setSelection(i,"after")}function AI(n,t){return n.is("rootElement")?!1:t.isLimit(n)||AI(n.parent,t)}class Rve extends we{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.model.schema,i=t.conversion,s=t.editing.view,r=s.document,o=this.editor.t;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:l})=>l.createEmptyElement("br")}),s.addObserver(q4),t.commands.add("shiftEnter",new Mve(t)),this.listenTo(r,"enter",(a,l)=>{r.isComposing||l.preventDefault(),l.isSoft&&(t.execute("shiftEnter"),s.scrollToTheSelection())},{priority:"low"}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a soft break (a <code><br></code> element)"),keystroke:"Shift+Enter"}]})}}/** 506 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 507 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 508 */class Lve extends _t{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,s=e.document.selection,r=Array.from(s.getSelectedBlocks()),o=t.forceValue===void 0?!this.value:t.forceValue;e.change(a=>{if(!o)this._removeQuote(a,r.filter(N_));else{const l=r.filter(c=>N_(c)||xN(i,c));this._applyQuote(a,l)}})}_getValue(){const t=this.editor.model.document.selection,e=$i(t.getSelectedBlocks());return!!(e&&N_(e))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=$i(t.getSelectedBlocks());return i?xN(e,i):!1}_removeQuote(t,e){TN(t,e).reverse().forEach(i=>{if(i.start.isAtStart&&i.end.isAtEnd){t.unwrap(i.start.parent);return}if(i.start.isAtStart){const r=t.createPositionBefore(i.start.parent);t.move(i,r);return}i.end.isAtEnd||t.split(i.end);const s=t.createPositionAfter(i.end.parent);t.move(i,s)})}_applyQuote(t,e){const i=[];TN(t,e).reverse().forEach(s=>{let r=N_(s.start);r||(r=t.createElement("blockQuote"),t.wrap(s,r)),i.push(r)}),i.reverse().reduce((s,r)=>s.nextSibling==r?(t.merge(t.createPositionAfter(s)),s):r)}}function N_(n){return n.parent.name=="blockQuote"?n.parent:null}function TN(n,t){let e,i=0;const s=[];for(;i<t.length;){const r=t[i],o=t[i+1];e||(e=n.createPositionBefore(r)),(!o||r.nextSibling!=o)&&(s.push(n.createRange(e,n.createPositionAfter(r))),e=null),i++}return s}function xN(n,t){const e=n.checkChild(t.parent,"blockQuote"),i=n.checkChild(["$root","blockQuote"],t);return e&&i}class Fve extends we{static get pluginName(){return"BlockQuoteEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[sx,Ih]}init(){const t=this.editor,e=t.model.schema;t.commands.add("blockQuote",new Lve(t)),e.register("blockQuote",{inheritAllFrom:"$container"}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(o=>{const a=t.model.document.differ.getChanges();for(const l of a)if(l.type=="insert"){const c=l.position.nodeAfter;if(!c)continue;if(c.is("element","blockQuote")&&c.isEmpty)return o.remove(c),!0;if(c.is("element","blockQuote")&&!e.checkChild(l.position,c))return o.unwrap(c),!0;if(c.is("element")){const u=o.createRangeIn(c);for(const d of u.getItems())if(d.is("element","blockQuote")&&!e.checkChild(o.createPositionBefore(d),d))return o.unwrap(d),!0}}else if(l.type=="remove"){const c=l.position.parent;if(c.is("element","blockQuote")&&c.isEmpty)return o.remove(c),!0}return!1});const i=this.editor.editing.view.document,s=t.model.document.selection,r=t.commands.get("blockQuote");this.listenTo(i,"enter",(o,a)=>
508{if(!s.isCollapsed||!r.value)return;s.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),o.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(o,a)=>{if(a.direction!="backward"||!s.isCollapsed||!r.value)return;const l=s.getLastPosition().parent;l.isEmpty&&!l.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),a.preventDefault(),o.stop())},{context:"blockquote"})}}class Nve extends we{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("blockQuote",()=>{const e=this._createButton(pt);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add("menuBar:blockQuote",()=>{const e=this._createButton(Cr);return e.set({role:"menuitemcheckbox"}),e})}_createButton(t){const e=this.editor,i=e.locale,s=e.commands.get("blockQuote"),r=new t(e.locale),o=i.t;return r.set({label:o("Block quote"),icon:gbe,isToggleable:!0}),r.bind("isEnabled").to(s,"isEnabled"),r.bind("isOn").to(s,"value"),this.listenTo(r,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),r}}class Bve extends we{static get requires(){return[Fve,Nve]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}}/** 509 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 510 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 511 */class Vve extends Gt(){constructor(){super(...arguments);y(this,"_stack",[])}add(e,i){const s=this._stack,r=s[0];this._insertDescriptor(e);const o=s[0];r!==o&&!RA(r,o)&&this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:i})}remove(e,i){const s=this._stack,r=s[0];this._removeDescriptor(e);const o=s[0];r!==o&&!RA(r,o)&&this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:i})}_insertDescriptor(e){const i=this._stack,s=i.findIndex(o=>o.id===e.id);if(RA(e,i[s]))return;s>-1&&i.splice(s,1);let r=0;for(;i[r]&&Hve(i[r],e);)r++;i.splice(r,0,e)}_removeDescriptor(e){const i=this._stack,s=i.findIndex(r=>
vendor: 2,198 bytes, line 511
511r.id===e);s>-1&&i.splice(s,1)}}function RA(n,t){return n&&t&&n.priority==t.priority&&QE(n.classes)==QE(t.classes)}function Hve(n,t){return n.priority>t.priority?!0:n.priority<t.priority?!1:QE(n.classes)>QE(t.classes)}function QE(n){return Array.isArray(n)?n.sort().join(","):n}const zve="ck-widget",AN="ck-widget_selected";function gn(n){return n.is("element")?!!n.getCustomProperty("widget"):!1}function K4(n,t,e={}){if(!n.is("containerElement"))throw new ee("widget-to-widget-wrong-element-type",null,{element:n});return t.setAttribute("contenteditable","false",n),t.addClass(zve,n),t.setCustomProperty("widget",!0,n),n.getFillerOffset=Yve,t.setCustomProperty("widgetLabel",[],n),e.label&&Uve(n,e.label),e.hasSelectionHandle&&qve(n,t),X4(n,t),n}function $ve(n,t,e){if(t.classes&&e.addClass(bn(t.classes),n),t.attributes)for(const i in t.attributes)e.setAttribute(i,t.attributes[i],n)}function Wve(n,t,e){if(t.classes&&e.removeClass(bn(t.classes),n),t.attributes)for(const i in t.attributes)e.removeAttribute(i,n)}function X4(n,t,e=$ve,i=Wve){const s=new Vve;s.on("change:top",(a,l)=>{l.oldDescriptor&&i(n,l.oldDescriptor,l.writer),l.newDescriptor&&e(n,l.newDescriptor,l.writer)});const r=(a,l,c)=>s.add(l,c),o=(a,l,c)=>s.remove(l,c);t.setCustomProperty("addHighlight",r,n),t.setCustomProperty("removeHighlight",o,n)}function Uve(n,t){n.getCustomProperty("widgetLabel").push(t)}function jve(n){return n.getCustomProperty("widgetLabel").reduce((e,i)=>typeof i=="function"?e?e+". "+i():i():e?e+". "+i:i,"")}function J4(n,t,e={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],n),e.withAriaRole!==!1&&t.setAttribute("role","textbox",n),n.isReadOnly||t.setAttribute("tabindex","-1",n),e.label&&t.setAttribute("aria-label",e.label,n),t.setAttribute("contenteditable",n.isReadOnly?"false":"true",n),n.on("change:isReadOnly",(i,s,r)=>{t.setAttribute("contenteditable",r?"false":"true",n),r?t.removeAttribute("tabindex",n):t.setAttribute("tabindex","-1",n)}),n.on("change:isFocused",(i,s,r)=>{r?t.addClass("ck-editor__nested-editable_focused",n):t.removeClass("ck-editor__nested-editable_focused",n)}),X4(n,t),n}function Gve(n,t){const e=n.getSelectedElement();if(e){const i=wa(n);
511if(i)return t.createRange(t.createPositionAt(e,i))}return t.schema.findOptimalInsertionRange(n)}function Yve(){return null}function qve(n,t){const e=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(i){const s=this.toDomElement(i),r=new ea;return r.set("content",Xpe),r.render(),s.appendChild(r.element),s});t.insert(t.createPositionAt(n,0),e),t.addClass(["ck-widget_with-selection-handle"],n)}function wO(n){const t=a=>{const{width:l,paddingLeft:c,paddingRight:u}=a.ownerDocument.defaultView.getComputedStyle(a);return parseFloat(l)-(parseFloat(c)||0)-(parseFloat(u)||0)},e=n.parentElement;if(!e)return 0;let i=t(e);const s=5;let r=0,o=e;for(;isNaN(i);){if(o=o.parentElement,++r>s)return 0;i=t(o)}return i}function Kve(n,t=new tt(n)){const e=wO(n);return e?t.width/e*100:0}const pa="widget-type-around";function bu(n,t,e){return!!n&&gn(n)&&!e.isInline(t)}function Xve(n){return n.closest(".ck-widget__type-around__button")}function Jve(n){return n.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function Zve(n,t){const e=n.closest(".ck-widget");return t.mapDomToView(e)}function wa(n){return n.getAttribute(pa)}const Z4=["before","after"],Qve=new DOMParser().parseFromString(mbe,"image/svg+xml").firstChild,CN="ck-widget__type-around_disabled";class eye extends we{constructor(){super(...arguments);y(this,"_currentFakeCaretModelElement",null)}static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[sx,Ih]}init(){const e=this.editor,i=e.editing.view;this.on("change:isEnabled",(s,r,o)=>{i.change(a=>{for(const l of i.document.roots)o?a.removeClass(CN,l):a.addClass(CN,l)}),o||e.model.change(a=>{a.removeSelectionAttribute(pa)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,i){const s=this.editor,r=s.editing.view,o=s.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);s.execute("insertParagraph",{position:s.model.createPositionAt(e,i
511),attributes:o}),r.focus(),r.scrollToTheSelection()}_listenToIfEnabled(e,i,s,r){this.listenTo(e,i,(...o)=>{this.isEnabled&&s(...o)},r)}_insertParagraphAccordingToFakeCaretPosition(){const s=this.editor.model.document.selection,r=wa(s);if(!r)return!1;const o=s.getSelectedElement();return this._insertParagraph(o,r),!0}_enableTypeAroundUIInjection(){const e=this.editor,i=e.model.schema,s=e.locale.t,r={before:s("Insert paragraph before block"),after:s("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(o,a,l)=>{const c=l.mapper.toViewElement(a.item);c&&bu(c,a.item,i)&&(tye(l.writer,r,c),c.getCustomProperty("widgetLabel").push(()=>this.isEnabled?s("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,i=e.model,s=i.document.selection,r=i.schema,o=e.editing.view;this._listenToIfEnabled(o.document,"arrowKey",(l,c)=>{this._handleArrowKeyPress(l,c)},{context:[gn,"$text"],priority:"high"}),this._listenToIfEnabled(s,"change:range",(l,c)=>{c.directChange&&e.model.change(u=>{u.removeSelectionAttribute(pa)})}),this._listenToIfEnabled(i.document,"change:data",()=>{const l=s.getSelectedElement();if(l){const c=e.editing.mapper.toViewElement(l);if(bu(c,l,r))return}e.model.change(c=>{c.removeSelectionAttribute(pa)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(l,c,u)=>{const d=u.writer;if(this._currentFakeCaretModelElement){const v=u.mapper.toViewElement(this._currentFakeCaretModelElement);v&&(d.removeClass(Z4.map(a),v),this._currentFakeCaretModelElement=null)}const h=c.selection.getSelectedElement();if(!h)return;const f=u.mapper.toViewElement(h);if(!bu(f,h,r))return;const p=wa(c.selection);p&&(d.addClass(a(p),f),this._currentFakeCaretModelElement=h)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(l,c,u)=>{u||e.model.change(d=>{d.removeSelectionAttribute(pa)})});function a(l){return`ck-widget_type-around_show-fake-caret_${l}`}}_handleArrowKeyPress(e,i){const s=this.editor,r=s.model,o=r.document.selection,a=r.schema,l=s.editing.view;if(i.shiftKey)return;const c=i.keyCode,u=Ehe(c,s.locale.contentLanguageDirection),d=l.document.selection.getSelectedElement(),h=s.editing.mapper.toModelElement(d);let f;bu(d,h,a)?f=this._handleArrowKeyPressOnSelectedWidget(u):o.isCollapsed?f=this._handleArrowKeyPressWhenSelectionNextToAWidget(u):i.shiftKey||(f=this._handleArrowKeyPressWhenNonCollapsedSelection(u)),f&&(i.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const s=this.editor.model,r=s.document.selection,o=wa(r);return s.change(a=>{if(o){if(!(o===(e?"after":"before")))return a.removeSelectionAttribute(pa),!0}else return a.setSelectionAttribute(pa,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const i=this.editor,s=i.model,r=s.schema,o=i.plugins.get("Widget"),a=o._getObjectElementNextToSelection(e),l=i.editing.mapper.toViewElement(a);return bu(l,a,r)?(s.change(c=>{o._setSelectionOverElement(a),c.setSelectionAttribute(pa,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){const i=this.editor,s=i.model,r=s.schema,o=i.editing.mapper,a=s.document.selection,l=e?a.getLastPosition().nodeBefore:a.getFirstPosition().nodeAfter,c=o.toViewElement(l);return bu(c,l,r)?(s.change(u=>{u.setSelection(l,"on"),u.setSelectionAttribute(pa,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,i=e.editing.view;this._listenToIfEnabled(i.document,"mousedown",(s,r)=>{const o=Xve(r.domTarget);if(!o)return;const a=Jve(o),l=Zve(o,i.domConverter),c=e.editing.mapper.toModelElement(l);this._insertParagraph(c,a),r.preventDefault(),s.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,i=e.model.document.selection,s=e.editing.view;this._listenToIfEnabled(s.document,"enter",(r,o)=>{if(r.eventPhase!="atTarget")return;const a=i.getSelectedElement(),l=e.editing.mapper.toViewElement(a),c=e.model.schema;let u;this._insertParagraphAccordingToFakeCaretPosition()?u=!0:bu(l,a,c)&&(this._insertParagraph(a,o.isSoft?"before":"after"),u=!0),u&&(o.preventDefault(),r.stop())},{context:gn})}_enableInsertingParagraphsOnTypingKeystroke(){const i=this.editor.editing.view.document;this._listenToIfEnabled(i,"insertText",(s,r)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(r.selection=i.selection)},{priority:"high"}),Ge.isAndroid?this._listenToIfEnabled(i,"keydown",(s,r)=>{r.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(i,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,i=e.editing.view,s=e.model,r=s.schema;this._listenToIfEnabled(i.document,"delete",(o,a)=>
511{if(o.eventPhase!="atTarget")return;const l=wa(s.document.selection);if(!l)return;const c=a.direction,u=s.document.selection.getSelectedElement(),d=l==="before",h=c=="forward";if(d===h)e.execute("delete",{selection:s.createSelection(u,"on")});else{const p=r.getNearestSelectionRange(s.createPositionAt(u,l),c);if(p)if(!p.isCollapsed)s.change(v=>{v.setSelection(p),e.execute(h?"deleteForward":"delete")});else{const v=s.createSelection(p.start);if(s.modifySelection(v,{direction:c}),!v.focus.isEqual(p.start))s.change(E=>{E.setSelection(p),e.execute(h?"deleteForward":"delete")});else{const E=sye(r,p.start.parent);s.deleteContent(s.createSelection(E,"on"),{doNotAutoparagraph:!0})}}}a.preventDefault(),o.stop()},{context:gn})}_enableInsertContentIntegration(){const e=this.editor,i=this.editor.model,s=i.document.selection;this._listenToIfEnabled(e.model,"insertContent",(r,[o,a])=>{if(a&&!a.is("documentSelection"))return;const l=wa(s);if(l)return r.stop(),i.change(c=>{const u=s.getSelectedElement(),d=i.createPositionAt(u,l),h=c.createSelection(d),f=i.insertContent(o,h);return c.setSelection(h),f})},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,s=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(r,o)=>{const[,a,l={}]=o;if(a&&!a.is("documentSelection"))return;const c=wa(s);c&&(l.findOptimalPosition=c,o[3]=l)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,s=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(r,[o])=>{if(o&&!o.is("documentSelection"))return;wa(s)&&r.stop()},{priority:"high"})}}function tye(n,t,e){const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(s){const r=this.toDomElement(s);return nye(r,t),iye(r),r});n.insert(n.createPositionAt(e,"end"),i)}function nye(n,t){for(const e of Z4){const i=new ro({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${e}`],title:t[e],"aria-hidden":"true"},children:[n.ownerDocument.importNode(Qve,!0)]});n.appendChild(i.render())}}function iye(n){const t=new ro({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});n.appendChild(t.render())}function sye(n,t){let e=t;for(const i of t.getAncestors({parentFirst:!0})){if(i.childCount>1||n.isLimit(i))break;e=i}return e}function rye(n){const t=n.model;return(e,i)=>{const s=i.keyCode==ft.arrowup,r=i.keyCode==ft.arrowdown,o=i.shiftKey,a=t.document.selection;if(!s&&!r)return;const l=r,c=oye(n,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(o)return}(c.isCollapsed||aye(n,c,l))&&(t.change(u=>{const d=l?c.end:c.start;if(o){const h=t.createSelection(a.anchor);h.setFocus(d),u.setSelection(h)}else u.setSelection(d)}),e.stop(),i.preventDefault(),i.stopPropagation())}}}function oye(n,t,e){const i=n.model;if(e){const s=t.focus,r=kN(i,s,"forward");if(!r)return;const o=i.createRange(s,r),a=IN(i.schema,o,"backward");if(a)return i.createRange(s,a)}else{const s=t.focus,r=kN(i,s,"backward");if(!r)return;const o=i.createRange(r,s),a=IN(i.schema,o,"forward");if(a)return i.createRange(a,s)}}function kN(n,t,e){const i=n.schema,s=n.createRangeIn(t.root),r=e=="forward"?"elementStart":"elementEnd";for(const{previousPosition:o,item:a,type:l}of s.getWalker({startPosition:t,direction:e})){if(i.isLimit(a)&&!i.isInline(a))return o;if(l==r&&i.isBlock(a))return null}return null}function IN(n,t,e){const i=e=="backward"?t.end:t.start;if(n.checkChild(i,"$text"))return i;for(const{nextPosition:s}of t.getWalker({direction:e}))if(n.checkChild(s,"$text"))return s}function aye(n,t,e){const i=n.model,s=n.view.domConverter;if(e){const c=i.createSelection(t.start);i.modifySelection(c),!c.focus.isAtEnd&&!t.start.isEqual(c.focus)&&(t=i.createRange(c.focus,t.end))}const r=n.mapper.toViewRange(t),o=s.viewRangeToDom(r),a=tt.getDomRangeRects(o);let l;for(const c of a){if(l===void 0){l=Math.round(c.bottom);continue}if(Math.round(c.top)>=l)return!1;l=Math.max(l,Math.round(c.bottom))}return!0}class rx extends we{constructor(){super(...arguments);y(this,"_previouslySelected",new Set)}static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[eye,Ih]}init(){const e=this.editor,i=e.editing.view,s=i.document,r=e.t;this.editor.editing.downcastDispatcher.on("selection",(o,a,l)=>{const c=l.writer,u=a.selection;if(u.isCollapsed)return;const d=u.getSelectedElement();if(!d)return;const h=e.editing.mapper.toViewElement(d);gn(h)&&l.consumable.consume(u,"selection")&&c.setSelection(c.createRangeOn(h),{fake:!0,label:jve(h)})}),this.editor.editing.downcastDispatcher.on("selection",(o,a,l)=>{this._clearPreviouslySelectedWidgets(l.writer);const c=l.writer,u=c.document.selection;let d=null;for(const h of u.getRanges())for(const f of h){const p=f.item;gn(p)&&!hye(p,d)&&(c.addClass(AN,p),this._previouslySelected.add(p),d=p)}},{priority:"low"}),i.addObserver(lO),i.addObserver(l4),this.listenTo(s,"mousedown",(...o)=>this._onMousedown(...o)),this.listenTo(s,"pointerdown",(...o)=>this._onPointerdown(...o)),this.listenTo(s,"arrowKey",(...o)=>
511{this._handleSelectionChangeOnArrowKeyPress(...o)},{context:[gn,"$text"]}),this.listenTo(s,"arrowKey",(...o)=>{this._preventDefaultOnArrowKeyPress(...o)},{context:"$root"}),this.listenTo(s,"arrowKey",rye(this.editor.editing),{context:"$text"}),this.listenTo(s,"delete",(o,a)=>{this._handleDelete(a.direction=="forward")&&(a.preventDefault(),o.stop())},{context:"$root"}),this.listenTo(s,"tab",(o,a)=>{this._selectNextEditable(a.shiftKey?"backward":"forward")&&(i.scrollToTheSelection(),a.preventDefault(),o.stop())},{context:o=>gn(o)||o.is("editableElement"),priority:"low"}),this.listenTo(s,"keydown",(o,a)=>{a.keystroke==ft.esc&&this._selectAncestorWidget()&&(a.preventDefault(),o.stop())},{context:o=>o.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:r("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:r("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:r("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:r("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:r("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:r("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,i){const s=i.target;s&&i.domEvent.detail>=3&&this._selectBlockContent(s)&&i.preventDefault()}_onPointerdown(e,i){if(!i.domEvent.isPrimary)return;const s=this.editor,r=s.editing.view,o=r.document;let a=i.target;if(!a)return;if(!gn(a)){const c=uye(a);if(!c)return;if(gn(c))a=c;else{const u=dye(r,i);if(u&&gn(u))a=u;else return}}(Ge.isAndroid||Ge.isiOS)&&i.preventDefault(),o.isFocused||r.focus();const l=s.editing.mapper.toModelElement(a);this._setSelectionOverElement(l)}_selectBlockContent(e){const i=this.editor,s=i.model,r=i.editing.mapper,o=s.schema,a=r.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),l=fye(r.toModelElement(a),s.schema);return l?(s.change(c=>{const u=o.isLimit(l)?null:gye(c.createPositionAfter(l),o),d=c.createPositionAt(l,0),h=u?c.createPositionAt(u,0):c.createPositionAt(l,"end");c.setSelection(c.createRange(d,h))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,i){const s=i.keyCode,r=this.editor.model,o=r.schema,a=r.document.selection,l=a.getSelectedElement(),c=YM(s,this.editor.locale.contentLanguageDirection),u=c=="down"||c=="right",d=c=="up"||c=="down";if(!i.shiftKey&&!a.isCollapsed){if(lye(a,o)){const A=u?a.getLastPosition():a.getFirstPosition(),O=o.getNearestSelectionRange(A,u?"forward":"backward");O&&(r.change(I=>{I.setSelection(O)}),i.preventDefault(),e.stop())}return}const h=cye(r,u),f=r.createSelection(h);if(r.modifySelection(f,{direction:u?"forward":"backward"}),f.isEqual(h))return;f.focus.isTouching(h.focus)&&r.modifySelection(f,{direction:u?"forward":"backward"});const p=u?h.focus.nodeBefore:h.focus.nodeAfter,v=f.focus.nodeBefore,E=f.focus.nodeAfter,x=u?v:E;if(i.shiftKey)(l&&o.isObject(l)||x&&o.isObject(x)||p&&o.isObject(p))&&(r.change(A=>{A.setSelection(f)}),i.preventDefault(),e.stop());else if(x&&o.isObject(x)){if(o.isInline(x)&&d)return;r.change(A=>{A.setSelection(x,"on")}),i.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,i){const s=this.editor.model,r=s.schema,o=s.document.selection.getSelectedElement();o&&r.isObject(o)&&(i.preventDefault(),e.stop())}_handleDelete(e){const s=this.editor.model.document.selection;if(!this.editor.model.canEditAt(s)||!s.isCollapsed)return;const r=this._getObjectElementNextToSelection(e);if(r)return this.editor.model.change(o=>{let a=s.anchor.parent;for(;a.isEmpty;){const l=a;a=l.parent,o.remove(l)}this._setSelectionOverElement(r)}),!0}_setSelectionOverElement(e){this.editor.model.change(i=>{i.setSelection(i.createRangeOn(e))})}_getObjectElementNextToSelection(e){const i=this.editor.model,s=i.schema,r=i.document.selection,o=i.createSelection(r);if(i.modifySelection(o,{direction:e?"forward":"backward"}),o.isEqual(r))return null;const a=e?o.focus.nodeBefore:o.focus.nodeAfter;return a&&s.isObject(a)?a:null}_clearPreviouslySelectedWidgets(e){for(const i of this._previouslySelected)e.removeClass(AN,i);this._previouslySelected.clear()}_selectNextEditable(e){const i=this.editor.editing,s=i.view,r=this.editor.model,o=s.document.selection,a=r.document.selection;let l;if(a.rangeCount>1){const u=a.isBackward?a.getFirstRange():a.getLastRange();l=i.mapper.toViewPosition(e=="forward"?u.end:u.start)}else l=e=="forward"?o.getFirstPosition():o.getLastPosition();const c=this._findNextFocusRange(l,e);return c?(r.change(u=>{u.setSelection(c)}),!0):!1}_findNextFocusRange(e,i){const s=this.editor.editing,r=s.view,o=this.editor.model,a=r.document.selection,l=a.editableElement,c=l.getPath();let u=a.getSelectedElement();u&&!gn(u)&&(u=null);const d=i=="forward"?r.createRange(e,r.createPositionAt(e.root,"end")):r.createRange(r.createPositionAt(e.root,0),e);for(const{nextPosition:h}of d.getWalker({direction:i})){const f=h.parent;if(gn(f)&&f!=u){const p=s.mapper.toModelElement(f);if(!o.schema.isBlock(p))continue;if(li(c,f.getPath())!="extension")return o.createRangeOn(p)}else if(f.is("editableElement")){if(f==l&&!u)continue;const p=s.mapper.toModelPosition(h),v=o.schema.getNearestSelectionRange(p,i);if(!v)continue;return f==l&&u?v:li(c,f.getPath())!="extension"?o.createRangeIn(o.schema.getLimitElement(v)):v}}return null}_selectAncestorWidget(){const e=this.editor,i=e.editing.mapper,r=e.editing.view.document.selection.getFirstPosition().parent,a=(r.is("$text")?r.parent:r).findAnce
511stor(gn);if(!a)return!1;const l=i.toModelElement(a);/* istanbul ignore next -- @preserve */return l?(e.model.change(c=>{c.setSelection(l,"on")}),!0):!1}}function lye(n,t){const e=n.getFirstPosition(),i=n.getLastPosition(),s=e.nodeAfter,r=i.nodeBefore;return!!s&&t.isObject(s)||!!r&&t.isObject(r)}function cye(n,t){const e=n.document.selection,i=e.getSelectedElement(),s=wa(e);return i&&s=="before"?n.createSelection(i,"before"):i&&s=="after"?n.createSelection(i,"after"):n.createSelection(e.getRanges(),{backward:i&&n.schema.isObject(i)?!t:e.isBackward})}function uye(n){let t=n;for(;t;){if(t.is("editableElement")||gn(t))return t;t=t.parent}return null}function dye(n,t){const e=aW(t.domEvent);let i=null;if(e?i=n.domConverter.domRangeToView(e):i=n.createRange(n.createPositionAt(t.target,0)),!i)return null;const s=i.start;if(!s.parent)return null;let r=s.parent;return s.parent.is("editableElement")&&(s.isAtEnd&&s.nodeBefore?r=s.nodeBefore:s.isAtStart&&s.nodeAfter&&(r=s.nodeAfter)),r.is("$text")?r.parent:r}function hye(n,t){return t?Array.from(n.getAncestors()).includes(t):!1}function fye(n,t){for(const e of n.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(e,"$text"))return e;if(t.isLimit(e)&&!t.isObject(e))break}return null}function gye(n,t){const e=new rl({startPosition:n});for(const{item:i}of e){if(t.isLimit(i)||!i.is("element"))return null;if(t.checkChild(i,"$text"))return i}return null}class e1 extends we{constructor(){super(...arguments);y(this,"_toolbarDefinitions",new Map);y(this,"_balloon")}static get requires(){return[Xb]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const i=e.plugins.get("BalloonToolbar");this.listenTo(i,"show",s=>{mye(e.editing.view.document.selection)&&s.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:i,items:s,getRelatedElement:r,balloonClassName:o="ck-toolbar-container",positions:a}){if(!s.length){Dt("widget-toolbar-no-items",{toolbarId:e});return}const l=this.editor,c=l.t,u=new ex(l.locale);if(u.ariaLabel=i||c("Widget toolbar"),this._toolbarDefinitions.has(e))throw new ee("widget-toolbar-duplicated",this,{toolbarId:e});const d={view:u,getRelatedElement:r,balloonClassName:o,itemsConfig:s,positions:a,initialized:!1};l.ui.addToolbar(u,{isContextual:!0,beforeFocus:()=>{const h=r(l.editing.view.document.selection);h&&this._showToolbar(d,h)},afterBlur:()=>{this._hideToolbar(d)}}),this._toolbarDefinitions.set(e,d)}_updateToolbarsVisibility(){let e=0,i=null,s=null;for(const r of this._toolbarDefinitions.values()){const o=r.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o)this._isToolbarInBalloon(r)&&this._hideToolbar(r);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(r)&&this._hideToolbar(r);else{const a=o.getAncestors().length;a>e&&(e=a,i=o,s=r)}}s&&this._showToolbar(s,i)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,i){this._isToolbarVisible(e)?PN(this.editor,i,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:Q4(this.editor,i,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const s of this._toolbarDefinitions.values())if(this._isToolbarVisible(s)){const r=s.getRelatedElement(this.editor.editing.view.document.selection);PN(this.editor,r,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function PN(n,t,e){const i=n.plugins.get("ContextualBalloon"),s=Q4(n,t,e);i.updatePosition(s)}function Q4(n,t,e){const i=n.editing.view,s=jc.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:e||[s.northArrowSouth,s.northArrowSouthWest,s.northArrowSouthEast,s.southArrowNorth,s.southArrowNorthWest,s.southArrowNorthEast,s.viewportStickyNorth]}}function mye(n){const t=n.getSelectedElement();return!!(t&&gn(t))}class pye extends Ut(){constructor(e){super();y(this,"_referenceCoordinates");y(this,"_options");y(this,"_originalWidth");y(this,"_originalHeight");y(this,"_originalWidthPercents");y(this,"_aspectRatio");this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,i,s){const r=new tt(i);this.activeHandlePosition=vye(e),this._referenceCoordinates=bye(i,yye(this.activeHandlePosition)),this._originalWidth=r.width,this._originalHeight=r.height,this._aspectRatio=r.width/r.height;const o=s.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(o):this._originalWidthPercents=Kve(s,r)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function bye(n,t){const e=new tt(n),i=t.split("-"),s={x:i[1]=="right"?e.right:e.left,y:i[0]=="bottom"?e.bottom:e.top};return s.x+=n.ownerDocument.defaultView.scrollX,s.y+=n.ownerDocument.defaultView.scrollY,s}function wye(n){return`ck-widget__resizer__handle-${n}`}function vye(n){const t=["top-left","top-right","bottom-right","bottom-left"];for(const e of t)if(n.classList.contains(wye(e)))return e}function yye(n){const t=n.split("-"),e={top:"bottom",bottom:"top",left:"r
511ight",right:"left"};return`${e[t[0]]}-${e[t[1]]}`}class _ye extends Ye{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:t.if("_isVisible","none",e=>!e)}},children:[{text:t.to("_label")}]})}_bindToState(t,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",(i,s)=>i!==null&&s!==null),this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(i,s,r)=>t.unit==="px"?`${i}Ã${s}`:`${r}%`),this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",(i,s,r)=>s<50||r<50?"above-center":i)}_dismiss(){this.unbind(),this._isVisible=!1}}class MN extends Ut(){constructor(e){super();y(this,"_state");y(this,"_sizeView");y(this,"_options");y(this,"_viewResizerWrapper",null);y(this,"_initialViewWidth");this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(i,s)=>i&&s),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",i=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),i.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(i=>{i.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(i=>{i.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){const e=this,i=this._options.viewElement;this._options.editor.editing.view.change(r=>{const o=r.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(a){const l=this.toDomElement(a);return e._appendHandles(l),e._appendSizeUI(l),l});r.insert(r.createPositionAt(i,"end"),o),r.addClass("ck-widget_with-resizer",i),this._viewResizerWrapper=o,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new pye(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const i=this._proposeNewSize(e);this._options.editor.editing.view.change(u=>{const d=this._options.unit||"%",h=(d==="%"?i.widthPercents:i.width)+d;u.setStyle("width",h,this._options.viewElement)});const r=this._getHandleHost(),o=new tt(r),a=Math.round(o.width),l=Math.round(o.height),c=new tt(r);i.width=Math.round(c.width),i.height=Math.round(c.height),this.redraw(o),this.state.update({...i,handleHostWidth:a,handleHostHeight:l})}commit(){const e=this._options.unit||"%",i=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(i)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const i=this._domResizerWrapper;if(!Tye(i))return;const s=i.parentElement,r=this._getHandleHost(),o=this._viewResizerWrapper,a=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let l;if(s.isSameNode(r)){const c=e||new tt(r);l=[c.width+"px",c.height+"px",void 0,void 0]}else l=[r.offsetWidth+"px",r.offsetHeight+"px",r.offsetLeft+"px",r.offsetTop+"px"];li(a,l)!=="same"&&this._options.editor.editing.view.change(c=>{c.setStyle({width:l[0],height:l[1],left:l[2],top:l[3]},o)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(i=>{i.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const i=this.state,s=Sye(e),r=this._options.isCentered?this._options.isCentered(this):!0,o={x:i._referenceCoordinates.x-(s.x+i.originalWidth),y:s.y-i.originalHeight-i._referenceCoordinates.y};r&&i.activeHandlePosition.endsWith("-right")&&(o.x=s.x-(i._referenceCoordinates.x+i.originalWidth)),r&&(o.x*=2);let a=Math.abs(i.originalWidth+o.x),l=Math.abs(i.originalHeight+o.y);return(a/i.aspectRatio>l?"width":"height")=="width"?l=a/i.aspectRatio:a=l*i.aspectRatio,{width:Math.round(a),height:Math.round(l),widthPercents:Math.min(Math.round(i.originalWidthPercents/i.originalWidth*a*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const i=["top-left","top-right","bottom-right","bottom-left"];for(const s of i)e.appendChild(new ro({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Eye(s)}`}}).render())}_appendSizeUI(e){this._sizeView=new _ye,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Eye(n){return`ck-widget__resizer__handle-${n}`}function Sye(n){return{x:n.pageX,y:n.pageY}}function Tye(n){return n&&n.ownerDocument&&n.ownerDocument.contains(n)}class LA extends we{constructor(){super(...arguments);y(this,"_resizers",new Map);y(this,"_observer");y(this,"_redrawSelectedResizerThrottled")}static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,i=Ie.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(lO),this._observer=new(Qs()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(i,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(i,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=Vb(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[r,o]of this._resizers)r.isAttached()||(this._resizers.delete(r),o.destroy())},{priority:"lowest"}),this._observer.listenTo(Ie.window,"resize",this._redrawSelectedResizerThrottled);const s=this.editor.editing.view.document.selection;s.on("change",()=>{const r=s.getSelectedElement(),o=this.getResizerByViewElement(r)||null;o?this.select(o):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const i=new MN(e),s=this.editor.plugins;if(i.attach(),s.has("WidgetToolbarRepository")){const a=s.get("WidgetToolbarRepository");i.on("begin",()=>{a.forceDisabled("resize")},{priority:"lowest"}),i.on("cancel",()=>{a.clearForceDisabled("resize")},{priority:"highest"}),i.on("commit",()=>{a.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,i);const o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==i&&this.select(i),i}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const i of this._resizers.values())if(i.containsHandle(e))return i}_mouseDownListener(e,i){const s=i.domTarget;MN.isResizeHandle(s)&&(this._activeResizer=this._getResizerByHandle(s)||null,this._activeResizer&&(this._activeResizer.begin(s),e.stop(),i.preventDefault()))}_mouseMoveListener(e,i){this._activeResizer&&this._activeResizer.updateSize(i)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}/** 512 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 513 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 514 */class Jb extends sa{constructor(e){super(e);y(this,"domEventType",["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"]);const i=this.document;this.listenTo(i,"paste",s("clipboardInput"),{priority:"low"}),this.listenTo(i,"drop",s("clipboardInput"),{priority:"low"}),this.listenTo(i,"dragover",s("dragging"),{priority:"low"});function s(r){return(o,a)=>{a.preventDefault();const l=a.dropRange?[a.dropRange]:null,c=new bl(i,r);i.fire(c,{dataTransfer:a.dataTransfer,method:o.name,targetRanges:l,target:a.target,domEvent:a.domEvent}),c.stop.called&&a.stopPropagation()}}}onDomEvent(e){const i="clipboardData"in e?e.clipboardData:e.dataTransfer,s=e.type=="drop"||e.type=="paste",r={dataTransfer:new MW(i,{cacheFiles:s})};if(e.type=="drop"||e.type=="dragover"){const o=aW(e);r.dropRange=o&&this.view.domConverter.domRangeToView(o)}this.fire(e.type,e,r)}}/** 515 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 516 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 517 */function xye(n){return n=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," "),(n.includes("</p><p>")||n.includes("<br>"))&&(n=`<p>${n}</p>`),n}/** 518 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 519 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 520 */function Aye(n){return n.replace(/<span(?: class="Apple-converted-s
520pace"|)>(\s+)<\/span>/g,(t,e)=>e.length==1?" ":e).replace(/<!--[\s\S]*?-->/g,"")}/** 521 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 522 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 523 */const ON=["figcaption","li"],DN=["ol","ul"];function eU(n,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return` 524`;let e="",i=null;for(const s of t.getChildren())e+=Cye(s,i)+eU(n,s),i=s;if(t.is("rawElement")){const r=document.implementation.createHTMLDocument("").createElement("div");t.render(r,n),e+=tU(r)}return e}function tU(n){let t="";if(n.nodeType===Node.TEXT_NODE)return n.textContent;if(n.tagName==="BR")return` 525`;for(const e of n.childNodes)t+=tU(e);return t}function Cye(n,t){return t?n.is("element","li")&&!n.isEmpty&&n.getChild(0).is("containerElement")||DN.includes(n.name)&&DN.includes(t.name)?` 526 527`:!n.is("containerElement")&&!t.is("containerElement")?"":ON.includes(n.name)||ON.includes(t.name)?` 528`:n.is("element")&&n.getCustomProperty("dataPipeline:transparentRendering")||t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")?"":` 529 530`:""}class mb extends we{constructor(){super(...arguments);y(this,"_markersToCopy",new Map)}static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,i){this._markersToCopy.set(e,i)}_copySelectedFragmentWithMarkers(e,i,s=r=>r.model.getSelectedContent(r.model.document.selection)){return this.editor.model.change(r=>{const o=r.model.document.selection;r.setSelection(i);const a=this._insertFakeMarkersIntoSelection(r,r.model.document.selection,e),l=s(r),c=this._removeFakeMarkersInsideElement(r,l);for(const[u,d]of Object.entries(a)){c[u]||(c[u]=r.createRangeIn(l));for(const h of d)r.remove(h)}l.markers.clear();for(const[u,d]of Object.entries(c))l.markers.set(u,d);return r.setSelection(o),l})}_pasteMarkersIntoTransformedElement(e,i){const s=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(r=>{const o=this._insertFakeMarkersElements(r,s),a=i(r),l=this._removeFakeMarkersInsideElement(r,a);for(const c of Object.values(o).flat())r.remove(c);for(const[c,u]of Object.entries(l))r.model.markers.has(c)||r.addMarker(c,{usingOperation:!0,affectsData:!0,range:u});return a})}_pasteFragmentWithMarkers(e){const i=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const s of i)e.markers.set(s.name,s.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,i,s={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const r=this._markersToCopy.get(e);this._markersToCopy.set(e,s),i(),r?this._markersToCopy.set(e,r):this._markersToCopy.delete(e)}_isMarkerCopyable(e,i){const s=this._getMarkerClipboardConfig(e);if(!s)return!1;if(!i)return!0;const{allowedActions:r}=s;return r==="all"||r.includes(i)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[i]=e.split(":");return this._markersToCopy.get(i)||null}_insertFakeMarkersIntoSelection(e,i,s){const r=this._getCopyableMarkersFromSelection(e,i,s);return this._insertFakeMarkersElements(e,r)}_getCopyableMarkersFromSelection(e,i,s){const r=Array.from(i.getRanges()),o=new Set(r.flatMap(l=>Array.from(e.model.markers.getMarkersIntersectingRange(l)))),a=l=>{if(!this._isMarkerCopyable(l.name,s))return!1;const{copyPartiallySelected:u}=this._getMarkerClipboardConfig(l.name);if(!u){const d=l.getRange();return r.some(h=>h.containsRange(d,!0))}return!0};return Array.from(o).filter(a).map(l=>({name:s==="dragstart"?this._getUniqueMarkerName(l.name):l.name,range:l.getRange()}))}_getPasteMarkersFromRangeMap(e,i=null){const{model:s}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([o,a])=>{if(!this._hasMarkerConfiguration(o))return[{name:o,range:a}];if(this._isMarkerCopyable(o,i)){const l=this._getMarkerClipboardConfig(o),c=s.markers.has(o)&&s.markers.get(o).getRange().root.rootName==="$graveyard";return(l.duplicateOnPaste||c)&&(o=this._getUniqueMarkerName(o)),[{name:o,range:a}]}return[]})}_insertFakeMarkersElements(e,i){const s={},r=i.flatMap(o=>{const{start:a,end:l}=o.range;return[{position:a,marker:o,type:"start"},{position:l,marker:o,type:"end"}]}).sort(({position:o},{position:a})=>o.isBefore(a)?1:-1);for(const{position:o,marker:a,type:l}of r){const c=e.createElement("$marker",{"data-name":a.name,"data-type":l});s[a.name]||(s[a.name]=[]),s[a.name].push(c),e.insert(c,o)}return s}_removeFakeMarkersInsideElement(e,i){const r=this._getAllFakeMarkersFromElement(e,i).reduce((o,a)=>{const l=a.markerElement&&e.createPositionBefore(a.markerElement);let c=o[a.name],u=!1;return c!=null&&c.start&&(c!=null&&c.end)&&(this._getMarkerClipboardConfig(a.name).duplicateOnPaste?o[this._getUniqueMarkerName(a.name)]=o[a.name]:u=!0,c=null),u||(o[a.name]={...c,[a.type]:l}),a.markerElement&&e.remove(a.markerElement),o},{});return wde(r,o=>new oe(o.start||e.createPositionFromPath(i,[0]),o.end||e.createPositionAt(i,"end")))}_getAllFakeMarkersFromElement(e,i){const s=Array.from(e.createRangeIn(i)).flatMap(({item:a})=>{if(!a.is("element","$marker"))return[];const l=a.getAttribute("data-name"),c=a.getAttribute("data-type");return[{markerElement:a,name:l,type:c}]}),r=[],o=[];for(const a of s)a.type==="end"&&(s.some(c=>c.name===a.name&&c.type==="start")||r.push({markerElement:null,name:a.name,type:"start"})),a.type==="start"&&(s.some(c=>c.name===a.name&&c.type==="end")||o.unshift({markerElement:null,name:a.name,type:"end"}));return[...r,...s,...o]}_getUniqueMarkerName(e){const i=e.split(":"),s=is().substring(1,6);return i.length===3?`${i.slice(0,2).join(":")}:${s}`:`${i.join(":")}:${s}`}}class Er extends we{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[mb]}init(){this.editor.editing.view.addObserver(Jb),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(t,e,i){const s=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:i==="cut"},()=>{const r=s._copySelectedFragmentWithMarkers(i,e);this.fire("outputTransformation",{dataTransfer:t,content:r,method:i})})}_setupPasteDrop(){const t=this.editor,e=t.model,i=t.editing.view,s=i.document,r=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(s,"clipboardInput",(o,a)=>{a.method=="paste"&&!t.model.canEditAt(t.model.document.selection)&&o.stop()},{priority:"highest"}),this.listenTo(s,"clipboardInput",(o,a)=>{const l=a.dataTransfer;let c;if(a.content)c=a.content;else{let h="";l.getData("text/html")?h=Aye(l.getData("text/html")):l.getData("text/plain")&&(h=xye(l.getData("text/plain"))),c=this.editor.data.htmlProcessor.toView(h)}const u=new bl(this,"inputTransformation"),d=l.getData("application/ckeditor5-editor-id")||null;this.fire(u,{content:c,dataTransfer:l,sourceEditorId:d,targetRanges:a.targetRanges,method:a.method}),u.stop.called&&o.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(o,a)=>
vendor: 12,139 bytes, line 530
530{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(o.stop(),e.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,sourceEditorId:a.sourceEditorId,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(o,a)=>{a.resultRange=r._pasteFragmentWithMarkers(a.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,s=t.editing.view.document,r=(o,a)=>{const l=a.dataTransfer;a.preventDefault(),this._fireOutputTransformationEvent(l,e.selection,o.name)};this.listenTo(s,"copy",r,{priority:"low"}),this.listenTo(s,"cut",(o,a)=>{t.model.canEditAt(t.model.document.selection)?r(o,a):a.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(o,a)=>{const l=t.data.toView(a.content,{isClipboardPipeline:!0});s.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:l,method:a.method})},{priority:"low"}),this.listenTo(s,"clipboardOutput",(o,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",eU(t.data.htmlProcessor.domConverter,a.content)),a.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),a.method=="cut"&&t.model.deleteContent(e.selection)},{priority:"low"})}}const FA=Ry("px");class kye extends Ye{constructor(){super();const t=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",t.if("isVisible","ck-hidden",e=>!e)],style:{left:t.to("left",e=>FA(e)),top:t.to("top",e=>FA(e)),width:t.to("width",e=>FA(e))}}})}}class B_ extends we{constructor(){super(...arguments);y(this,"removeDropMarkerDelayed",qM(()=>this.removeDropMarker(),40));y(this,"_updateDropMarkerThrottled",Vb(e=>this._updateDropMarker(e),40));y(this,"_reconvertMarkerThrottled",Vb(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0));y(this,"_dropTargetLineView",new kye);y(this,"_domEmitter",new(Qs()));y(this,"_scrollables",new Map)}static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,i,s,r,o,a){this.removeDropMarkerDelayed.cancel();const l=RN(this.editor,e,i,s,r,o,a);/* istanbul ignore next -- @preserve */return l?a&&a.containsRange(l)?(this.removeDropMarker(),null):l&&!this.editor.model.canEditAt(l)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(l),l):null}getFinalDropRange(e,i,s,r,o,a){const l=RN(this.editor,e,i,s,r,o,a);return this.removeDropMarker(),l}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(i=>{i.removeMarker("drop-target")})}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(i,{writer:s})=>{if(e.model.schema.checkChild(i.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(s);i.markerRange.isCollapsed?this._updateDropTargetLine(i.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const i=this.editor,s=i.model.markers;i.model.change(r=>{s.has("drop-target")?s.get("drop-target").getRange().isEqual(e)||r.updateMarker("drop-target",{range:e}):r.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(i){const s=this.toDomElement(i);return s.append("â ",i.createElement("span"),"â "),s})}_updateDropTargetLine(e){const i=this.editor.editing,s=e.start.nodeBefore,r=e.start.nodeAfter,o=e.start.parent,a=s?i.mapper.toViewElement(s):null,l=a?i.view.domConverter.mapViewToDom(a):null,c=r?i.mapper.toViewElement(r):null,u=c?i.view.domConverter.mapViewToDom(c):null,d=i.mapper.toViewElement(o);if(!d)return;const h=i.view.domConverter.mapViewToDom(d),f=this._getScrollableRect(d),{scrollX:p,scrollY:v}=Ie.window,E=l?new tt(l):null,x=u?new tt(u):null,A=new tt(h).excludeScrollbarsAndBorders(),O=E?E.bottom:A.top,I=x?x.top:A.bottom,T=Ie.window.getComputedStyle(h),P=O<=I?(O+I)/2:I;if(f.top<P&&P<f.bottom){const k=A.left+parseFloat(T.paddingLeft),D=A.right-parseFloat(T.paddingRight),U=Math.max(k+p,f.left),Y=Math.min(D+p,f.right);this._dropTargetLineView.set({isVisible:!0,left:U,top:P+v,width:Y-U})}else this._dropTargetLineView.isVisible=!1}_getScrollableRect(e){const i=e.root.rootName;let s;if(this._scrollables.has(i))s=this._scrollables.get(i).domElement;else{const r=this.editor.editing.view.domConverter.mapViewToDom(e);s=Pye(r),this._domEmitter.listenTo(s,"scroll",this._reconvertMarkerThrottled,{usePassive:!0});const o=new WM(s,this._reconvertMarkerThrottled);this._scrollables.set(i,{domElement:s,resizeObserver:o})}return new tt(s).excludeScrollbarsAndBorders()}}function RN(n,t,e,i,s,r,o){const a=n.model,l=n.editing.mapper;let u=LN(n,t);for(;u;){if(!r){if(a.schema.checkChild(u,"$text")){if(e){const d=e[0].start,h=l.toModelPosition(d);if(!o||Array.from(o.getItems({shallow:!0})).some(p=>a.schema.checkChild(h,p))){if(a.schema.checkChild(h,"$text"))return a.createRange(h);if(d)return V_(n,LN(n,d.parent),i,s)}}}else if(a.schema.isInline(u))return V_(n,u,i,s)}if(a.schema.isBlock(u))return V_(n,u,i,s);if(a.schema.checkChild(u,"$block")){const d=Array.from(u.getChildren()).filter(p=>p.is("element")&&!Iye(n,p));let h=0,f=d.length;if(f==0)return a.createRange(a.createPositionAt(u,"end"));for(;h<f-1;){const p=Math.floor((h+f)/2);nU(n,d[p],i,s)=="before"?f=p:h=p}return V_(n,d[h],i,s)}u=u.parent}return null}function Iye(n,t){const e=n.editing.mapper,i=n.editing.view.domConverter,s=e.toViewElement(t);if(!s)return!0;const r=i.mapViewToDom(s);return Ie.window.getComputedStyle(r).float!="none"}function V_(n,t,e,i){const s=n.model;return s.createRange(s.createPositionAt(t,nU(n,t,e,i)))}function nU(n,t,e,i){const s=n.editing.mapper,r=n.editing.view.domConverter,o=s.toViewElement(t),a=r.mapViewToDom(o),l=new tt(a);return n.model.schema.isInline(t)?e<(l.left+l.right)/2?"before":"after":i<(l.top+l.bottom)/2?"before":"after"}function LN(n,t){const e=n.editing.mapper,i=n.editing.view,s=e.toModelElement(t);if(s)return s;const r=i.createPositionBefore(t),o=e.findMappedViewAncestor(r);return e.toModelElement(o)}function Pye(n){let t=n;do{t=t.parentElement;const e=Ie.window.getComputedStyle(t).overflowY;if(e=="auto"||e=="scroll")break}while(t.tagName!="BODY");return t}class Mye extends we{constructor(){super(...arguments);y(this,"_isBlockDragging",!1);y(this,"_domEmitter",new(Qs()))}static get pluginName(){return"DragDropBlockToolbar"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(this.listenTo(e,"change:isReadOnly",(i,s,r)=>{r?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),Ge.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const s=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(s,"dragstart",(r,o)=>this._handleBlockDragStart(o)),this._domEmitter.listenTo(Ie.document,"dragover",(r,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(Ie.document,"drop",(r,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(Ie.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&s.setAttribute("draggable","true"),this.on("change:isEnabled",(r,o,a)=>{s.setAttribute("draggable",a?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const i=this.editor.model,s=i.document.selection,r=this.editor.editing.view,o=Array.from(s.getSelectedBlocks()),a=i.createRange(i.createPositionBefore(o[0]),i.createPositionAfter(o[o.length-1]));i.change(l=>l.setSelection(a)),this._isBlockDragging=!0,r.focus(),r.getObserver(Jb).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const i=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),s=e.clientY,r=document.elementFromPoint(i,s),o=this.editor.editing.view;!r||!r.closest(".ck-editor__editable")||o.getObserver(Jb).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:r,clientX:i,clientY:s,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}class Oye extends we{constructor(){super(...arguments);y(this,"_draggedRange");y(this,"_draggingUid");y(this,"_draggableElement");y(this,"_clearDraggableAttributesDelayed",qM(()=>this._clearDraggableAttributes(),40));y(this,"_blockMode",!1);y(this,"_domEmitter",new(Qs()));y(this,"_previewContainer")}static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[Er,rx,B_,Mye]}init(){const e=this.editor,i=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,i.addObserver(Jb),i.addObserver(l4),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(s,r,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(s,r,o)=>{o||this._finalizeDragging(!1)}),Ge.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,i=e.model,s=e.editing.view,r=s.document,o=e.plugins.get(B_);this.listenTo(r,"dragstart",(a,l)=>{var E;if((E=l.target)!=null&&E.is("editableElement")){l.preventDefault();return}if(this._prepareDraggedRange(l.target),!this._draggedRange){l.preventDefault();return}this._draggingUid=is();const c=this.isEnabled&&e.model.canEditAt(this._draggedRange);l.dataTransfer.effectAllowed=c?"copyMove":"copy",l.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const u=i.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(l.dataTransfer,u,"dragstart");const{dataTransfer:h,domTarget:f,domEvent:p}=l,{clientX:v}=p;this._updatePreview({dataTransfer:h,domTarget:f,clientX:v}),l.stopPropagation(),c||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(r,"dragend",(a,l)=>{this._finalizeDragging(!l.dataTransfer.isCanceled&&l.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(Ie.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(r,"dragenter",()=>{this.isEnabled&&s.focus()}),this.listenTo(r,"dragleave",()=>{o.removeDropMarkerDelayed()}),this.listenTo(r,"dragging",(a,l)=>{if(!this.isEnabled){l.dataTransfer.dropEffect="none";return}const{clientX:c,clientY:u}=l.domEvent;if(!o.updateDropMarker(l.target,l.targetRanges,c,u,this._blockMode,this._draggedRange)){l.dataTransfer.dropEffect="none";return}this._draggedRange||(l.dataTransfer.dropEffect="copy"),Ge.isGecko||(l.dataTransfer.effectAllowed=="copy"?l.dataTransfer.dropEffect="copy":["all","copyMove"].includes(l.dataTransfer.effectAllowed)&&(l.dataTransfer.dropEffect="move")),a.stop()},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,s=e.editing.view.document,r=e.plugins.get(B_);this.listenTo(s,"clipboardInput",(o,a)=>
530{if(a.method!="drop")return;const{clientX:l,clientY:c}=a.domEvent,u=r.getFinalDropRange(a.target,a.targetRanges,l,c,this._blockMode,this._draggedRange);if(!u){this._finalizeDragging(!1),o.stop();return}if(this._draggedRange&&this._draggingUid!=a.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),FN(a.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(u,!0)){this._finalizeDragging(!1),o.stop();return}a.targetRanges=[e.editing.mapper.toViewRange(u)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(Er);e.on("contentInsertion",(i,s)=>{if(!this.isEnabled||s.method!=="drop")return;const r=s.targetRanges.map(o=>this.editor.editing.mapper.toModelRange(o));this.editor.model.change(o=>o.setSelection(r))},{priority:"high"}),e.on("contentInsertion",(i,s)=>{if(!this.isEnabled||s.method!=="drop")return;const r=FN(s.dataTransfer)=="move",o=!s.resultRange||!s.resultRange.isCollapsed;this._finalizeDragging(o&&r)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,i=e.editing.view,s=i.document;this.listenTo(s,"pointerdown",(r,o)=>{if(Ge.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let a=NN(o.target);if(Ge.isBlink&&!e.isReadOnly&&!a&&!s.selection.isCollapsed){const l=s.selection.getSelectedElement();(!l||!gn(l))&&(a=s.selection.editableElement)}a&&(i.change(l=>{l.setAttribute("draggable","true",a)}),this._draggableElement=e.editing.mapper.toModelElement(a))}),this.listenTo(s,"pointerup",()=>{Ge.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(i=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&i.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){const i=this.editor,s=i.model;i.plugins.get(B_).removeDropMarker(),this._clearDraggableAttributes(),i.plugins.has("WidgetToolbarRepository")&&i.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&s.change(o=>{const a=s.createSelection(this._draggedRange);s.deleteContent(a,{doNotAutoparagraph:!0});const l=a.getFirstPosition().parent;l.isEmpty&&!s.schema.checkChild(l,"$text")&&s.schema.checkChild(l,"paragraph")&&o.insertElement("paragraph",l,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const i=this.editor,s=i.model,r=s.document.selection,o=e?NN(e):null;if(o){const u=i.editing.mapper.toModelElement(o);this._draggedRange=js.fromRange(s.createRangeOn(u)),this._blockMode=s.schema.isBlock(u),i.plugins.has("WidgetToolbarRepository")&&i.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(r.isCollapsed&&!r.getFirstPosition().parent.isEmpty)return;const a=Array.from(r.getSelectedBlocks()),l=r.getFirstRange();if(a.length==0){this._draggedRange=js.fromRange(l);return}const c=iU(s,a);if(a.length>1)this._draggedRange=js.fromRange(c),this._blockMode=!0;else if(a.length==1){const u=l.start.isTouching(c.start)&&l.end.isTouching(c.end);this._draggedRange=js.fromRange(u?c:l),this._blockMode=u}s.change(u=>u.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:i,clientX:s}){const r=this.editor.editing.view,o=r.document.selection.editableElement,a=r.domConverter.mapViewToDom(o),l=Ie.window.getComputedStyle(a);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Rr(Ie.document,"div",{style:"position: fixed; left: -999999px;"}),Ie.document.body.appendChild(this._previewContainer));const c=Rr(Ie.document,"div");c.className="ck ck-content ck-clipboard-preview";const u=new tt(a),d=parseFloat(l.paddingLeft),h=parseFloat(l.paddingRight),f=parseFloat(l.width)-d-h;if(a.contains(i))if(Ge.isiOS)c.style.maxWidth=`${f}px`,c.style.padding="10px",c.style.minWidth="200px",c.style.minHeight="20px",c.style.boxSizing="border-box",c.style.backgroundColor="var(--ck-color-base-background)";else return;else if(Ge.isiOS)c.style.width=`${f}px`,c.style.backgroundColor="var(--ck-color-base-background)";else{const p=u.left-s+d;c.style.width=`${f+p}px`,c.style.paddingLeft=`${p}px`}r.domConverter.setContentOf(c,e.getData("text/html")),e.setDragImage(c,0,0),this._previewContainer.appendChild(c)}}function FN(n){return Ge.isGecko?n.dropEffect:["all","copyMove"].includes(n.effectAllowed)?"move":"copy"}function NN(n){if(n.is("editableElement"))return null;
530if(n.hasClass("ck-widget__selection-handle"))return n.findAncestor(gn);if(gn(n))return n;const t=n.findAncestor(e=>gn(e)||e.is("editableElement"));return gn(t)?t:null}function iU(n,t){const e=t[0],i=t[t.length-1],s=e.getCommonAncestor(i),r=n.createPositionBefore(e),o=n.createPositionAfter(i);if(s&&s.is("element")&&!n.schema.isLimit(s)){const a=n.createRangeOn(s),l=r.isTouching(a.start),c=o.isTouching(a.end);if(l&&c)return iU(n,[s])}return n.createRange(r,o)}class Dye extends we{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[Er]}init(){const t=this.editor,e=t.model,i=t.editing.view,s=e.document.selection;i.addObserver(Jb),t.plugins.get(Er).on("contentInsertion",(r,o)=>{Rye(o.content,e)&&e.change(a=>{const l=Array.from(s.getAttributes()).filter(([u])=>e.schema.getAttributeProperties(u).isFormatting);s.isCollapsed||e.deleteContent(s,{doNotAutoparagraph:!0}),l.push(...s.getAttributes());const c=a.createRangeIn(o.content);for(const u of c.getItems())for(const d of l)e.schema.checkAttribute(u,d[0])&&a.setAttribute(d[0],d[1],u)})})}}function Rye(n,t){let e=t.createRangeIn(n);if(n.childCount==1){const i=n.getChild(0);i.is("element")&&t.schema.isBlock(i)&&!t.schema.isObject(i)&&!t.schema.isLimit(i)&&(e=t.createRangeIn(i))}for(const i of e.getItems())if(!t.schema.isInline(i)||Array.from(i.getAttributeKeys()).find(r=>t.schema.getAttributeProperties(r).isFormatting))return!1;return!0}class sU extends we{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[mb,Er,Oye,Dye]}init(){const t=this.editor,e=this.editor.t;t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Copy selected content"),keystroke:"CTRL+C"},{label:e("Paste content"),keystroke:"CTRL+V"},{label:e("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}/** 531 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 532 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 533 */class Lye extends qwe{constructor(e,i){super(e);y(this,"view");y(this,"_toolbarConfig");y(this,"_elementReplacer");this.view=i,this._toolbarConfig=R4(e.config.get("toolbar")),this._elementReplacer=new nhe,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const i=this.editor,s=this.view,r=i.editing.view,o=s.editable,a=r.document.getRoot();o.name=a.rootName,s.render();const l=o.element;this.setEditableElement(o.name,l),s.editable.bind("isFocused").to(this.focusTracker),r.attachDomRoot(l),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),s.menuBarView&&this.initMenuBar(s.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,i=this.editor.editing.view;this._elementReplacer.restore(),i.getDomRoot(e.editable.name)&&i.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({visualTop:i})=>i||0),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,i=e.editing.view,s=i.document.getRoot(),r=e.sourceElement;let o;const a=e.config.get("placeholder");a&&(o=typeof a=="string"?a:a[this.view.editable.name]),!o&&r&&r.tagName.toLowerCase()==="textarea"&&(o=r.getAttribute("placeholder")),o&&(s.placeholder=o),wW({view:i,element:s,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:e}=this.view,i=this.editor.plugins.get("ContextualBalloon");i.on("getPositionOptions",r=>{const o=r.return;if(!o||!e.isSticky||!e.element)return;const a=new tt(e.element).height,l=typeof o.target=="function"?o.target():o.target,c=typeof o.limiter=="function"?o.limiter():o.limiter;if(l&&c&&new tt(l).height>=new tt(c).height-a)return;const u={...o.viewportOffsetConfig},d=(u.top||0)+a;r.return={...o,viewportOffsetConfig:{...u,top:d}}},{priority:"low"});const s=()=>{i.visibleView&&i.updatePosition()};this.listenTo(e,"change:isSticky",s),this.listenTo(this.editor.ui,"change:viewportOffset",s)}_handleScrollToTheSelectionWithStickyPanel(e,i,s){const r=this.view.stickyPanel;if(r.isSticky){const o=new tt(r.element).height;i.viewportOffset.top+=o}else{const o=()=>{this.editor.editing.view.scrollToTheSelection(s)};this.listenTo(r,"change:isSticky",o),setTimeout(()=>{this.stopListening(r,"change:isSticky",o)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",()=>{const s=i.view;s.on("moveTo",(r,o)=>{if(!e.isSticky||s.wasMoved||s.isModal)return;const a=new tt(e.contentPanelElement);o[1]<a.bottom+Kb.defaultOffset&&(o[1]=a.bottom+Kb.defaultOffset)},{priority:"high"})},{priority:"low"})}}class Fye extends Xwe{constructor(e,i,s={}){super(e);y(this,"stickyPanel");y(this,"toolbar");y(this,"editable");
533this.stickyPanel=new tve(e),this.toolbar=new ex(e,{shouldGroupWhenFull:s.shouldToolbarGroupWhenFull}),s.useMenuBar&&(this.menuBarView=new rve(e)),this.editable=new Zwe(e,i,void 0,{label:s.label})}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Nye extends zpe(rf){constructor(e,i={}){if(!Y0(e)&&i.initialData!==void 0)throw new ee("editor-create-initial-data",null);super(i);y(this,"ui");this.config.define("menuBar.isVisible",!1),this.config.get("initialData")===void 0&&this.config.set("initialData",Bye(e)),Y0(e)&&(this.sourceElement=e),this.model.document.createRoot();const s=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=this.config.get("menuBar"),o=new Fye(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:s,useMenuBar:r.isVisible,label:this.config.get("label")});this.ui=new Lye(this,o),Vpe(this)}static get editorName(){return"ClassicEditor"}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,i={}){return new Promise(s=>{const r=new this(e,i);s(r.initPlugins().then(()=>r.ui.init(Y0(e)?e:null)).then(()=>r.data.init(r.config.get("initialData"))).then(()=>r.fire("ready")).then(()=>r))})}}function Bye(n){return Y0(n)?lhe(n):n}function Y0(n){return Wc(n)}/** 534 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 535 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 536 */class Vye extends _t{constructor(t){super(t),this.affectsData=!1}execute(){const t=this.editor.model,e=t.document.selection;let i=t.schema.getLimitElement(e);if(e.containsEntireContent(i)||!BN(t.schema,i))do if(i=i.parent,!i)return;while(!BN(t.schema,i));t.change(s=>{s.setSelection(i,"in")})}}function BN(n,t){return n.isLimit(t)&&(n.checkChild(t,"$text")||n.checkChild(t,"paragraph"))}const Hye=GM("Ctrl+A");class zye extends we{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.t,s=t.editing.view.document;t.commands.add("selectAll",new Vye(t)),this.listenTo(s,"keydown",(r,o)=>{vm(o)===Hye&&(t.execute("selectAll"),o.preventDefault())}),t.accessibility.addKeystrokeInfos({keystrokes:[{label:e("Select all"),keystroke:"CTRL+A"}]})}}class $ye extends we{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",()=>{const e=this._createButton(pt);return e.set({tooltip:!0}),e}),t.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(Cr))}_createButton(t){const e=this.editor,i=e.locale,s=e.commands.get("selectAll"),r=new t(e.locale),o=i.t;return r.set({label:o("Select all"),icon:pbe,keystroke:"Ctrl+A"}),r.bind("isEnabled").to(s,"isEnabled"),this.listenTo(r,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),r}}class Wye extends we{static get requires(){return[zye,$ye]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}/** 537 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 538 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 539 */class rU extends _t{constructor(e){super(e);y(this,"_stack",[]);y(this,"_createdBatches",new WeakSet);this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(i,s)=>{s[1]={...s[1]};const r=s[1];r.batchType||(r.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(i,s)=>{s[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const i=this.editor.model.document.selection,s={ranges:i.hasOwnRange?Array.from(i.getRanges()):[],isBackward:i.isBackward};this._stack.push({batch:e,selection:s}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,i,s){const r=this.editor.model,o=r.document,a=[],l=e.map(u=>u.getTransformedByOperations(s)),c=l.flat();for(const u of l){const d=u.filter(h=>h.root!=o.graveyard).filter(h=>!jye(h,c));d.length&&(Uye(d),a.push(d[0]))}a.length&&r.change(u=>{u.setSelection(a,{backward:i})})}_undo(e,i){const s=this.editor.model,r=s.document;this._createdBatches.add(i);const o=e.operations.slice().filter(a=>a.isDocumentOperation);o.reverse();for(const a of o){const l=a.baseVersion+1,c=Array.from(r.history.getOperations(l)),d=Mme([a.getReversed()],c,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let h of d){const f=h.affectedSelectable;f&&!s.canEditAt(f)&&(h=new $n(h.baseVersion)),i.addOperation(h),s.applyOperation(h),r.history.setOperationAsUndone(a,h)}}}}function Uye(n){n.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;t<n.length;t++){const i=n[t-1].getJoined(n[t],!0);i&&(t--,n.splice(t,2,i))}}function jye(n,t){return t.some(e=>e!==n&&e.containsRange(n,!0))}class Gye extends rU{execute(t=null){const e=t?this._stack.findIndex(r=>r.batch==t):this._stack.length-1,i=this._stack.splice(e,1)[0],s=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(s,()=>
vendor: 4,905 bytes, lines 539-548
539{this._undo(i.batch,s);const r=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,r)}),this.fire("revert",i.batch,s),this.refresh()}}class Yye extends rU{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(e,()=>{const s=t.batch.operations[t.batch.operations.length-1].baseVersion+1,r=this.editor.model.document.history.getOperations(s);this._restoreSelection(t.selection.ranges,t.selection.isBackward,r),this._undo(t.batch,e)}),this.fire("revert",t.batch,e),this.refresh()}}class qye extends we{constructor(){super(...arguments);y(this,"_undoCommand");y(this,"_redoCommand");y(this,"_batchRegistry",new WeakSet)}static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.t;this._undoCommand=new Gye(e),this._redoCommand=new Yye(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(s,r)=>{const o=r[0];if(!o.isDocumentOperation)return;const a=o.batch,l=this._redoCommand.createdBatches.has(a),c=this._undoCommand.createdBatches.has(a);this._batchRegistry.has(a)||(this._batchRegistry.add(a),a.isUndoable&&(l?this._undoCommand.addBatch(a):c||(this._undoCommand.addBatch(a),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(s,r,o)=>{this._redoCommand.addBatch(o)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Undo"),keystroke:"CTRL+Z"},{label:i("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class Kye extends we{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.locale,i=t.t,s=e.uiLanguageDirection=="ltr"?GF:UF,r=e.uiLanguageDirection=="ltr"?UF:GF;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",s),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",r)}_addButtonsToFactory(t,e,i,s){const r=this.editor;r.ui.componentFactory.add(t,()=>{const o=this._createButton(pt,t,e,i,s);return o.set({tooltip:!0}),o}),r.ui.componentFactory.add("menuBar:"+t,()=>this._createButton(Cr,t,e,i,s))}_createButton(t,e,i,s,r){const o=this.editor,a=o.locale,l=o.commands.get(e),c=new t(a);return c.set({label:i,icon:r,keystroke:s}),c.bind("isEnabled").to(l,"isEnabled"),this.listenTo(c,"execute",()=>{o.execute(e),o.editing.view.focus()}),c}}class vO extends we{static get requires(){return[qye,Kye]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}/** 540 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 541 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 542 */class Xye extends we{static get requires(){return[iwe,sU,sx,Wye,Rve,bve,vO]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}}/** 543 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 544 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 545 */function VN(n){return n.map(t=>Jye(t)).filter(t=>t!==void 0)}const HN={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function Jye(n){if(typeof n=="number"&&(n=String(n)),typeof n=="object"&&e_e(n))return CI(n);const t=Qye(n);if(t)return CI(t);if(n==="default")return{model:void 0,title:"Default"};if(!t_e(n))return Zye(n)}function Zye(n){return typeof n=="string"&&(n={title:n,model:`${parseFloat(n)}px`}),n.view={name:"span",styles:{"font-size":n.model}},CI(n)}function CI(n){return n.view&&typeof n.view!="string"&&!n.view.priority&&(n.view.priority=7),n}function Qye(n){return typeof n=="string"?HN[n]:HN[n.model]}function e_e(n){return n.title&&n.model&&n.view}function t_e(n){let t;if(typeof n=="object")if(n.model)t=parseFloat(n.model);else throw new ee("font-size-invalid-definition",null,n);else t=parseFloat(n);return isNaN(t)}/** 546 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 547 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 548 */class n_e extends _t{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}refresh(){const t=this.editor.model,e=t.document,i=$i(e.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph"),this.isEnabled=!!i&&zN(i,t.schema)}execute(t={}){const e=this.editor.model,i=e.document,s=t.selection||i.selection;e.canEditAt(s)&&e.change(r=>
548{const o=s.getSelectedBlocks();for(const a of o)!a.is("element","paragraph")&&zN(a,e.schema)&&r.rename(a,"paragraph")})}}function zN(n,t){return t.checkChild(n.parent,"paragraph")&&!t.isObject(n)}class i_e extends _t{constructor(t){super(t),this._isEnabledBasedOnSelection=!1}execute(t){const e=this.editor.model,i=t.attributes;let s=t.position;return e.canEditAt(s)?e.change(r=>{if(s=this._findPositionToInsertParagraph(s,r),!s)return null;const o=r.createElement("paragraph");return i&&e.schema.setAllowedAttributes(o,i,r),e.insertContent(o,s),r.setSelection(o,"in"),r.createPositionAt(o,0)}):null}_findPositionToInsertParagraph(t,e){const i=this.editor.model;if(i.schema.checkChild(t,"paragraph"))return t;const s=i.schema.findAllowedParent(t,"paragraph");if(!s)return null;const r=t.parent,o=i.schema.checkChild(r,"$text");return r.isEmpty||o&&t.isAtEnd?i.createPositionAfter(r):!r.isEmpty&&o&&t.isAtStart?i.createPositionBefore(r):e.split(t,s).position}}const YS=class YS extends we{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new n_e(t)),t.commands.add("insertParagraph",new i_e(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(i,{writer:s})=>!YS.paragraphLikeElements.has(i.name)||i.isEmpty?null:s.createElement("paragraph"),view:/.+/,converterPriority:"low"})}};y(YS,"paragraphLikeElements",new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]));let t1=YS;/** 549 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 550 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 551 */class s_e extends _t{constructor(e,i){super(e);y(this,"modelElements");this.modelElements=i}refresh(){const e=$i(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(i=>$N(e,i,this.editor.model.schema))}execute(e){const i=this.editor.model,s=i.document,r=e.value;i.change(o=>{const a=Array.from(s.selection.getSelectedBlocks()).filter(l=>$N(l,r,i.schema));for(const l of a)l.is("element",r)||o.rename(l,r)})}}function $N(n,t,e){return e.checkChild(n.parent,t)&&!e.isObject(n)}const WN="paragraph";class r_e extends we{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[t1]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const s of e)s.model!=="paragraph"&&(t.model.schema.register(s.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(s),i.push(s.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new s_e(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(s,r)=>{const o=t.model.document.selection.getFirstPosition().parent;i.some(l=>o.is("element",l.model))&&!o.is("element",WN)&&o.childCount===0&&r.writer.rename(o,WN)})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:Dc.low+1})}}/** 552 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 553 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 554 */function o_e(n){const t=n.t,e={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return n.config.get("heading.options").map(i=>{const s=e[i.title];return s&&s!=i.title&&(i.title=s),i})}class a_e extends we{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.t,i=o_e(t),s=e("Choose heading"),r=e("Heading");t.ui.componentFactory.add("heading",o=>{const a={},l=new er,c=t.commands.get("heading"),u=t.commands.get("paragraph"),d=[c];for(const f of i){const p={type:"button",model:new JE({label:f.title,class:f.class,role:"menuitemradio",withText:!0})};f.model==="paragraph"?(p.model.bind("isOn").to(u,"value"),p.model.set("commandName","paragraph"),d.push(u)):(p.model.bind("isOn").to(c,"value",v=>v===f.model),p.model.set({commandName:"heading",commandValue:f.model})),l.add(p),a[f.model]=f.title}const h=hl(o);return mO(h,l,{ariaLabel:r,role:"menu"}),h.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(d,"isEnabled",(...f)=>f.some(p=>p)),h.buttonView.bind("label").to(c,"value",u,"value",(f,p)=>{const v=p?"paragraph":f;return typeof v=="boolean"||!a[v]?s:a[v]}),h.buttonView.bind("ariaLabel").to(c,"value",u,"value",(f,p)=>{const v=p?"paragraph":f;return typeof v=="boolean"||!a[v]?r:`${a[v]}, ${r}`}),this.listenTo(h,"execute",f=>{const{commandName:p,commandValue:v}=f.source;t.execute(p,v?{value:v}:void 0),t.editing.view.focus()}),h}),t.ui.componentFactory.add("menuBar:heading",o=>{const a=new Lc(o),l=t.commands.get("heading"),c=t.commands.get("paragraph"),u=[l],d=new ZE(o);a.set({class:"ck-heading-dropdown"}),d.set({ariaLabel:e("Heading"),role:"menu"}),a.buttonView.set({label:e("Heading")}),a.panelView.children.add(d);for(const h of i){const f=new nx(o,a),p=new Cr(o);f.children.add(p),d.items.add(f),p.set({isToggleable:!0,label:h.title,role:"menuitemradio",class:h.class}),p.delegate("execute").to(a),p.on("execute",()=>{const v=h.model==="paragraph"?"paragraph":"heading";t.execute(v,{value:h.model}),t.editing.view.focus()}),h.model==="paragraph"?(p.bind("isOn").to(c,"value"),u.push(c)):p.bind("isOn").to(l,"value",v=>v===h.model)}return a.bind("isEnabled").toMany(u,"isEnabled",(...h)=>h.some(f=>f)),a})}}class l_e extends we{static get requires(){return[r_e,a_e]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}}var oU={},aU={},lU={};(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});function t(e){if(!e||typeof e!="object")return!1;const i=Object.getPrototypeOf(e);
554return i===null||i===Object.prototype||Object.getPrototypeOf(i)===null?Object.prototype.toString.call(e)==="[object Object]":!1}n.isPlainObject=t})(lU);var cU={};(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});function t(e){return Object.getOwnPropertySymbols(e).filter(i=>Object.prototype.propertyIsEnumerable.call(e,i))}n.getSymbols=t})(cU);var uU={};(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});function t(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}n.getTag=t})(uU);var dU={};(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",e="[object String]",i="[object Number]",s="[object Boolean]",r="[object Arguments]",o="[object Symbol]",a="[object Date]",l="[object Map]",c="[object Set]",u="[object Array]",d="[object Function]",h="[object ArrayBuffer]",f="[object Object]",p="[object Error]",v="[object DataView]",E="[object Uint8Array]",x="[object Uint8ClampedArray]",A="[object Uint16Array]",O="[object Uint32Array]",I="[object BigUint64Array]",T="[object Int8Array]",P="[object Int16Array]",k="[object Int32Array]",D="[object BigInt64Array]",U="[object Float32Array]",Y="[object Float64Array]";n.argumentsTag=r,n.arrayBufferTag=h,n.arrayTag=u,n.bigInt64ArrayTag=D,n.bigUint64ArrayTag=I,n.booleanTag=s,n.dataViewTag=v,n.dateTag=a,n.errorTag=p,n.float32ArrayTag=U,n.float64ArrayTag=Y,n.functionTag=d,n.int16ArrayTag=P,n.int32ArrayTag=k,n.int8ArrayTag=T,n.mapTag=l,n.numberTag=i,n.objectTag=f,n.regexpTag=t,n.setTag=c,n.stringTag=e,n.symbolTag=o,n.uint16ArrayTag=A,n.uint32ArrayTag=O,n.uint8ArrayTag=E,n.uint8ClampedArrayTag=x})(dU);var hU={};(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});function t(e,i){return e===i||Number.isNaN(e)&&Number.isNaN(i)}n.eq=t})(hU);(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const t=lU,e=cU,i=uU,s=dU,r=hU;function o(c,u,d){return a(c,u,void 0,void 0,void 0,void 0,d)}function a(c,u,d,h,f,p,v){const E=v(c,u,d,h,f,p);if(E!==void 0)return E;if(typeof c==typeof u)switch(typeof c){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return c===u;case"number":return c===u||Object.is(c,u);case"function":return c===u;case"object":return l(c,u,p,v)}return l(c,u,p,v)}function l(c,u,d,h){if(Object.is(c,u))return!0;let f=i.getTag(c),p=i.getTag(u);if(f===s.argumentsTag&&(f=s.objectTag),p===s.argumentsTag&&(p=s.objectTag),f!==p)return!1;switch(f){case s.stringTag:return c.toString()===u.toString();case s.numberTag:{const x=c.valueOf(),A=u.valueOf();return r.eq(x,A)}case s.booleanTag:case s.dateTag:case s.symbolTag:return Object.is(c.valueOf(),u.valueOf());case s.regexpTag:return c.source===u.source&&c.flags===u.flags;case s.functionTag:return c===u}d=d??new Map;const v=d.get(c),E=d.get(u);if(v!=null&&E!=null)return v===u;d.set(c,u),d.set(u,c);try{switch(f){case s.mapTag:{if(c.size!==u.size)return!1;for(const[x,A]of c.entries())if(!u.has(x)||!a(A,u.get(x),x,c,u,d,h))return!1;return!0}case s.setTag:{if(c.size!==u.size)return!1;const x=Array.from(c.values()),A=Array.from(u.values());for(let O=0;O<x.length;O++){const I=x[O],T=A.findIndex(P=>a(I,P,void 0,c,u,d,h));if(T===-1)return!1;A.splice(T,1)}return!0}case s.arrayTag:case s.uint8ArrayTag:case s.uint8ClampedArrayTag:case s.uint16ArrayTag:case s.uint32ArrayTag:case s.bigUint64ArrayTag:case s.int8ArrayTag:case s.int16ArrayTag:case s.int32ArrayTag:case s.bigInt64ArrayTag:case s.float32ArrayTag:case s.float64ArrayTag:{if(typeof Buffer<"u"&&Buffer.isBuffer(c)!==Buffer.isBuffer(u)||c.length!==u.length)return!1;for(let x=0;x<c.length;x++)if(!a(c[x],u[x],x,c,u,d,h))return!1;return!0}case s.arrayBufferTag:return c.byteLength!==u.byteLength?!1:l(new Uint8Array(c),new Uint8Array(u),d,h);case s.dataViewTag:return c.byteLength!==u.byteLength||c.byteOffset!==u.byteOffset?!1:l(new Uint8Array(c),new Uint8Array(u),d,h);case s.errorTag:return c.name===u.name&&c.message===u.message;case s.objectTag:{if(!(l(c.constructor,u.constructor,d,h)||t.isPlainObject(c)&&t.isPlainObject(u)))return!1;const A=[...Object.keys(c),...e.getSymbols(c)],O=[...Object.keys(u),...e.getSymbols(u)];if(A.length!==O.length)return!1;for(let I=0;I<A.length;I++){const T=A[I],P=c[T];if(!Object.hasOwn(u,T))return!1;const k=u[T];if(!a(P,k,T,c,u,d,h))return!1}return!0}default:return!1}}finally{d.delete(c),d.delete(u)}}n.isEqualWith=o})(aU);var fU={};(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});function t(){}n.noop=t})(fU);(function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const t=aU,e=fU;function i(s,r){return t.isEqualWith(s,r,e.noop)}n.isEqual=i})(oU);var c_e=oU.isEqual;const u_e=zI(c_e);/** 555 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 556 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
557 */function d_e(n){return n.createContainerElement("span",{class:"image-inline"},n.createEmptyElement("img"))}function UN(n){return n.createContainerElement("figure",{class:"image"},[n.createEmptyElement("img"),n.createSlot("children")])}function gU(n,t){const e=n.plugins.get("ImageUtils"),i=n.plugins.has("ImageInlineEditing")&&n.plugins.has("ImageBlockEditing");return r=>e.isInlineImageView(r)?i&&(r.getStyle("display")=="block"||r.findAncestor(e.isBlockImageView)?"imageBlock":"imageInline")!==t?null:s(r):null;function s(r){const o={name:!0};return r.hasAttribute("src")&&(o.attributes=["src"]),o}}function yO(n,t){const e=$i(t.getSelectedBlocks());return!e||n.isObject(e)||e.isEmpty&&e.name!="listItem"?"imageBlock":"imageInline"}function n1(n){return n&&n.endsWith("px")?parseInt(n):null}function i1(n){const t=n1(n.getStyle("width")),e=n1(n.getStyle("height"));return!!(t&&e)}const h_e=/^(image|image-inline)$/;class Si extends we{constructor(){super(...arguments);y(this,"_domEmitter",new(Qs()))}static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},i=null,s=null,r={}){const o=this.editor,a=o.model,l=a.document.selection,c=mU(o,i||l,s);e={...Object.fromEntries(l.getAttributes()),...e};for(const u in e)a.schema.checkAttribute(c,u)||delete e[u];return a.change(u=>{const{setImageSizes:d=!0}=r,h=u.createElement(c,e);return a.insertObject(h,i,null,{setSelection:"on",findOptimalPosition:!i&&c!="imageInline"?"auto":void 0}),h.parent?(d&&this.setImageNaturalSizeAttributes(h),h):null})}setImageNaturalSizeAttributes(e){const i=e.getAttribute("src");i&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(s=>{const r=new Ie.window.Image;this._domEmitter.listenTo(r,"load",()=>{!e.getAttribute("width")&&!e.getAttribute("height")&&this.editor.model.enqueueChange(s.batch,o=>{o.setAttribute("width",r.naturalWidth,e),o.setAttribute("height",r.naturalHeight,e)}),this._domEmitter.stopListening(r,"load")}),r.src=i}))}getClosestSelectedImageWidget(e){const i=e.getFirstPosition();if(!i)return null;const s=e.getSelectedElement();if(s&&this.isImageWidget(s))return s;let r=i.parent;for(;r;){if(r.is("element")&&this.isImageWidget(r))return r;r=r.parent}return null}getClosestSelectedImageElement(e){const i=e.getSelectedElement();return this.isImage(i)?i:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:h_e})}isImageAllowed(){const i=this.editor.model.document.selection;return f_e(this.editor,i)&&g_e(i)}toImageWidget(e,i,s){return i.setCustomProperty("image",!0,e),K4(e,i,{label:()=>{const a=this.findViewImgElement(e).getAttribute("alt");return a?`${a} ${s}`:s}})}isImageWidget(e){return!!e.getCustomProperty("image")&&gn(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const i=this.editor.editing.view;for(const{item:s}of i.createRangeIn(e))if(this.isInlineImageView(s))return s}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function f_e(n,t){if(mU(n,t,null)=="imageBlock"){const i=m_e(t,n.model);if(n.model.schema.checkChild(i,"imageBlock"))return!0}else if(n.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}function g_e(n){return[...n.focus.getAncestors()].every(t=>!t.is("element","imageBlock"))}function m_e(n,t){const i=Gve(n,t).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}function mU(n,t,e){const i=n.model.schema,s=n.config.get("image.insert.type");return n.plugins.has("ImageBlockEditing")?n.plugins.has("ImageInlineEditing")?e||(s==="inline"?"imageInline":s!=="auto"?"imageBlock":t.is("selection")?yO(i,t):i.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const p_e=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class b_e extends we{constructor(e){super(e);y(this,"_timeoutId");y(this,"_positionToInsert");this._timeoutId=null,this._positionToInsert=null}static get requires(){return[sU,Si,vO,Ih]}static get pluginName(){return"AutoImage"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.model.document,s=e.plugins.get("ClipboardPipeline");this.listenTo(s,"inputTransformation",()=>{const r=i.selection.getFirstRange(),o=Mn.fromPosition(r.start);o.stickiness="toPrevious";const a=Mn.fromPosition(r.end);a.stickiness="toNext",i.once("change:data",()=>{this._embedImageBetweenPositions(o,a),o.detach(),a.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(Ie.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedImageBetweenPositions(e,i){const s=this.editor,r=new js(e,i),o=r.getWalker({ignoreElementEnd:!0}),a=Object.fromEntries(s.model.document.selection.getAttributes()),l=this.editor.plugins.get("ImageUtils");let c="";for(const u of o)u.item.is("$textProxy")&&(c+=u.item.data);if(c=c.trim(),!c.match(p_e)){r.detach();return}this._positionToInsert=Mn.fromPosition(e),this._timeoutId=setTimeout(()=>{if(!s.commands.get("insertImage").isEnabled){r.detach();return}s.model.change(h=>{this._timeoutId=null,h.remove(r),r.detach();let f;this._positionToInsert.root.rootName!=="$graveyard"&&(f=this._positionToInsert.toPosition()),l.insertImage({...a,src:c},f),this._positionToInsert.detach(),this._positionToInsert=null}),s.plugins.get("Delete").requestUndoOnBackspace()},100)}}class w_e extends _t{refresh(){const i=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled&&i.hasAttribute("alt")?this.value=i.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor,i=e.plugins.get("ImageUtils"),s=e.model,r=i.getClosestSelectedImageElement(s.document.selection);s.change(o=>{o.setAttribute("alt",t.newValue,r)}
vendor: 5,472 bytes, line 557
557)}}class v_e extends we{static get requires(){return[Si]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new w_e(this.editor))}}class y_e extends Ye{constructor(e){super(e);y(this,"focusTracker");y(this,"keystrokes");y(this,"labeledInput");y(this,"backButtonView");y(this,"saveButtonView");y(this,"children");y(this,"_focusables");y(this,"_focusCycler");this.focusTracker=new fi,this.keystrokes=new rs,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new XE(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new tr,this.keystrokes.set("Esc",(i,s)=>{this.fire("cancel"),s()}),this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),JT({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(i=>{this._focusables.add(i),this.focusTracker.add(i.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({class:"ck-button-back",label:e("Back"),icon:Rm,tooltip:!0}),i.delegate("execute").to(this,"cancel"),i}_createSaveButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),i}_createHeaderView(){const e=this.locale.t,i=new Lm(this.locale,{label:e("Text Alternative")});return i.children.add(this.backButtonView,0),i}_createLabeledInputView(){const e=this.locale.t,i=new KE(this.locale,TI);return i.label=e("Text alternative"),i.class="ck-labeled-field-view_full-width",i}}function __e(n){const t=n.plugins.get("ContextualBalloon");if(n.plugins.get("ImageUtils").getClosestSelectedImageWidget(n.editing.view.document.selection)){const i=_O(n);t.updatePosition(i)}}function _O(n){const t=n.editing.view,e=jc.defaultPositions,i=n.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(i.getClosestSelectedImageWidget(t.document.selection)),positions:[e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast,e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.viewportStickyNorth]}}class E_e extends we{constructor(){super(...arguments);y(this,"_balloon");y(this,"_form")}static get requires(){return[Xb]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,i=e.t;e.ui.componentFactory.add("imageTextAlternative",s=>{const r=e.commands.get("imageTextAlternative"),o=new pt(s);return o.set({label:i("Change image text alternative"),icon:_be,tooltip:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value",a=>!!a),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,s=e.editing.view.document,r=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(qE(y_e))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this.listenTo(e.ui,"update",()=>{r.getClosestSelectedImageWidget(s.selection)?this._isVisible&&__e(e):this._hideForm(!0)}),Fy({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,i=e.commands.get("imageTextAlternative"),s=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:_O(e)}),s.fieldView.value=s.fieldView.element.value=i.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class pU extends we{static get requires(){return[v_e,E_e]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function S_e(n){const t=(e,i,s)=>{if(!s.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const r=n.findViewImgElement(i.viewItem);if(!r||!s.consumable.test(r,{name:!0}))return;s.consumable.consume(i.viewItem,{name:!0,classes:"image"});const o=s.convertItem(r,i.modelCursor),a=$i(o.modelRange.getItems());if(!a){s.consumable.revert(i.viewItem,{name:!0,classes:"image"});return}s.convertChildren(i.viewItem,a),s.updateConversionResult(a,i)};return e=>{e.on("element:figure",t)}}function bU(n,t){const e=(i,s,r)=>
557{if(!r.consumable.consume(s.item,i.name))return;const o=r.writer,a=r.mapper.toViewElement(s.item),l=n.findViewImgElement(a);s.attributeNewValue===null?(o.removeAttribute("srcset",l),o.removeAttribute("sizes",l)):s.attributeNewValue&&(o.setAttribute("srcset",s.attributeNewValue,l),o.setAttribute("sizes","100vw",l))};return i=>{i.on(`attribute:srcset:${t}`,e)}}function s1(n,t,e){const i=(s,r,o)=>{if(!o.consumable.consume(r.item,s.name))return;const a=o.writer,l=o.mapper.toViewElement(r.item),c=n.findViewImgElement(l);a.setAttribute(r.attributeKey,r.attributeNewValue||"",c)};return s=>{s.on(`attribute:${e}:${t}`,i)}}class EO extends ia{observe(t){this.listenTo(t,"load",(e,i)=>{const s=i.target;this.checkShouldIgnoreEventFromTarget(s)||s.tagName=="IMG"&&this._fireEvents(i)},{useCapture:!0})}stopObserving(t){this.stopListening(t)}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}class T_e extends _t{constructor(t){super(t);const e=t.config.get("image.insert.type");t.plugins.has("ImageBlockEditing")||e==="block"&&Dt("image-block-plugin-required"),t.plugins.has("ImageInlineEditing")||e==="inline"&&Dt("image-inline-plugin-required")}refresh(){const t=this.editor.plugins.get("ImageUtils");this.isEnabled=t.isImageAllowed()}execute(t){const e=bn(t.source),i=this.editor.model.document.selection,s=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(i.getAttributes());e.forEach((o,a)=>{const l=i.getSelectedElement();if(typeof o=="string"&&(o={src:o}),a&&l&&s.isImage(l)){const c=this.editor.model.createPositionAfter(l);s.insertImage({...o,...r},c,t.imageType)}else t.breakBlock?s.insertImage({...o,...r},i.getFirstPosition(),t.imageType):s.insertImage({...o,...r},null,t.imageType)})}}class x_e extends _t{constructor(t){super(t),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),i=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(i),this.value=this.isEnabled?i.getAttribute("src"):null}execute(t){const e=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change(s=>{s.setAttribute("src",t.source,e),this.cleanupImage(s,e),i.setImageNaturalSizeAttributes(e)})}cleanupImage(t,e){t.removeAttribute("srcset",e),t.removeAttribute("sizes",e),t.removeAttribute("sources",e),t.removeAttribute("width",e),t.removeAttribute("height",e),t.removeAttribute("alt",e)}}class wU extends we{static get requires(){return[Si]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.conversion;t.editing.view.addObserver(EO),e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new T_e(t),s=new x_e(t);t.commands.add("insertImage",i),t.commands.add("replaceImageSource",s),t.commands.add("imageInsert",i)}}class vU extends we{static get requires(){return[Si]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&t.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&t.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(t){const e=this.editor,i=e.plugins.get("ImageUtils"),s=t==="imageBlock"?"figure":"img";e.conversion.for("upcast").attributeToAttribute({view:{name:s,styles:{width:/.+/}},model:{key:"width",value:o=>i1(o)?n1(o.getStyle("width")):null}}).attributeToAttribute({view:{name:s,key:"width"},model:"width"}).attributeToAttribute({view:{name:s,styles:{height:/.+/}},model:{key:"height",value:o=>i1(o)?n1(o.getStyle("height")):null}}).attributeToAttribute({view:{name:s,key:"height"},model:"height"}),e.conversion.for("editingDowncast").add(o=>{r(o,"width","width",!0,!0),r(o,"height","height",!0,!0)}),e.conversion.for("dataDowncast").add(o=>{r(o,"width","width",!1),r(o,"height","height",!1)}),e.conversion.for("upcast").add(o=>{o.on("element:img",(a,l,c)=>{const u=l.viewItem.getAttribute("width"),d=l.viewItem.getAttribute("height");u&&d&&c.consumable.consume(l.viewItem,{styles:["aspect-ratio"]})})});function r(o,a,l,c,u=!1){o.on(`attribute:${a}:${t}`,(d,h,f)=>{if(!f.consumable.consume(h.item,d.name))return;const p=f.writer,v=f.mapper.toViewElement(h.item),E=i.findViewImgElement(v);h.attributeNewValue!==null?p.setAttribute(l,h.attributeNewValue,E):p.removeAttribute(l,E
557);const x=h.item.getAttribute("width"),A=h.item.getAttribute("height"),O=x&&A;if(O&&u&&p.setAttribute("loading","lazy",E),h.item.hasAttribute("sources"))return;const I=h.item.hasAttribute("resizedWidth");t==="imageInline"&&!I&&!c||O&&p.setStyle("aspect-ratio",`${x}/${A}`,E)})}}}class yU extends _t{constructor(e,i){super(e);y(this,"_modelElementName");this._modelElementName=i}refresh(){const i=this.editor.plugins.get("ImageUtils"),s=i.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=i.isInlineImage(s):this.isEnabled=i.isBlockImage(s)}execute(e={}){const i=this.editor,s=this.editor.model,r=i.plugins.get("ImageUtils"),o=r.getClosestSelectedImageElement(s.document.selection),a=Object.fromEntries(o.getAttributes());return!a.src&&!a.uploadId?null:s.change(l=>{const{setImageSizes:c=!0}=e,u=Array.from(s.markers).filter(f=>f.getRange().containsItem(o)),d=r.insertImage(a,s.createSelection(o,"on"),this._modelElementName,{setImageSizes:c});if(!d)return null;const h=l.createRangeOn(d);for(const f of u){const p=f.getRange(),v=p.root.rootName!="$graveyard"?p.getJoined(h,!0):h;l.updateMarker(f,{range:v})}return{oldElement:o,newElement:d}})}}class _U extends we{static get requires(){return[Si]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const t=this.editor.model.schema;t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["placeholder"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const t=this.editor,e=t.conversion,i=t.plugins.get("ImageUtils");e.for("editingDowncast").add(s=>{s.on("attribute:placeholder",(r,o,a)=>{if(!a.consumable.test(o.item,r.name)||!o.item.is("element","imageBlock")&&!o.item.is("element","imageInline"))return;a.consumable.consume(o.item,r.name);const l=a.writer,c=a.mapper.toViewElement(o.item),u=i.findViewImgElement(c);o.attributeNewValue?(l.addClass("image_placeholder",u),l.setStyle("background-image",`url(${o.attributeNewValue})`,u),l.setCustomProperty("editingPipeline:doNotReuseOnce",!0,u)):(l.removeClass("image_placeholder",u),l.removeStyle("background-image",u))})})}_setupLoadListener(){const t=this.editor,e=t.model,i=t.editing,s=i.view,r=t.plugins.get("ImageUtils");s.addObserver(EO),this.listenTo(s.document,"imageLoaded",(o,a)=>{const l=s.domConverter.mapDomToView(a.target);if(!l)return;const c=r.getImageWidgetFromImageView(l);if(!c)return;const u=i.mapper.toModelElement(c);!u||!u.hasAttribute("placeholder")||e.enqueueChange({isUndoable:!1},d=>{d.removeAttribute("placeholder",u)})})}}class EU extends we{static get requires(){return[wU,vU,Si,_U,Er]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),t.plugins.has("ImageInlineEditing")&&(t.commands.add("imageTypeBlock",new yU(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,i=t.conversion,s=t.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:o})=>UN(o)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(r,{writer:o})=>s.toImageWidget(UN(o),o,e("image widget"))}),i.for("downcast").add(s1(s,"imageBlock","src")).add(s1(s,"imageBlock","alt")).add(bU(s,"imageBlock")),i.for("upcast").elementToElement({view:gU(t,"imageBlock"),model:(r,{writer:o})=>o.createElement("imageBlock",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)}).add(S_e(s))}_setupClipboardIntegration(){const t=this.editor,e=t.model,i=t.editing.view,s=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(o,a)=>{const l=Array.from(a.content.getChildren());let c;if(!l.every(s.isInlineImageView))return;a.targetRanges?c=t.editing.mapper.toModelRange(a.targetRanges[0]):c=e.document.selection.getFirstRange();const u=e.createSelection(c);if(yO(e.schema,u)==="imageBlock"){const d=new cO(i.document),h=l.map(f=>d.createElement("figure",{class:"image"},f));a.content=d.createDocumentFragment(h)}}),this.listenTo(r,"contentInsertion",(o,a)=>{a.method==="paste"&&e.change(l=>{const c=l.createRangeIn(a.content);for(const u of c.getItems())u.is("element","imageBlock")&&s.setImageNaturalSizeAttributes(u)})})}}class A_e extends Ye{constructor(e,i=[]){super(e);y(this,"focusTracker");y(this,"keystrokes");y(this,"_focusables");y(this,"_focusCycler");y(this,"children");this.focusTracker=new fi,this.keystrokes=new rs,this._focusables=new tr,this.children=this.createCollection(),this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const s of i)this.children.add(s),this._focusables.add(s),s instanceof gwe&&this._focusables.addMany(s.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),JT({view:this});for(const i of this._focusables)this.focusTracker.add(i.element);this.keystrokes.listenTo(this.element);const e=i=>i.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class SU extends we{constructor(e){super(e);y(this,"dropdownView");y(this,"_integrations",new Map);e.config.define("image.insert.integrations",["upload","assetManager","url"])}static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Si]}init(){const e=this.editor,i=e.model.document.selection,s=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=s.isImage(i.getSelectedElement())});const r=a=>this._createToolbarComponent(a),o=a=>this._createMenuBarComponent(a);e.ui.componentFactory.add("insertImage",r),e.ui.componentFactory.add("imageInsert",r),e.ui.componentFactory.add("menuBar:insertImage",o)}registerIntegration({name:e,observable:i,buttonViewCreator:s,formViewCreator:r,menuBarButtonViewCreator:o,requiresForm:a=!1,override:l=!1}){this._integrations.has(e)&&!l&&Dt("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:i,buttonViewCreator:s,menuBarButtonViewCreator:o,formViewCreator:r,requiresForm:a})}_createToolbarComponent(e){const i=this.editor,s=e.t,r=this._prepareIntegrations();if(!r.length)return null;let o;const a=r[0];if(r.length==1){if(!a.requiresForm)return a.buttonViewCreator(!0);o=a.buttonViewCreator(!0)}else{const u=a.buttonViewCreator(!1);o=new tx(e,u),o.tooltip=!0,o.bind("label").to(this,"isImageSelected",d=>s(d?"Replace image":"Insert image"))}const l=this.dropdownView=hl(e,o),c=r.map(({observable:u})=>typeof u=="function"?u():u);return l.bind("isEnabled").toMany(c,"isEnabled",(...u)=>u.some(d=>d)),l.once("change:isOpen",()=>{const u=r.flatMap(({formViewCreator:h})=>h(r.length==1)),d=new A_e(i.locale,u);l.panelView.children.add(d)}),l}_createMenuBarComponent(e){const i=e.t,s=this._prepareIntegrations();if(!s.length)return null;const r=s.flatMap(({menuBarButtonViewCreator:l})=>l(s.length==1)),o=new Lc(e),a=new ZE(e);o.panelView.children.add(a),o.buttonView.set({icon:Zpe,label:i("Image")});for(const l of r){const c=new nx(e,o);c.children.add(l),a.items.add(c),l.delegate("execute").to(o)}return o}_prepareIntegrations(){const i=this.editor.config.get("image.insert.integrations"),s=[];if(!i.length)return Dt("image-insert-integrations-not-specified"),s;for(const r of i){if(!this._integrations.has(r)){["upload","assetManager","url"].includes(r)||Dt("image-insert-unknown-integration",{item:r});continue}s.push(this._integrations.get(r))}return s.length||Dt("image-insert-integrations-not-registered"),s}}class C_e extends we{static get requires(){return[EU,rx,pU,SU]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class k_e extends we{static get requires(){return[wU,vU,Si,_U,Er]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;
557t.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),t.plugins.has("ImageBlockEditing")&&(t.commands.add("imageTypeInline",new yU(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const t=this.editor,e=t.t,i=t.conversion,s=t.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:o})=>o.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(r,{writer:o})=>s.toImageWidget(d_e(o),o,e("image widget"))}),i.for("downcast").add(s1(s,"imageInline","src")).add(s1(s,"imageInline","alt")).add(bU(s,"imageInline")),i.for("upcast").elementToElement({view:gU(t,"imageInline"),model:(r,{writer:o})=>o.createElement("imageInline",r.hasAttribute("src")?{src:r.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const t=this.editor,e=t.model,i=t.editing.view,s=t.plugins.get("ImageUtils"),r=t.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",(o,a)=>{const l=Array.from(a.content.getChildren());let c;if(!l.every(s.isBlockImageView))return;a.targetRanges?c=t.editing.mapper.toModelRange(a.targetRanges[0]):c=e.document.selection.getFirstRange();const u=e.createSelection(c);if(yO(e.schema,u)==="imageInline"){const d=new cO(i.document),h=l.map(f=>f.childCount===1?(Array.from(f.getAttributes()).forEach(p=>d.setAttribute(...p,s.findViewImgElement(f))),f.getChild(0)):f);a.content=d.createDocumentFragment(h)}}),this.listenTo(r,"contentInsertion",(o,a)=>{a.method==="paste"&&e.change(l=>{const c=l.createRangeIn(a.content);for(const u of c.getItems())u.is("element","imageInline")&&s.setImageNaturalSizeAttributes(u)})})}}class I_e extends we{static get requires(){return[k_e,rx,pU,SU]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class TU extends we{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[Si]}getCaptionFromImageModelElement(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils"),i=t.getFirstPosition().findAncestor("caption");return i&&e.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");return t.name=="figcaption"&&e.isBlockImageView(t.parent)?{name:!0}:null}}class P_e extends _t{refresh(){const t=this.editor,e=t.plugins.get("ImageCaptionUtils"),i=t.plugins.get("ImageUtils");if(!t.plugins.has(EU)){this.isEnabled=!1,this.value=!1;return}const s=t.model.document.selection,r=s.getSelectedElement();if(!r){const o=e.getCaptionFromModelSelection(s);this.isEnabled=!!o,this.value=!!o;return}this.isEnabled=i.isImage(r),this.isEnabled?this.value=!!e.getCaptionFromImageModelElement(r):this.value=!1}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change(i=>{this.value?this._hideImageCaption(i):this._showImageCaption(i,e)})}_showImageCaption(t,e){const s=this.editor.model.document.selection,r=this.editor.plugins.get("ImageCaptionEditing"),o=this.editor.plugins.get("ImageUtils");let a=s.getSelectedElement();const l=r._getSavedCaption(a);o.isInlineImage(a)&&(this.editor.execute("imageTypeBlock"),a=s.getSelectedElement());const c=l||t.createElement("caption");t.append(c,a),e&&t.setSelection(c,"in")}_hideImageCaption(t){const e=this.editor,i=e.model.document.selection,s=e.plugins.get("ImageCaptionEditing"),r=e.plugins.get("ImageCaptionUtils");let o=i.getSelectedElement(),a;o?a=r.getCaptionFromImageModelElement(o):(a=r.getCaptionFromModelSelection(i),o=a.parent),s._saveCaption(o,a),t.setSelection(o,"on"),t.remove(a)}}class M_e extends we{constructor(e){super(e);y(this,"_savedCaptionsMap");this._savedCaptionsMap=new WeakMap}static get requires(){return[Si,TU]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.model.schema;i.isRegistered("caption")?i.extend("caption",{allowIn:"imageBlock"}):i.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new P_e(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,i=e.editing.view,s=e.plugins.get("ImageUtils"),r=e.plugins.get("ImageCaptionUtils"),o=e.t;e.conversion.for("upcast").elementToElement({view:a=>r.matchImageCaptionViewElement(a),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(a,{writer:l})=>s.isBlockImage(a.parent)?l.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(a,{writer:l})=>
vendor: 14,311 bytes, line 557
557{if(!s.isBlockImage(a.parent))return null;const c=l.createEditableElement("figcaption");l.setCustomProperty("imageCaption",!0,c),c.placeholder=o("Enter image caption"),wW({view:i,element:c,keepOnFocus:!0});const u=a.parent.getAttribute("alt"),d=u?o("Caption for image: %0",[u]):o("Caption for the image");return J4(c,l,{label:d})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,i=e.plugins.get("ImageUtils"),s=e.plugins.get("ImageCaptionUtils"),r=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),a=l=>{if(!l.return)return;const{oldElement:c,newElement:u}=l.return;/* istanbul ignore if: paranoid check -- @preserve */if(!c)return;if(i.isBlockImage(c)){const h=s.getCaptionFromImageModelElement(c);if(h){this._saveCaption(u,h);return}}const d=this._getSavedCaption(c);d&&this._saveCaption(u,d)};r&&this.listenTo(r,"execute",a,{priority:"low"}),o&&this.listenTo(o,"execute",a,{priority:"low"})}_getSavedCaption(e){const i=this._savedCaptionsMap.get(e);return i?Kt.fromJSON(i):null}_saveCaption(e,i){this._savedCaptionsMap.set(e,i.toJSON())}_registerCaptionReconversion(){const e=this.editor,i=e.model,s=e.plugins.get("ImageUtils"),r=e.plugins.get("ImageCaptionUtils");i.document.on("change:data",()=>{const o=i.document.differ.getChanges();for(const a of o){if(a.attributeKey!=="alt")continue;const l=a.range.start.nodeAfter;if(s.isBlockImage(l)){const c=r.getCaptionFromImageModelElement(l);if(!c)return;e.editing.reconvertItem(c)}}})}}class O_e extends we{static get requires(){return[TU]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.editing.view,i=t.plugins.get("ImageCaptionUtils"),s=t.t;t.ui.componentFactory.add("toggleImageCaption",r=>{const o=t.commands.get("toggleImageCaption"),a=new pt(r);return a.set({icon:qpe,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(o,"value","isEnabled"),a.bind("label").to(o,"value",l=>s(l?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:!0});const l=i.getCaptionFromModelSelection(t.model.document.selection);if(l){const c=t.editing.mapper.toViewElement(l);e.scrollToTheSelection(),e.change(u=>{u.addClass("image__caption_highlighted",c)})}t.editing.view.focus()}),a})}}class D_e extends we{static get requires(){return[M_e,O_e]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}}function xU(n){const t=n.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function R_e(n){return new Promise((t,e)=>{const i=n.getAttribute("src");fetch(i).then(s=>s.blob()).then(s=>{const r=AU(s,i),a=`image.${r.replace("image/","")}`,l=new File([s],a,{type:r});t(l)}).catch(s=>s&&s.name==="TypeError"?F_e(i).then(t).catch(e):e(s))})}function L_e(n,t){return!n.isInlineImageView(t)||!t.getAttribute("src")?!1:!!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!t.getAttribute("src").match(/^blob:/g)}function AU(n,t){return n.type?n.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}function F_e(n){return N_e(n).then(t=>{const e=AU(t,n),s=`image.${e.replace("image/","")}`;return new File([t],s,{type:e})})}function N_e(n){return new Promise((t,e)=>{const i=Ie.document.createElement("img");i.addEventListener("load",()=>{const s=Ie.document.createElement("canvas");s.width=i.width,s.height=i.height,s.getContext("2d").drawImage(i,0,0),s.toBlob(o=>o?t(o):e())}),i.addEventListener("error",()=>e()),i.src=n})}class B_e extends we{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.ui.componentFactory.add("uploadImage",()=>this._createToolbarButton()),t.ui.componentFactory.add("imageUpload",()=>this._createToolbarButton()),t.ui.componentFactory.add("menuBar:uploadImage",()=>this._createMenuBarButton("standalone")),t.plugins.has("ImageInsertUI")&&t.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>t.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(t){const e=this.editor,i=e.locale,s=e.commands.get("uploadImage"),r=e.config.get("image.upload.types"),o=xU(r),a=new t(e.locale),l=i.t;return a.set({acceptedType:r.map(c=>`image/${c}`).join(","),allowMultipleFiles:!0,label:l("Upload from computer"),icon:Qpe}),a.bind("isEnabled").to(s),a.on("done",(c,u)=>{const d=Array.from(u).filter(h=>o.test(h.type));d.length&&(e.execute("uploadImage",{file:d}),e.editing.view.focus())}),a}_createToolbarButton(){const t=this.editor.locale.t,e=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),s=this._createButton(iN);return s.tooltip=!0,s.bind("label").to(e,"isImageSelected",i,"isAccessAllowed",(r,o)=>t(o?r?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),s}_createDropdownButton(){const t=this.editor.locale.t,e=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(iN);return i.withText=!0,i.bind("label").to(e,"isImageSelected",s=>t(s?"Replace from computer":"Upload from computer")),i.on("execute",()=>{e.dropdownView.isOpen=!1}),i}_createMenuBarButton(t){const e=this.editor.locale.t,i=this._createButton(z4);switch(i.withText=!0,t){case"standalone":i.label=e("Image from computer");break;case"insertOnly":i.label=e("Image");break;case"insertNested":i.label=e("From computer");break}return i}}class V_e extends we{constructor(e){super(e);y(this,"placeholder");y(this,"uploadStatusChange",(e,i,s)=>{const r=this.editor,o=i.item,a=o.getAttribute("uploadId");if(!s.consumable.consume(i.item,e.name))return;const l=r.plugins.get("ImageUtils"),c=r.plugins.get(kc),u=a?i.attributeNewValue:null,d=this.placeholder,h=r.editing.mapper.toViewElement(o),f=s.writer;if(u=="reading"){jN(h,f),GN(l,d,h,f);return}if(u=="uploading"){const p=c.loaders.get(a);jN(h,f),p?(YN(h,f),z_e(h,f,p,r.editing.view),G_e(l,h,f,p)):GN(l,d,h,f);return}u=="complete"&&c.loaders.get(a)&&W_e(h,f,r.editing.view),$_e(h,f),YN(h,f),H_e(h,f)});this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}function jN(n,t){n.hasClass("ck-appear")||t.addClass("ck-appear",n)}function H_e(n,t){t.removeClass("ck-appear",n)}function GN(n,t,e,i){e.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",e);const s=n.findViewImgElement(e);s.getAttribute("src")!==t&&i.setAttribute("src",t,s),CU(e,"placeholder")||i.insert(i.createPositionAfter(s),j_e(i))}function YN(n,t){n.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",n),kU(n,t,"placeholder")}function z_e(n,t,e,i){const s=U_e(t);t.insert(t.createPositionAt(n,"end"),s),e.on("change:uploadedPercent",(r,o,a)=>{i.change(l=>{l.setStyle("width",a+"%",s)})})}function $_e(n,t){kU(n,t,"progressBar")}function W_e(n,t,e){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(n,"end"),i),setTimeout(()=>{e.change(s=>s.remove(s.createRangeOn(i)))},3e3)}function U_e(n){const t=n.createUIElement("div",{class:"ck-progress-bar"});return n.setCustomProperty("progressBar",!0,t),t}function j_e(n){const t=n.createUIElement("div",{class:"ck-upload-placeholder-loader"});return n.setCustomProperty("placeholder",!0,t),t}function CU(n,t){for(const e of n.getChildren())if(e.getCustomProperty(t))return e}function kU(n,t,e){const i=CU(n,e);i&&t.remove(t.createRangeOn(i))}function G_e(n,t,e,i){if(i.data){const s=n.findViewImgElement(t);e.setAttribute("src",i.data,s)}}class Y_e extends _t{constructor(t){super(t),this.set("isAccessAllowed",!0)}refresh(){const t=this.editor,e=t.plugins.get("ImageUtils"),i=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(i)}execute(t){const e=bn(t.file),i=this.editor.model.document.selection,s=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(i.getAttributes());e.forEach((o,a)=>{const l=i.getSelectedElement();if(a&&l&&s.isImage(l)){const c=this.editor.model.createPositionAfter(l);this._uploadImage(o,r,c)}else this._uploadImage(o,r)})}_uploadImage(t,e,i){const s=this.editor,o=s.plugins.get(kc).createLoader(t),a=s.plugins.get("ImageUtils");o&&a.insertImage({...e,uploadId:o.id},i)}}class q_e extends we{constructor(e){super(e);y(this,"_uploadImageElements");y(this,"_uploadedImages",new Map);e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}static get requires(){return[kc,fN,Er,Si]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.model.document,s=e.conversion,r=e.plugins.get(kc),o=e.plugins.get("ImageUtils"),a=e.plugins.get("ClipboardPipeline"),l=xU(e.config.get("image.upload.types")),c=new Y_e(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),s.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(u=>u.on("element:img",(d,h,f)=>{if(!f.consumable.test(h.viewItem,{attributes:["data-ck-upload-id"]}))return;const p=h.viewItem.getAttribute("data-ck-upload-id");if(!p)return;const[v]=Array.from(h.modelRange.getItems({shallow:!0})),E=r.loaders.get(p);v&&(f.writer.setAttribute("uploadId",p,v),f.consumable.consume(h.viewItem,{attributes:["data-ck-upload-id"]}),E&&E.data&&f.writer.setAttribute("uploadStatus",E.status,v))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(u,d)=>{if(K_e(d.dataTransfer))return;const h=Array.from(d.dataTransfer.files).filter(p=>p?l.test(p.type):!1);if(!h.length)return;if(u.stop(),e.model.change(p=>{d.targetRanges&&p.setSelection(d.targetRanges.map(v=>e.editing.mapper.toModelRange(v))),e.execute("uploadImage",{file:h})}),!e.commands.get("uploadImage").isAccessAllowed){const p=e.plugins.get("Notification"),v=e.locale.t;p.showWarning(v("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(a,"inputTransformation",(u,d)=>{const h=Array.from(e.editing.view.createRangeIn(d.content)).map(p=>p.item).filter(p=>L_e(o,p)&&!p.getAttribute("uploadProcessed")).map(p=>({promise:R_e(p),imageElement:p}));if(!h.length)return;const f=new cO(e.editing.view.document);for(const p of h){f.setAttribute("uploadProcessed",!0,p.imageElement);const v=r.createLoader(p.promise);v&&(f.setAttribute("src","",p.imageElement),f.setAttribute("uploadId",v.id,p.imageElement))}}),e.editing.view.document.on("dragover",(u,d)=>{d.preventDefault()}),i.on("change",()=>{const u=i.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),d=new Set;for(const h of u)if(h.type=="insert"&&h.name!="$text"){const f=h.position.nodeAfter,p=h.position.root.rootName=="$graveyard";for(const v of X_e(e,f)){const E=v.getAttribute("uploadId"),x=v.getAttribute("uploadStatus");if(!E||x=="complete")continue;const A=r.loaders.get(E);if(!A){!p&&this._uploadedImages.has(E)&&e.model.enqueueChange({isUndoable:!1},O=>{O.setAttribute("uploadStatus","complete",v),this.fire("uploadComplete",{data:this._uploadedImages.get(E),imageElement:v})});continue}p?d.has(E)||Array.from(this._uploadImageElements.get(E)).every(I=>I.root.rootName=="$graveyard")&&A.abort():(d.add(E),this._uploadImageElements.has(E)?this._uploadImageElements.get(E).add(v):this._uploadImageElements.set(E,new Set([v])),A.status=="idle"&&this._readAndUpload(A))}}}),this.on("uploadComplete",(u,{imageElement:d,data:h})=>{const f=h.urls?h.urls:h;this.editor.model.change(p=>{p.setAttribute("src",f.default,d),this._parseAndSetSrcsetAttributeOnImage(f,d,p),o.setImageNaturalSizeAttributes(d)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const i=this.editor,s=i.model,r=i.locale.t,o=i.plugins.get(kc),a=i.plugins.get(fN),l=i.plugins.get("ImageUtils"),c=this._uploadImageElements;return s.enqueueChange({isUndoable:!1},d=>{const h=c.get(e.id);for(const f of h)d.setAttribute("uploadStatus","reading",f)}),e.read().then(()=>{const d=e.upload();i.ui&&i.ui.ariaLiveAnnouncer.announce(r("Uploading image"));for(const h of c.get(e.id)){/* istanbul ignore next -- @preserve */if(Ge.isSafari){const f=i.editing.mapper.toViewElement(h),p=l.findViewImgElement(f);i.editing.view.once("render",()=>{if(!p.parent)return;const v=i.editing.view.domConverter.mapViewToDom(p.parent);if(!v)return;const E=v.style.display;v.style.display="none",v._ckHack=v.offsetHeight,v.style.display=E})}s.enqueueChange({isUndoable:!1},f=>{f.setAttribute("uploadStatus","uploading",h)})}return d}).then(d=>{s.enqueueChange({isUndoable:!1},h=>{for(const f of c.get(e.id))h.setAttribute("uploadStatus","complete",f),this.fire("uploadComplete",{data:d,imageElement:f});i.ui&&i.ui.ariaLiveAnnouncer.announce(r("Image upload complete")),this._uploadedImages.set(e.id,d)}),u()}).catch(d=>{if(i.ui&&i.ui.ariaLiveAnnouncer.announce(r("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw d;e.status=="error"&&d&&a.showWarning(d,{title:r("Upload failed"),namespace:"upload"}),s.enqueueChange({isUndoable:!1},h=>{for(const f of c.get(e.id))f.root.rootName!=="$graveyard"&&h.remove(f)}),u()});function u(){s.enqueueChange({isUndoable:!1},d=>{for(const h of c.get(e.id))d.removeAttribute("uploadId",h),d.removeAttribute("uploadStatus",h);c.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,i,s){let r=0;const o=Object.keys(e).filter(a=>{const l=parseInt(a,10);if(!isNaN(l))return r=Math.max(r,l),!0}).map(a=>`${e[a]} ${a}w`).join(", ");
557if(o!=""){const a={srcset:o};!i.hasAttribute("width")&&!i.hasAttribute("height")&&(a.width=r),s.setAttributes(a,i)}}_registerConverters(e){const{conversion:i,plugins:s}=this.editor,r=s.get(kc),o=s.get(Si);i.for("dataDowncast").add(a=>{a.on(`attribute:uploadId:${e}`,(l,c,u)=>{if(!u.consumable.test(c.item,l.name))return;const d=r.loaders.get(c.attributeNewValue);if(!d||!d.data)return null;const h=u.mapper.toViewElement(c.item),f=o.findViewImgElement(h);f&&(u.consumable.consume(c.item,l.name),u.writer.setAttribute("data-ck-upload-id",d.id,f))})})}}function K_e(n){return Array.from(n.types).includes("text/html")&&n.getData("text/html")!==""}function X_e(n,t){const e=n.plugins.get("ImageUtils");return Array.from(n.model.createRangeOn(t)).filter(i=>e.isImage(i.item)).map(i=>i.item)}class J_e extends we{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[q_e,B_e,V_e]}}class Z_e extends _t{refresh(){const t=this.editor,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(t.model.document.selection);this.isEnabled=!!i,!i||!i.hasAttribute("resizedWidth")?this.value=null:this.value={width:i.getAttribute("resizedWidth"),height:null}}execute(t){const e=this.editor,i=e.model,s=e.plugins.get("ImageUtils"),r=s.getClosestSelectedImageElement(i.document.selection);this.value={width:t.width,height:null},r&&i.change(o=>{o.setAttribute("resizedWidth",t.width,r),o.removeAttribute("resizedHeight",r),s.setImageNaturalSizeAttributes(r)})}}class IU extends we{static get requires(){return[Si]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(t){super(t),t.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const t=this.editor,e=new Z_e(t);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),t.commands.add("resizeImage",e),t.commands.add("imageResize",e)}afterInit(){this._registerSchema()}_registerSchema(){const t=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(t.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),t.setAttributeProperties("resizedWidth",{isFormatting:!0}),t.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(t.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),t.setAttributeProperties("resizedWidth",{isFormatting:!0}),t.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(t){const e=this.editor,i=e.plugins.get("ImageUtils");e.conversion.for("downcast").add(s=>s.on(`attribute:resizedWidth:${t}`,(r,o,a)=>{if(!a.consumable.consume(o.item,r.name))return;const l=a.writer,c=a.mapper.toViewElement(o.item);o.attributeNewValue!==null?(l.setStyle("width",o.attributeNewValue,c),l.addClass("image_resized",c)):(l.removeStyle("width",c),l.removeClass("image_resized",c))})),e.conversion.for("dataDowncast").attributeToAttribute({model:{name:t,key:"resizedHeight"},view:s=>({key:"style",value:{height:s}})}),e.conversion.for("editingDowncast").add(s=>s.on(`attribute:resizedHeight:${t}`,(r,o,a)=>{if(!a.consumable.consume(o.item,r.name))return;const l=a.writer,c=a.mapper.toViewElement(o.item),u=t==="imageInline"?i.findViewImgElement(c):c;o.attributeNewValue!==null?l.setStyle("height",o.attributeNewValue,u):l.removeStyle("height",u)})),e.conversion.for("upcast").attributeToAttribute({view:{name:t==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:s=>i1(s)?null:s.getStyle("width")}}),e.conversion.for("upcast").attributeToAttribute({view:{name:t==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:s=>i1(s)?null:s.getStyle("height")}}),e.conversion.for("upcast").add(s=>{s.on(`element:${t==="imageBlock"?"figure":"img"}`,(r,o,a)=>{a.consumable.consume(o.viewItem,{classes:["image_resized"]})})})}}const NA=(()=>({small:lbe,medium:abe,large:obe,custom:sbe,original:rbe}))();class Q_e extends we{constructor(e){super(e);y(this,"_resizeUnit");this._resizeUnit=e.config.get("image.resizeUnit")}static get requires(){return[IU]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=e.config.get("image.resizeOptions"),s=e.commands.get("resizeImage");this.bind("isEnabled").to(s);for(const r of i)this._registerImageResizeButton(r);this._registerImageResizeDropdown(i)}_registerImageResizeButton(e){const i=this.editor,{name:s,value:r,icon:o}=e;i.ui.componentFactory.add(s,a=>{const l=new pt(a),c=i.commands.get("resizeImage"),u=this._getOptionLabelValue(e,!0);if(!NA[o])throw new ee("imageresizebuttons-missing-icon",i,e);if(l.set({label:u,icon:NA[o],tooltip:u,isToggleable:!0}),l.bind("isEnabled").to(this),i.plugins.has("ImageCustomResizeUI")&&Ep(e)){const d=i.plugins.get("ImageCustomResizeUI");this.listenTo(l,"execute",()=>{d._showForm(this._resizeUnit)})}else{const d=r?r+this._resizeUnit:null;l.bind("isOn").to(c,"value",c,"isEnabled",kI(d)),this.listenTo(l,"execute",()=>{i.execute("resizeImage",{width:d})})}return l})}_registerImageResizeDropdown(e){const i=this.editor,s=i.t,r=e.find(a=>!a.value),o=a=>{const l=i.commands.get("resizeImage"),c=hl(a,O4),u=c.buttonView,d=s("Resize image");return u.set({tooltip:d,commandValue:r.value,icon:NA.medium,isToggleable:!0,label:this._getOptionLabelValue(r),withText:!0,class:"ck-resize-image-button",ariaLabel:d,ariaLabelledBy:void 0}),u.bind("label").to(l,"value",h=>h&&h.width?h.width:this._getOptionLabelValue(r)),c.bind("isEnabled").to(this),mO(c,()=>this._getResizeDropdownListItemDefinitions(e,l),{ariaLabel:s("Image resize list"),role:"menu"}),this.listenTo(c,"execute",h=>{"onClick"in h.source?h.source.onClick():(i.execute(h.source.commandName,{width:h.source.commandValue}),i.editing.view.focus())}),c};i.ui.componentFactory.add("resizeImage",o),i.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,i=!1){const s=this.editor.t;return e.label?e.label:i?Ep(e)?s("Custom image size"):e.value?s("Resize image to %0",e.value+this._resizeUnit):s("Resize image to the original size"):Ep(e)?s("Custom"):e.value?e.value+this._resizeUnit:s("Original")}_getResizeDropdownListItemDefinitions(e,i){const{editor:s}=this,r=new er,o=e.map(a=>Ep(a)?{...a,valueWithUnits:"custom"}:a.value?{...a,valueWithUnits:`${a.value}${this._resizeUnit}`}:{...a,valueWithUnits:null});for(const a of o){let l=null;
557if(s.plugins.has("ImageCustomResizeUI")&&Ep(a)){const c=s.plugins.get("ImageCustomResizeUI");l={type:"button",model:new JE({label:this._getOptionLabelValue(a),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{c._showForm(this._resizeUnit)}})};const u=Object.values(o).map(d=>d.valueWithUnits);l.model.bind("isOn").to(i,"value",i,"isEnabled",e0e(u))}else l={type:"button",model:new JE({commandName:"resizeImage",commandValue:a.valueWithUnits,label:this._getOptionLabelValue(a),role:"menuitemradio",withText:!0,icon:null})},l.model.bind("isOn").to(i,"value",i,"isEnabled",kI(a.valueWithUnits));l.model.bind("isEnabled").to(i,"isEnabled"),r.add(l)}return r}}function Ep(n){return n.value==="custom"}function kI(n){return(t,e)=>{const i=t;return i===void 0||!e?!1:n===null&&i===n?!0:i!==null&&i.width===n}}function e0e(n){return(t,e)=>!n.some(i=>kI(i)(t,e))}const t0e="figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img",BA="image_resized";class n0e extends we{static get requires(){return[LA,Si]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(t),this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor,e=t.editing.view,i=t.plugins.get("ImageUtils");e.addObserver(EO),this.listenTo(e.document,"imageLoaded",(s,r)=>{if(!r.target.matches(t0e))return;const o=t.editing.view.domConverter,a=o.domToView(r.target),l=i.getImageWidgetFromImageView(a);let c=this.editor.plugins.get(LA).getResizerByViewElement(l);if(c){c.redraw();return}const u=t.editing.mapper,d=u.toModelElement(l);c=t.plugins.get(LA).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:d,viewElement:l,editor:t,getHandleHost(h){return h.querySelector("img")},getResizeHost(){return o.mapViewToDom(u.toViewElement(d))},isCentered(){return d.getAttribute("imageStyle")=="alignCenter"},onCommit(h){e.change(f=>{f.removeClass(BA,l)}),t.execute("resizeImage",{width:h})}}),c.on("updateSize",()=>{l.hasClass(BA)||e.change(f=>{f.addClass(BA,l)});const h=d.name==="imageInline"?a:l;h.getStyle("height")&&e.change(f=>{f.removeStyle("height",h)})}),c.bind("isEnabled").to(this)})}}/** 558 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 559 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 560 */function PU(n){if(!n)return null;const[,t,e]=n.trim().match(/([.,\d]+)(%|px)$/)||[],i=Number.parseFloat(t);return Number.isNaN(i)?null:{value:i,unit:e}}function MU(n,t,e){return e==="px"?{value:t.value,unit:"px"}:{value:t.value/n*100,unit:"%"}}/** 561 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 562 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 563 */function OU(n){const{editing:t}=n,i=n.plugins.get("ImageUtils").getClosestSelectedImageElement(n.model.document.selection);if(!i)return null;const s=t.mapper.toViewElement(i),r=t.view.domConverter.mapViewToDom(s);return{model:i,view:s,dom:r}}function i0e(n,t){const e=OU(n);if(!e)return null;const i=PU(e.model.getAttribute("resizedWidth")||null);if(!i)return null;if(i.unit===t)return i;const s=wO(e.dom),r={value:new tt(e.dom).width};return MU(s,r,t)}class s0e extends Ye{constructor(e,i,s){super(e);y(this,"focusTracker");y(this,"keystrokes");y(this,"unit");y(this,"backButtonView");y(this,"saveButtonView");y(this,"labeledInput");y(this,"children");y(this,"_focusables");y(this,"_focusCycler");y(this,"_validators");this.focusTracker=new fi,this.keystrokes=new rs,this.unit=i,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new XE(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]}
563)),this._focusables=new tr,this._validators=s,this.keystrokes.set("Esc",(r,o)=>{this.fire("cancel"),o()}),this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),JT({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(i=>{this._focusables.add(i),this.focusTracker.add(i.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({class:"ck-button-back",label:e("Back"),icon:Rm,tooltip:!0}),i.delegate("execute").to(this,"cancel"),i}_createSaveButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),i}_createHeaderView(){const e=this.locale.t,i=new Lm(this.locale,{label:e("Image Resize")});return i.children.add(this.backButtonView,0),i}_createLabeledInputView(){const e=this.locale.t,i=new KE(this.locale,Owe);return i.label=e("Resize image (in %0)",this.unit),i.class="ck-labeled-field-view_full-width",i.fieldView.set({step:.1}),i}isValid(){this.resetFormStatus();for(const e of this._validators){const i=e(this);if(i)return this.labeledInput.errorText=i,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(e===null)return null;const i=Number.parseFloat(e);return Number.isNaN(i)?null:i}get sizeWithUnits(){const{parsedSize:e,unit:i}=this;return e===null?null:`${e}${i}`}}function r0e(n,t){const e=OU(n);if(!e)return null;const i=wO(e.dom),s=PU(window.getComputedStyle(e.dom).minWidth)||{value:1},r=Math.max(.1,MU(i,s,t).value);return{unit:t,lower:r,upper:t==="px"?i:100}}class o0e extends we{constructor(){super(...arguments);y(this,"_balloon");y(this,"_form")}static get requires(){return[Xb]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const i=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(qE(s0e))(i.locale,e,a0e(i)),this._form.render(),this.listenTo(this._form,"submit",()=>{this._form.isValid()&&(i.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))}),this.listenTo(this._form.labeledInput,"change:errorText",()=>{i.ui.update()}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),Fy({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const i=this.editor,s=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:_O(i)});const r=i0e(i,e),o=r?r.value.toFixed(1):"",a=r0e(i,e);s.fieldView.value=s.fieldView.element.value=o,a&&Object.assign(s.fieldView,{min:a.lower.toFixed(1),max:Math.ceil(a.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}function a0e(n){const t=n.t;return[e=>{if(e.rawSize.trim()==="")return t("The value must not be empty.");if(e.parsedSize===null)return t("The value should be a plain number.")}]}class l0e extends we{static get requires(){return[IU,n0e,o0e,Q_e]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}}class c0e extends _t{constructor(e,i){super(e);y(this,"_defaultStyles");y(this,"_styles");this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(i.map(s=>{if(s.isDefault)for(const r of s.modelElements)this._defaultStyles[r]=s.name;return[s.name,s]}))}refresh(){const s=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!s,this.isEnabled?s.hasAttribute("imageStyle")?this.value=s.getAttribute("imageStyle"):this.value=this._defaultStyles[s.name]:this.value=!1}execute(e={}){const i=this.editor,s=i.model,r=i.plugins.get("ImageUtils");s.change(o=>{const a=e.value,{setImageSizes:l=!0}=e;let c=r.getClosestSelectedImageElement(s.document.selection);a&&this.shouldConvertImageType(a,c)&&(this.editor.execute(r.isBlockImage(c)?"imageTypeInline":"imageTypeBlock",{setImageSizes:l}),c=r.getClosestSelectedImageElement(s.document.selection)),!a||this._styles.get(a).isDefault?o.removeAttribute("imageStyle",c):o.setAttribute("imageStyle",a,c),l&&r.setImageNaturalSizeAttributes(c)})}shouldConvertImageType(e,i){return!this._styles.get(e).modelElements.includes(i.name)}}const q0={get inline(){return{name:"inline",title:"In line",icon:w4,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:b4,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:v4,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:pI,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:bI,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:y4,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:pI,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:bI,modelElements:["imageBlock"],className:"image-style-side"}}},u0e=(()=>({full:ibe,left:v4,right:y4,center:pI,inlineLeft:b4,inlineRight:bI,inline:w4}))(),d0e=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function h0e(n){return(n.configuredStyles.options||[]).map(i=>m0e(i)).filter(i=>p0e(i,n))}function f0e(n,t){return n&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:n?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}}function g0e(n){return n.has("ImageBlockEditing")&&n.has("ImageInlineEditing")?[...d0e]:[]}function m0e(n){return typeof n=="string"?q0[n]?n={...q0[n]}:n={name:n}
563:n=b0e(q0[n.name],n),typeof n.icon=="string"&&(n.icon=u0e[n.icon]||n.icon),n}function p0e(n,{isBlockPluginLoaded:t,isInlinePluginLoaded:e}){const{modelElements:i,name:s}=n;if(!i||!i.length||!s)return DU({style:n}),!1;{const r=[t?"imageBlock":null,e?"imageInline":null];if(!i.some(o=>r.includes(o)))return Dt("image-style-missing-dependency",{style:n,missingPlugins:i.map(o=>o==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}function b0e(n,t){const e={...t};for(const i in n)Object.prototype.hasOwnProperty.call(t,i)||(e[i]=n[i]);return e}function DU(n){Dt("image-style-configuration-definition-invalid",n)}const r1={normalizeStyles:h0e,getDefaultStylesConfiguration:f0e,getDefaultDropdownDefinitions:g0e,warnInvalidStyle:DU};function w0e(n){return(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const s=II(e.attributeNewValue,n),r=II(e.attributeOldValue,n),o=i.mapper.toViewElement(e.item),a=i.writer;r&&a.removeClass(r.className,o),s&&a.addClass(s.className,o)}}function v0e(n){const t={imageInline:n.filter(e=>!e.isDefault&&e.modelElements.includes("imageInline")),imageBlock:n.filter(e=>!e.isDefault&&e.modelElements.includes("imageBlock"))};return(e,i,s)=>{if(!i.modelRange)return;const r=i.viewItem,o=$i(i.modelRange.getItems());if(o&&s.schema.checkAttribute(o,"imageStyle")){for(const a of t[o.name])s.consumable.consume(r,{classes:a.className})&&s.writer.setAttribute("imageStyle",a.name,o);y0e(s,r,o,n)}}}function y0e(n,t,e,i){if(!n.consumable.test(t,{styles:["float"]}))return;let s=null;const r=e.is("element","imageBlock")?"Block":"";switch(t.getStyle("float")){case"left":s=`align${r}Left`;break;case"right":s=`align${r}Right`;break}if(!s)return;const o=II(s,i);if(!o)return;const a=q0[o.name];u_e(o,a)&&(n.writer.setAttribute("imageStyle",s,e),n.consumable.consume(t,{styles:["float"]}))}function II(n,t){for(const e of t)if(e.name===n)return e}class RU extends we{constructor(){super(...arguments);y(this,"normalizedStyles")}static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Si]}init(){const e=this.editor,i=e.plugins.has("ImageBlockEditing"),s=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",r1.getDefaultStylesConfiguration(i,s)),this.normalizedStyles=r1.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:s}),this._setupConversion(i,s),this._setupPostFixer(),e.commands.add("imageStyle",new c0e(e,this.normalizedStyles))}_setupConversion(e,i){const s=this.editor,r=s.model.schema,o=w0e(this.normalizedStyles),a=v0e(this.normalizedStyles);s.editing.downcastDispatcher.on("attribute:imageStyle",o),s.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(r.extend("imageBlock",{allowAttributes:"imageStyle"}),r.setAttributeProperties("imageStyle",{isFormatting:!0}),s.data.upcastDispatcher.on("element:figure",a,{priority:"low"})),i&&(r.extend("imageInline",{allowAttributes:"imageStyle"}),r.setAttributeProperties("imageStyle",{isFormatting:!0}),s.data.upcastDispatcher.on("element:img",a,{priority:"low"}))}_setupPostFixer(){const e=this.editor,i=e.model.document,s=e.plugins.get(Si),r=new Map(this.normalizedStyles.map(o=>[o.name,o]));i.registerPostFixer(o=>{let a=!1;for(const l of i.differ.getChanges())if(l.type=="insert"||l.type=="attribute"&&l.attributeKey=="imageStyle"){let c=l.type=="insert"?l.position.nodeAfter:l.range.start.nodeAfter;if(c&&c.is("element","paragraph")&&c.childCount>0&&(c=c.getChild(0)),!s.isImage(c))continue;const u=c.getAttribute("imageStyle");if(!u)continue;const d=r.get(u);(!d||!d.modelElements.includes(c.name))&&(o.removeAttribute("imageStyle",c),a=!0)}return a})}}class _0e extends we{static get requires(){return[RU]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins,e=this.editor.config.get("image.toolbar")||[],i=t.get("ImageStyleEditing"),s=q
563N(i.normalizedStyles,this.localizedDefaultStylesTitles);for(const o of s)this._createButton(o);const r=qN([...e.filter(ys),...r1.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const o of r)this._createDropdown(o,s)}_createDropdown(t,e){const i=this.editor.ui.componentFactory;i.add(t.name,s=>{let r;const{defaultItem:o,items:a,title:l}=t,c=a.filter(f=>e.find(({name:p})=>KN(p)===f)).map(f=>{const p=i.create(f);return f===o&&(r=p),p});a.length!==c.length&&r1.warnInvalidStyle({dropdown:t});const u=hl(s,tx),d=u.buttonView,h=d.arrowView;return gO(u,c,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:XN(l,r.label),class:null,tooltip:!0}),h.unbind("label"),h.set({label:l}),d.bind("icon").toMany(c,"isOn",(...f)=>{const p=f.findIndex(dp);return p<0?r.icon:c[p].icon}),d.bind("label").toMany(c,"isOn",(...f)=>{const p=f.findIndex(dp);return XN(l,p<0?r.label:c[p].label)}),d.bind("isOn").toMany(c,"isOn",(...f)=>f.some(dp)),d.bind("class").toMany(c,"isOn",(...f)=>f.some(dp)?"ck-splitbutton_flatten":void 0),d.on("execute",()=>{c.some(({isOn:f})=>f)?u.isOpen=!u.isOpen:r.fire("execute")}),u.bind("isEnabled").toMany(c,"isEnabled",(...f)=>f.some(dp)),this.listenTo(u,"execute",()=>{this.editor.editing.view.focus()}),u})}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(KN(e),i=>{const s=this.editor.commands.get("imageStyle"),r=new pt(i);return r.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(s,"isEnabled"),r.bind("isOn").to(s,"value",o=>o===e),r.on("execute",this._executeCommand.bind(this,e)),r})}_executeCommand(t){this.editor.execute("imageStyle",{value:t}),this.editor.editing.view.focus()}}function qN(n,t){for(const e of n)t[e.title]&&(e.title=t[e.title]);return n}function KN(n){return`imageStyle:${n}`}function XN(n,t){return(n?n+": ":"")+t}class E0e extends we{static get requires(){return[RU,_0e]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}}class S0e extends we{static get requires(){return[e1,Si]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const t=this.editor,e=t.t,i=t.plugins.get(e1),s=t.plugins.get("ImageUtils");i.register("image",{ariaLabel:e("Image toolbar"),items:T0e(t.config.get("image.toolbar")||[]),getRelatedElement:r=>s.getClosestSelectedImageWidget(r)})}}function T0e(n){return n.map(t=>ys(t)?t.name:t)}/** 564 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 565 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 566 */class x0e{constructor(){y(this,"_definitions",new Set)}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(e=>this._definitions.add(e)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(e,i,s)=>{if(!s.consumable.test(i.item,"attribute:linkHref")||!(i.item.is("selection")||s.schema.isInline(i.item)))return;const r=s.writer,o=r.document.selection;for(const a of this._definitions){const l=r.createAttributeElement("a",a.attributes,{priority:5});a.classes&&r.addClass(a.classes,l);for(const c in a.styles)r.setStyle(c,a.styles[c],l);r.setCustomProperty("link",!0,l),a.callback(i.attributeNewValue)?i.item.is("selection")?r.wrap(o.getFirstRange(),l):r.wrap(s.mapper.toViewRange(i.range),l):r.unwrap(s.mapper.toViewRange(i.range),l)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",(e,i,{writer:s,mapper:r})=>{const o=r.toViewElement(i.item),a=Array.from(o.getChildren()).find(l=>l.is("element","a"));if(a)for(const l of this._definitions){const c=Qo(l.attributes);if(l.callback(i.attributeNewValue)){for(const[u,d]of c)u==="class"?s.addClass(d,a):s.setAttribute(u,d,a);l.classes&&s.addClass(l.classes,a);for(const u in l.styles)s.setStyle(u,l.styles[u],a)}else{for(const[u,d]of c)u==="class"?s.removeClass(d,a):s.removeAttribute(u,a);l.classes&&s.removeClass(l.classes,a);for(const u in l.styles)s.removeStyle(u,a)}}})}}}const A0e=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,C0e="^(?:(?:<protocols>):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))",k0e=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,I0e=/^((\w+:(\/{2,})?)|(\W))/i,P0e=["https?","ftps?","mailto"],Kp="Ctrl+K";function M0e(n){return n.is("attributeElement")&&!!n.getCustomProperty("link")}function JN(n,{writer:t}){const e=t.createAttributeElement("a",{href:n},{priority:5});return t.setCustomProperty("link",!0,e),e}function LU(n,t=P0e){const e=String(n),i=t.join("|"),s=new RegExp(`${C0e.replace("<protocols>",i)}`,"i");return O0e(e,s)?e:"#"}function O0e(n,t){return!!n.replace(A0e,"").match(t)}function D0e(n,t){const e={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return t.forEach(i=>
566("label"in i&&e[i.label]&&(i.label=e[i.label]),i)),t}function R0e(n){const t=[];if(n)for(const[e,i]of Object.entries(n)){const s=Object.assign({},i,{id:`link${Ede(e)}`});t.push(s)}return t}function PI(n,t){return n?t.checkAttribute(n.name,"linkHref"):!1}function L0e(n){return k0e.test(n)}function SO(n,t){const e=L0e(n)?"mailto:":t,i=!!e&&!FU(n);return n&&i?e+n:n}function FU(n){return I0e.test(n)}function F0e(n){window.open(n,"_blank","noopener")}function MI(n){let t="";for(const e of n.getItems()){if(!e.is("$text")&&!e.is("$textProxy"))return;t+=e.data}return t}class N0e extends _t{constructor(){super(...arguments);y(this,"manualDecorators",new er);y(this,"automaticDecorators",new x0e)}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,i=e.document.selection,s=i.getSelectedElement()||$i(i.getSelectedBlocks());PI(s,e.schema)?(this.value=s.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(s,"linkHref")):(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(i,"linkHref"));for(const r of this.manualDecorators)r.value=this._getDecoratorStateFromModel(r.id)}execute(e,i={},s){const r=this.editor.model,o=r.document.selection,a=[],l=[];for(const c in i)i[c]?a.push(c):l.push(c);r.change(c=>{const u=f=>{c.setAttribute("linkHref",e,f),a.forEach(p=>c.setAttribute(p,!0,f)),l.forEach(p=>c.removeAttribute(p,f))},d=(f,p)=>{const v=MI(f);if(!v)return f;let E=s;if(E||(E=p&&p==v?e:v),E!=v){const x=c.createDocumentFragment();for(const T of f.getItems()){const P=T;c.append(c.createText(P.data,P.getAttributes()),x)}const A=c.createRangeIn(x),O=B0e(v,E);let I=0;for(const{offset:T,actual:P,expected:k}of O){const D=T+I,U=c.createRange(A.start.getShiftedBy(D),A.start.getShiftedBy(D+P.length)),K=V0e(U,A).getAttributes(),j=Array.from(K).filter(([N])=>r.schema.getAttributeProperties(N).isFormatting),L=c.createText(k,j);u(L),c.remove(U),c.insert(L,U.start),I+=k.length}return r.insertContent(x,f),c.createRange(f.start,f.start.getShiftedBy(E.length))}},h=f=>{const{plugins:p}=this.editor;if(c.setSelection(f.end),p.has("TwoStepCaretMovement"))p.get("TwoStepCaretMovement")._handleForwardMovement();else for(const v of["linkHref",...a,...l])c.removeSelectionAttribute(v)};if(o.isCollapsed){const f=o.getFirstPosition();if(o.hasAttribute("linkHref")){const p=o.getAttribute("linkHref"),v=ix(f,"linkHref",p,r),E=d(v,p);u(E||v),E&&h(E)}else if(e!==""){const p=Qo(o.getAttributes());p.set("linkHref",e),a.forEach(E=>{p.set(E,!0)});const v=r.insertContent(c.createText(s||e,p),f);h(v)}}else{const f=Array.from(o.getRanges()),p=r.schema.getValidRanges(f,"linkHref"),v=[];for(const A of o.getSelectedBlocks())r.schema.checkAttribute(A,"linkHref")&&v.push(c.createRangeOn(A));const E=v.slice();for(const A of p)this._isRangeToUpdate(A,v)&&E.push(A);const x=f.map(A=>({start:Mn.fromPosition(A.start,"toPrevious"),end:Mn.fromPosition(A.end,"toNext")}));for(let A of E){const O=(A.start.textNode||A.start.nodeAfter).getAttribute("linkHref");A=d(A,O)||A,u(A)}c.setSelection(x.map(A=>{const O=A.start.toPosition(),I=A.end.toPosition();return A.start.detach(),A.end.detach(),r.createRange(O,I)}))}})}_getDecoratorStateFromModel(e){const i=this.editor.model,s=i.document.selection,r=s.getSelectedElement();return PI(r,i.schema)?r.getAttribute(e):s.getAttribute(e)}_isRangeToUpdate(e,i){for(const s of i)if(s.containsRange(e))return!1;return!0}}function B0e(n,t){const e=kf(n,t),i={equal:0,insert:0,delete:0},s=[];let r="",o="";for(const a of[...e,null])a=="insert"?o+=t[i.equal+i.insert]:a=="delete"?r+=n[i.equal+i.delete]:(r.length||o.length)&&(s.push({offset:i.equal,actual:r,expected:o}),r="",o=""),a&&i[a]++;return s}function V0e(n,t){if(!n.isCollapsed)return $i(n.getItems());const e=n.start;return e.textNode?e.textNode:!e.nodeBefore||e.isEqual(t.start)?e.
566nodeAfter:e.nodeBefore}class H0e extends _t{refresh(){const t=this.editor.model,e=t.document.selection,i=e.getSelectedElement();PI(i,t.schema)?this.isEnabled=t.schema.checkAttribute(i,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,s=t.commands.get("link");e.change(r=>{const o=i.isCollapsed?[ix(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),e)]:e.schema.getValidRanges(i.getRanges(),"linkHref");for(const a of o)if(r.removeAttribute("linkHref",a),s)for(const l of s.manualDecorators)r.removeAttribute(l.id,a)})}}class z0e extends Ut(){constructor({id:e,label:i,attributes:s,classes:r,styles:o,defaultValue:a}){super();y(this,"id");y(this,"defaultValue");y(this,"label");y(this,"attributes");y(this,"classes");y(this,"styles");this.id=e,this.set("value",void 0),this.defaultValue=a,this.label=i,this.attributes=s,this.classes=r,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const $0e="ck-link_selected",ZN="automatic",W0e="manual",U0e=/^(https?:)?\/\//;class Em extends we{constructor(e){super(e);y(this,"_linkOpeners",[]);e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[vN,U4,Er]}init(){const e=this.editor,i=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:JN}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(o,a)=>JN(LU(o,i),a)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:o=>o.getAttribute("href")}}),e.commands.add("link",new N0e(e)),e.commands.add("unlink",new H0e(e));const s=D0e(e.t,R0e(e.config.get("link.decorators")));this._enableAutomaticDecorators(s.filter(o=>o.mode===ZN)),this._enableManualDecorators(s.filter(o=>o.mode===W0e)),e.plugins.get(vN).registerAttribute("linkHref"),vve(e,"linkHref","a",$0e),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){const i=this.editor,r=i.commands.get("link").automaticDecorators;i.config.get("link.addTargetToExternalLinks")&&r.add({id:"linkIsExternal",mode:ZN,callback:o=>!!o&&U0e.test(o),attributes:{target:"_blank",rel:"noopener noreferrer"}}),r.add(e),r.length&&i.conversion.for("downcast").add(r.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const i=this.editor,r=i.commands.get("link").manualDecorators;e.forEach(o=>{i.model.schema.extend("$text",{allowAttributes:o.id});const a=new z0e(o);r.add(a),i.conversion.for("downcast").attributeToElement({model:a.id,view:(l,{writer:c,schema:u},{item:d})=>{if((d.is("selection")||u.isInline(d))&&l){const h=c.createAttributeElement("a",a.attributes,{priority:5});a.classes&&c.addClass(a.classes,h);for(const f in a.styles)c.setStyle(f,a.styles[f],h);return c.setCustomProperty("link",!0,h),h}}}),i.conversion.for("upcast").elementToAttribute({view:{name:"a",...a._createPattern()},model:{key:a.id}})})}_enableLinkOpen(){const e=this.editor,s=e.editing.view.document,r=o=>{this._linkOpeners.some(a=>a(o))||F0e(o)};this.listenTo(s,"click",(o,a)=>{if(!(Ge.isMac?a.domEvent.metaKey:a.domEvent.ctrlKey))return;let c=a.domTarget;if(c.tagName.toLowerCase()!="a"&&(c=c.closest("a")),!c)return;const u=c.getAttribute("href");u&&(o.stop(),a.preventDefault(),r(u))},{context:"$capture"}),this.listenTo(s,"keydown",(o,a)=>{const c=e.commands.get("link").value;c&&a.keyCode===ft.enter&&a.altKey&&(o.stop(),r(c))})}_enableSelectionAttributesFixer(){const i=this.editor.model,s=i.document.selection;this.listenTo(s,"change:attribute",(r,{attributeKeys:o})=>{!o.includes("linkHref")||s.hasAttribute("linkHref")||i.change(a=>{j0e(a,G0e(i.schema))})})}_enableClipboardIntegration(){const e=this.editor,i=e.model,s=this.editor.config.get("link.defaultProtocol");s&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(r,o)=>{i.change(a=>{const l=a.createRangeIn(o.content);for(const c of l.getItems())if(c.hasAttribute("linkHref")){const u=SO(c.getAttribute("linkHref"),s);a.setAttribute("linkHref",u,c)}})})}}function j0e(n,t){n.removeSelectionAttribute("linkHref");for(const e of t)n.removeSelectionAttribute(e)}function G0e(n){return n.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}class Y0e extends pt{constructor(t){super(t);const e=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:e.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:e.to(i=>{if(this.href){const s=()=>i.preventDefault();this.fire("navigate",this.href,s)}})}}),this.template.tag="a"}}class q0e extends Ye{constructor(e,i){super(e);y(this,"focusTracker",new fi);y(this,"keystrokes",new rs);y(this,"backButtonView");y(this,"saveButtonView");y(this,"displayedTextInputView");y(this,"urlInputView");y(this,"children");y(this,"providersListChildren");y(this,"_validators");y(this,"_focusables",new tr);y(this,"_focusCycler");
vendor: 17,469 bytes, line 566
566this._validators=i,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())}),this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),JT({view:this}),[this.urlInputView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach(i=>{this._focusables.add(i),this.focusTracker.add(i.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const i=e(this);if(i)return this.urlInputView.errorText=i,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({class:"ck-button-back",label:e("Back"),icon:Rm,tooltip:!0}),i.delegate("execute").to(this,"cancel"),i}_createSaveButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),i}_createHeaderView(){const e=this.locale.t,i=new Lm(this.locale,{label:e("Link")});return i.children.add(this.backButtonView,0),i}_createProvidersListView(){const e=new Nm(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using(i=>{const s=new ho(this.locale);return s.children.add(i),s}),e}_createDisplayedTextInput(){const e=this.locale.t,i=new KE(this.locale,TI);return i.label=e("Displayed text"),i.class="ck-labeled-field-view_full-width",i}_createUrlInput(){const e=this.locale.t,i=new KE(this.locale,TI);return i.fieldView.inputMode="url",i.label=e("Link URL"),i.class="ck-labeled-field-view_full-width",i}_createFormChildren(){this.children.add(new XE(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new XE(this.locale,{children:[this.urlInputView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]}))}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class K0e extends Ye{constructor(e){super(e);y(this,"focusTracker",new fi);y(this,"keystrokes",new rs);y(this,"backButtonView");y(this,"listView");y(this,"listChildren");y(this,"emptyListInformation");y(this,"children");y(this,"_focusables",new tr);y(this,"_focusCycler");this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",()=>{this.hasItems=this.listChildren.length>0}),this.on("change:hasItems",(i,s,r)=>{r?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))}),this.keystrokes.set("Esc",(i,s)=>{this.fire("cancel"),s()}),this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render(),[this.listView,this.backButtonView].forEach(i=>{this._focusables.add(i),this.focusTracker.add(i.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){const e=new Nm(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using(i=>{const s=new ho(this.locale);return s.children.add(i),s}),e}_createBackButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({class:"ck-button-back",label:e("Back"),icon:Rm,tooltip:!0}),i.delegate("execute").to(this,"cancel"),i}_createHeaderView(){const e=new Lm(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){const e=new Ye(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}}class X0e extends Ye{constructor(e){super(e);y(this,"focusTracker",new fi);y(this,"keystrokes",new rs);y(this,"backButtonView");y(this,"children");y(this,"listChildren");y(this,"_focusables",new tr);y(this,"_focusCycler");this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new po({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",(i,s)=>{this.fire("back"),s()})}render(){super.render(),[...this.listChildren,this.backButtonView].forEach(i=>{this._focusables.add(i),this.focusTracker.add(i.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){const e=this.locale.t,i=new pt(this.locale);return i.set({class:"ck-button-back",label:e("Back"),icon:Rm,tooltip:!0}),i.delegate("execute").to(this,"back"),i}_createHeaderView(){const e=this.locale.t,i=new Lm(this.locale,{label:e("Link properties")});return i.children.add(this.backButtonView,0),i}_createListView(){const e=new Nm(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using(i=>{const s=new ho(this.locale);return s.children.add(i),s}),e}}class J0e extends pt{constructor(e){super(e);y(this,"arrowView");this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new ea;return e.content=p4,e}}const _o="link-ui";class NU extends we{constructor(){super(...arguments);y(this,"toolbarView",null);y(this,"formView",null);y(this,"linkProviderItemsView",null);y(this,"propertiesView",null);y(this,"_balloon");y(this,"_linksProviders",new er)}static get requires(){return[Xb,Em]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,i=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(_pe),this._balloon=e.plugins.get(Xb),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:_o,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:_o,view:(s,{writer:r})=>{if(!s.markerRange.isCollapsed)return null;const o=r.createUIElement("span");return r.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],o),o}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:i("Create link"),keystroke:Kp},{label:i("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){const i=this._linksProviders.filter(s=>(s.order||0)<=(e.order||0)).length;this._linksProviders.add(e,i)}_createViews(){const e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){const e=this.editor,i=new ex(e.locale),s=e.commands.get("link");i.class="ck-link-toolbar";let r=e.config.get("link.toolbar");return s.manualDecorators.length||(r=r.filter(o=>o!=="linkProperties")),i.fillFromConfig(r,e.ui.componentFactory),i.keystrokes.set("Esc",(o,a)=>{this._hideUI(),a()}),i.keystrokes.set(Kp,(o,a)=>{this._addFormView(),a()}),e.ui.addToolbar(i,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),i}_createFormView(){const e=this.editor,i=e.locale.t,s=e.commands.get("link"),r=e.config.get("link.defaultProtocol"),o=new(qE(q0e))(e.locale,Z0e(e));return o.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",a=>a!==void 0),o.urlInputView.bind("isEnabled").to(s,"isEnabled"),o.saveButtonView.bind("isEnabled").to(s,"isEnabled"),o.saveButtonView.bind("label").to(s,"value",a=>i(a?"Update":"Insert")),this.listenTo(o,"submit",()=>{if(o.isValid()){const a=o.urlInputView.fieldView.element.value,l=SO(a,r),c=o.displayedTextInputView.fieldView.element.value;e.execute("link",l,this._getDecoratorSwitchesState(),c!==this.selectedLinkableText?c:void 0),this._closeFormView()}}),this.listenTo(o.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(a,l)=>{this._closeFormView(),l()}),o.providersListChildren.bindTo(this._linksProviders).using(a=>this._createLinksListProviderButton(a)),o}_createLinkProviderListView(e){return e.getListItems().map(({href:i,label:s,icon:r})=>{const o=new pt;return o.set({label:s,icon:r,tooltip:!1,withText:!0}),o.on("execute",()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=i,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),o})}_createLinkProviderItemsView(e){const i=this.editor,s=i.locale.t,r=new K0e(i.locale),{emptyListPlaceholder:o,label:a}=e;return r.emptyListPlaceholder=o||s("No links available"),r.title=a,this.listenTo(r,"cancel",()=>{i.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),r}_createPropertiesView(){const e=this.editor,i=this.editor.commands.get("link"),s=new(qE(X0e))(e.locale);return this.listenTo(s,"back",()=>{e.editing.view.focus(),this._removePropertiesView()}),s.listChildren.bindTo(i.manualDecorators).using(r=>{const o=new QT(e.locale);return o.set({label:r.label,withText:!0}),o.bind("isOn").toMany([r,i],"value",(a,l)=>l===void 0&&a===void 0?!!r.defaultValue:!!a),o.on("execute",()=>{r.set("value",!o.isOn),e.execute("link",i.value,this._getDecoratorSwitchesState())}),o}),s}_getDecoratorSwitchesState(){const e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce((i,s)=>{const r=e.value===void 0&&s.value===void 0?s.defaultValue:s.value;return{...i,[s.id]:!!r}},{})}_registerEditingOpeners(){this.editor.plugins.get(Em)._registerLinkOpener(i=>{const s=this._getLinkProviderLinkByHref(i);if(!s)return!1;const{item:r,provider:o}=s;return o.navigate?o.navigate(r):!1})}_registerComponents(){const e=this.editor;e.ui.componentFactory.add("link",()=>{const i=this._createButton(pt);return i.set({tooltip:!0}),i}),e.ui.componentFactory.add("menuBar:link",()=>{const i=this._createButton(Cr);return i.set({role:"menuitemcheckbox"}),i}),e.ui.componentFactory.add("linkPreview",i=>{const s=new Y0e(i),r=e.config.get("link.allowedProtocols"),o=e.commands.get("link"),a=i.t;s.bind("isEnabled").to(o,"value",c=>!!c),s.bind("href").to(o,"value",c=>c&&LU(c,r));const l=c=>{if(!c){s.label=void 0,s.icon=void 0,s.tooltip=a("Open link in new tab");return}const u=this._getLinkProviderLinkByHref(c);if(u){const{label:d,tooltip:h,icon:f}=u.item;s.label=d,s.tooltip=h||!1,s.icon=f}else s.label=c,s.icon=void 0,s.tooltip=a("Open link in new tab")};return l(o.value),this.listenTo(o,"change:value",(c,u,d)=>{l(d)}),this.listenTo(s,"navigate",(c,u,d)=>{const h=this._getLinkProviderLinkByHref(u);if(!h)return;const{provider:f,item:p}=h,{navigate:v}=f;v&&v(p)&&(c.stop(),d())}),s}),e.ui.componentFactory.add("unlink",i=>{const s=e.commands.get("unlink"),r=new pt(i),o=i.t;return r.set({label:o("Unlink"),icon:Tbe,tooltip:!0}),r.bind("isEnabled").to(s),this.listenTo(r,"execute",()=>{e.execute("unlink"),this._hideUI()}),r}),e.ui.componentFactory.add("editLink",i=>{const s=e.commands.get("link"),r=new pt(i),o=i.t;return r.set({label:o("Edit link"),icon:ube,tooltip:!0}),r.bind("isEnabled").to(s),this.listenTo(r,"execute",()=>{this._addFormView()}),r}),e.ui.componentFactory.add("linkProperties",i=>{const s=e.commands.get("link"),r=new pt(i),o=i.t;return r.set({label:o("Link properties"),icon:bbe,tooltip:!0}),r.bind("isEnabled").to(s,"isEnabled",s,"value",s,"manualDecorators",(a,l,c)=>a&&!!l&&c.length>0),this.listenTo(r,"execute",()=>{this._addPropertiesView()}),r})}_createLinksListProviderButton(e){const i=this.editor.locale,s=new J0e(i);return s.set({label:e.label}),this.listenTo(s,"execute",()=>{this._showLinksProviderView(e)}),s}_createButton(e){const i=this.editor,s=i.locale,r=i.commands.get("link"),o=new e(i.locale),a=s.t;return o.set({label:a("Link"),icon:m4,keystroke:Kp,isToggleable:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value",l=>!!l),this.listenTo(o,"execute",()=>{i.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()}),o}_enableBalloonActivators(){const e=this.editor,i=e.editing.view.document;this.listenTo(i,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(Kp,(s,r)=>{r(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,i)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),i())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,i)=>{this._isUIVisible&&(this._hideUI(),i())}),Fy({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),!this._isToolbarInPanel&&this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&!!e.value,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),!this._arePropertiesInPanel&&(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){const e=this.editor.commands.get("link");this.selectedLinkableText=void 0,e.value!==void 0?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpd
566atingUI()}_hideUI(e=!0){const i=this.editor;this._isUIInPanel&&(this.stopListening(i.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&i.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){const e=this.editor,i=e.editing.view.document;let s=this._getSelectedLinkElement(),r=a();const o=()=>{const l=this._getSelectedLinkElement(),c=a();s&&!l||!s&&c!==r?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),s=l,r=c};function a(){return i.selection.focus.getAncestors().reverse().find(l=>l.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){const e=this.editor.editing.view,i=e.document;if(this.editor.model.markers.has(_o)){const r=this.editor.editing.mapper.markerNameToElements(_o);if(r){const o=Array.from(r),a=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));return{target:e.domConverter.viewRangeToDom(a)}}}return{target:()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(i.selection.getFirstRange())}}}_getSelectedLinkElement(){const e=this.editor.editing.view,i=e.document.selection,s=i.getSelectedElement();if(i.isCollapsed||s&&gn(s))return VA(i.getFirstPosition());{const r=i.getFirstRange().getTrimmed(),o=VA(r.start),a=VA(r.end);return!o||o!=a?null:e.createRangeIn(o).getTrimmed().isEqual(r)?o:null}}_getSelectedLinkableText(){const e=this.editor.model,i=this.editor.editing,s=this._getSelectedLinkElement();if(!s)return MI(e.document.selection.getFirstRange());const r=i.view.createRangeOn(s),o=i.mapper.toModelRange(r);return MI(o)}_getLinkProviderLinkByHref(e){if(!e)return null;for(const i of this._linksProviders){const s=i.getItem?i.getItem(e):i.getListItems().find(r=>r.href===e);if(s)return{provider:i,item:s}}return null}_showFakeVisualSelection(){const e=this.editor.model;e.change(i=>{const s=e.document.selection.getFirstRange();if(e.markers.has(_o))i.updateMarker(_o,{range:s});else if(s.start.isAtEnd){const r=s.start.getLastMatchingPosition(({item:o})=>!e.schema.isContent(o),{boundaries:s});i.addMarker(_o,{usingOperation:!1,affectsData:!1,range:i.createRange(r,s.end)})}else i.addMarker(_o,{usingOperation:!1,affectsData:!1,range:s})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(_o)&&e.change(i=>{i.removeMarker(_o)})}}function VA(n){return n.getAncestors().find(t=>M0e(t))||null}function Z0e(n){const t=n.t,e=n.config.get("link.allowCreatingEmptyLinks");return[i=>{if(!e&&!i.url.length)return t("Link URL must not be empty.")}]}const Q0e=4,BU=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i"),eEe=2;class tEe extends we{static get requires(){return[Ih,Em]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(t,e){return e.textNode&&e.textNode.hasAttribute("linkHref")?ix(e,"linkHref",e.textNode.getAttribute("linkHref"),t):null}_selectEntireLinks(t,e){const s=this.editor.model,r=s.document.selection,o=r.getFirstPosition(),a=r.getLastPosition();let l=e.getJoined(this._expandLinkRange(s,o)||e);l&&(l=l.getJoined(this._expandLinkRange(s,a)||e)),l&&(l.start.isBefore(o)||l.end.isAfter(a))&&t.setSelection(l)}_enablePasteLinking(){const t=this.editor,e=t.model,i=e.document.selection,s=t.plugins.get("ClipboardPipeline"),r=t.commands.get("link");s.on("inputTransformation",(o,a)=>
566{if(!this.isEnabled||!r.isEnabled||i.isCollapsed||a.method!=="paste"||i.rangeCount>1)return;const l=i.getFirstRange(),c=a.dataTransfer.getData("text/plain");if(!c)return;const u=c.match(BU);u&&u[2]===c&&(e.change(d=>{this._selectEntireLinks(d,l),r.execute(c)}),o.stop())},{priority:"high"})}_enableTypingHandling(){const t=this.editor,e=new wve(t.model,i=>{let s=i;if(!nEe(s))return;s=s.slice(0,-1),"!.:,;?".includes(s[s.length-1])&&(s=s.slice(0,-1));const r=QN(s);if(r)return{url:r,removedTrailingCharacters:i.length-s.length}});e.on("matched:data",(i,s)=>{const{batch:r,range:o,url:a,removedTrailingCharacters:l}=s;if(!r.isTyping)return;const c=o.end.getShiftedBy(-l),u=c.getShiftedBy(-a.length),d=t.model.createRange(u,c);this._applyAutoLink(a,d)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("enter");i&&i.on("execute",()=>{var o;const s=e.document.selection.getFirstPosition();let r;(o=s.parent.previousSibling)!=null&&o.is("element")?r=e.createRangeIn(s.parent.previousSibling):r=e.createRange(e.createPositionAt(s.parent,0),s),this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("shiftEnter");i&&i.on("execute",()=>{const s=e.document.selection.getFirstPosition(),r=e.createRange(e.createPositionAt(s.parent,0),s.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:i,range:s}=G4(t,e),r=QN(i);if(r){const o=e.createRange(s.end.getShiftedBy(-r.length),s.end);this._applyAutoLink(r,o)}}_applyAutoLink(t,e){const i=this.editor.model,s=this.editor.config.get("link.defaultProtocol"),r=SO(t,s);!this.isEnabled||!iEe(e,i)||!FU(r)||sEe(e)||this._persistAutoLink(r,e)}_persistAutoLink(t,e){const i=this.editor.model,s=this.editor.plugins.get("Delete");i.enqueueChange(r=>{r.setAttribute("linkHref",t,e),i.enqueueChange(()=>{s.requestUndoOnBackspace()})})}}function nEe(n){return n.length>Q0e&&n[n.length-1]===" "&&n[n.length-2]!==" "}function QN(n){const t=BU.exec(n);return t?t[eEe]:null}function iEe(n,t){return t.schema.checkAttributeInSelection(t.createSelection(n),"linkHref")}function sEe(n){const t=n.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}class rEe extends we{static get requires(){return[Em,NU,tEe]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}}class oEe extends we{static get requires(){return["ImageEditing","ImageUtils",Em]}static get pluginName(){return"LinkImageEditing"}static get isOfficialPlugin(){return!0}afterInit(){const t=this.editor,e=t.model.schema;t.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["linkHref"]}),t.conversion.for("upcast").add(aEe(t)),t.conversion.for("downcast").add(lEe(t)),this._enableAutomaticDecorators(),this._enableManualDecorators()}_enableAutomaticDecorators(){const t=this.editor,i=t.commands.get("link").automaticDecorators;i.length&&t.conversion.for("downcast").add(i.getDispatcherForLinkedImage())}_enableManualDecorators(){const t=this.editor,e=t.commands.get("link");for(const i of e.manualDecorators)t.plugins.has("ImageBlockEditing")&&t.model.schema.extend("imageBlock",{allowAttributes:i.id}),t.plugins.has("ImageInlineEditing")&&t.model.schema.extend("imageInline",{allowAttributes:i.id}),t.conversion.for("downcast").add(cEe(i)),t.conversion.for("upcast").add(uEe(t,i))}}function aEe(n){const t=n.plugins.has("ImageInlineEditing"),e=n.plugins.get("ImageUtils");return i=>{i.on("element:a",(s,r,o)=>{const a=r.viewItem,l=e.findViewImgElement(a);if(!l)return;const c=l.findAncestor(f=>e.isBlockImageView(f));if(t&&!c)return;const u={attributes:["href"]};if(!o.consumable.test(a,u))return;const d=a.getAttribute("href"),h=r.modelCursor.parent;h.is("element","imageBlock")&&(o.writer.setAttribute("linkHref",d,h),o.consumable.consume(a,u))},{priority:"high"})}}function lEe(n){const t=n.plugins.get("ImageUtils");return e=>{e.on("attribute:linkHref:imageBlock",(i,s,r)=>{if(!r.consumable.consume(s.item,i.name))return;const o=r.mapper.toViewElement(s.item),a=r.writer,l=Array.from(o.getChildren()).find(d=>d.is("element","a")),c=t.findViewImgElement(o),u=c.parent.is("element","picture")?c.parent:c;
566if(l)s.attributeNewValue?a.setAttribute("href",s.attributeNewValue,l):(a.move(a.createRangeOn(u),a.createPositionAt(o,0)),a.remove(l));else{const d=a.createContainerElement("a",{href:s.attributeNewValue});a.insert(a.createPositionAt(o,0),d),a.move(a.createRangeOn(u),a.createPositionAt(d,0))}},{priority:"high"})}}function cEe(n){return t=>{t.on(`attribute:${n.id}:imageBlock`,(e,i,s)=>{const r=s.mapper.toViewElement(i.item),o=Array.from(r.getChildren()).find(a=>a.is("element","a"));if(o){if(i.attributeOldValue){for(const a in n.attributes)s.writer.removeAttribute(a,o);n.classes&&s.writer.removeClass(n.classes,o);for(const a in n.styles)s.writer.removeStyle(a,o)}if(i.attributeNewValue){for(const[a,l]of Qo(n.attributes))s.writer.setAttribute(a,l,o);n.classes&&s.writer.addClass(n.classes,o);for(const a in n.styles)s.writer.setStyle(a,n.styles[a],o)}}})}}function uEe(n,t){const e=n.plugins.has("ImageInlineEditing"),i=n.plugins.get("ImageUtils");return s=>{s.on("element:a",(r,o,a)=>{const l=o.viewItem,c=i.findViewImgElement(l);if(!c)return;const u=c.findAncestor(p=>i.isBlockImageView(p));if(e&&!u)return;const h=new ym(t._createPattern()).match(l);if(!h||!a.consumable.test(l,h.match))return;const f=o.modelCursor.parent;f!=null&&f.is("element","imageBlock")&&(a.writer.setAttribute(t.id,!0,f),a.consumable.consume(l,h.match))},{priority:"high"})}}class dEe extends we{static get requires(){return[Em,NU,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"click",(i,s)=>{this._isSelectedLinkedImage(t.model.document.selection)&&(s.preventDefault(),i.stop())},{priority:"high"}),this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("linkImage",i=>{const s=new pt(i),r=t.plugins.get("LinkUI"),o=t.commands.get("link");return s.set({isEnabled:!0,label:e("Link image"),icon:m4,keystroke:Kp,tooltip:!0,isToggleable:!0}),s.bind("isEnabled").to(o,"isEnabled"),s.bind("isOn").to(o,"value",a=>!!a),this.listenTo(s,"execute",()=>{this._isSelectedLinkedImage(t.model.document.selection)?r._addToolbarView():r._showUI(!0)}),s})}_isSelectedLinkedImage(t){const e=t.getSelectedElement();return this.editor.plugins.get("ImageUtils").isImage(e)&&e.hasAttribute("linkHref")}}class hEe extends we{static get requires(){return[oEe,dEe]}static get pluginName(){return"LinkImage"}static get isOfficialPlugin(){return!0}}/** 567 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 568 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 569 */class Sr{constructor(t,e){y(this,"_startElement");y(this,"_referenceIndent");y(this,"_isForward");y(this,"_includeSelf");y(this,"_sameAttributes");y(this,"_sameIndent");y(this,"_lowerIndent");y(this,"_higherIndent");this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=e.direction=="forward",this._includeSelf=!!e.includeSelf,this._sameAttributes=bn(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const s=new this(t,e)[Symbol.iterator]();return $i(s)}*[Symbol.iterator](){const t=[];for(const{node:e}of new By(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(i<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=i}else if(i>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(s=>e.getAttribute(s)!==this._startElement.getAttribute(s)))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class By{constructor(t,e="forward"){y(this,"_node");y(this,"_isForward");y(this,"_previousNodesByIndent",[]);y(this,"_previous",null);y(this,"_previousNodeIndent",null);this._node=t,this._isForward=e==="forward"}[Symbol.iterator](){return this}next(){if(!en(this._node))return{done:!0,value:void 0};const t=this._node.getAttribute("listIndent");let e=null;if(this._previous){const s=this._previousNodeIndent;t>s?this._previousNodesByIndent[s]=this._previous:t<s?(e=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):e=this._previous}const i={node:this._node,previous:this._previous,previousNodeInList:e};return this._previous=this._node,this._previousNodeIndent=t,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}}class fEe{constructor(t){y(this,"_listHead");this._listHead=t}[Symbol.iterator](){return new By(this._listHead)}}class Sm{static next(){return is()}}function en(n){return!!n&&n.is("element")&&n.hasAttribute("listItemId")}function Vm(n,t={}){return[...Gc(n,{...t,direction:"backward"}),...Gc(n,{...t,direction:"forward"})]}function Gc(n,t={}){const e=t.direction=="forward",i=Array.from(new Sr(n,{...t,includeSelf:e,sameIndent:!0,sameAttributes:"listItemId"}));return e?i:i.reverse()}function gEe(n){return Array.from(new Sr(n,{direction:"forward",higherIndent:!0}))}function VU(n,t){const e=new Sr(n,{sameIndent:!0,sameAttributes:"listType",...t}),i=new Sr(n,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...t});return[...Array.from(e).reverse(),...i]}function Yc(n){return!Sr.first(n,{sameIndent:!0,sameAttributes:"listItemId"})}function e5(n){return!Sr.first(n,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function Vy(n,t={}){n=bn(n);const e=t.withNested!==!1,i=new Set;for(const s of n)for(const r of Vm(s,{higherIndent:e}))i.add(r);return Ph(i)}function mEe(n){n=bn(n);const t=new Set;for(const e of n)for(const i of VU(e))t.add(i);return Ph(t)}function TO(n,t){const e=Gc(n,{direction:"forward"}),i=Sm.next();for(const s of e)t.setAttribute("listItemId",i,s);return e}function OI(n,t,e){const i={};for(const[r,o]of t.getAttributes())r.startsWith("list")&&(i[r]=o);const s=Gc(n,{direction:"forward"});for(const r of s)e.setAttributes(i,r);return s}function DI(n,t,{expand:e,indentBy:i=1}={}){n=bn(n);const s=e?Vy(n):n;for(const r of s){const o=r.getAttribute("listIndent")+i;o<0?ox(r,t):t.setAttribute("listIndent",o,r)}return s}function pEe(n,t){n=bn(n);const e=Vy(n),i=new Set,s=Math.min(...e.map(o=>o.getAttribute("listIndent"))),r=new Map;for(const o of e)r.set(o,Sr.first(o,{lowerIndent:!0}));for(const o of e){if(i.has(o))continue;i.add(o);const a=o.getAttribute("listIndent")-1;if(a<0){ox(o,t);continue}if(o.getAttribute("listIndent")==s){const l=vEe(o,r.get(o),t);for(const c of l)i.add(c);if(l.length)continue}t.setAttribute("listIndent",a,o)}return Ph(i)}function ox(n,t){n=bn(n);for(const e of n)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of n)for(const i of e.getAttributeKeys())i.startsWith("list")&&t.removeAttribute(i,e);return n}function Zb(n){if(!n.length)return!1;const t=n[0].getAttribute("listItemId");return t?!n.some(e=>e.getAttribute("listItemId")!=t):!1}function bEe(n,t){const e=[];let i=Number.POSITIVE_INFINITY;for(const{node:s}of new By(n.nextSibling)){const r=s.getAttribute("listIndent");if(r==0)break;r<i&&(i=r);const o=r-i;t.setAttribute("listIndent",o,s),e.push(s)}return e}function Ph(n){return Array.from(n).filter(t=>t.root.rootName!=="$graveyard").sort((t,e)=>t.index-e.index)}function Qb(n){const t=n.document.selection.getSelectedElement();return t&&n.schema.isObject(t)&&n.schema.isBlock(t)?t:null}function HA(n,t){return t.checkChild(n.parent,"listItem")&&t.checkChild(n,"$text")&&!t.isObject(n)}function wEe(n){return n=="numbered"||n=="customNumbered"}function vEe(n,t,e){return Gc(t,{direction:"forward"}).pop().index>n.index?OI(n,t,e):[]}class t5 extends _t{constructor(e,i){super(e);y(this,"_direction");this._direction=i}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,i=n5(e.document.selection);e.change(s=>{const r=[];
569Zb(i)&&!Yc(i[0])?(this._direction=="forward"&&r.push(...DI(i,s)),r.push(...TO(i[0],s))):this._direction=="forward"?r.push(...DI(i,s,{expand:!0})):r.push(...pEe(i,s));for(const o of r){if(!o.hasAttribute("listType"))continue;const a=Sr.first(o,{sameIndent:!0});a&&s.setAttribute("listType",a.getAttribute("listType"),o)}this._fireAfterExecute(r)})}_fireAfterExecute(e){this.fire("afterExecute",Ph(new Set(e)))}_checkEnabled(){let e=n5(this.editor.model.document.selection),i=e[0];if(!i)return!1;if(this._direction=="backward"||Zb(e)&&!Yc(e[0]))return!0;e=Vy(e),i=e[0];const s=Sr.first(i,{sameIndent:!0});return s?s.getAttribute("listType")==i.getAttribute("listType"):!1}}function n5(n){const t=Array.from(n.getSelectedBlocks()),e=t.findIndex(i=>!en(i));return e!=-1&&(t.length=e),t}class H_ extends _t{constructor(e,i,s={}){super(e);y(this,"type");y(this,"_listWalkerOptions");this.type=i,this._listWalkerOptions=s.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const i=this.editor.model,s=i.document,r=Qb(i),o=Array.from(s.selection.getSelectedBlocks()).filter(l=>i.schema.checkAttribute(l,"listType")||HA(l,i.schema)),a=e.forceValue!==void 0?!e.forceValue:this.value;i.change(l=>{if(a){const c=o[o.length-1],u=Gc(c,{direction:"forward"}),d=[];u.length>1&&d.push(...TO(u[1],l)),d.push(...ox(o,l)),d.push(...bEe(c,l)),this._fireAfterExecute(d)}else if((r||s.selection.isCollapsed)&&en(o[0])){const c=VU(r||o[0],this._listWalkerOptions);for(const u of c)l.setAttributes({...e.additionalAttributes,listType:this.type},u);this._fireAfterExecute(c)}else{const c=[];for(const u of o)if(!u.hasAttribute("listType"))!u.is("element","listItem")&&HA(u,i.schema)&&l.rename(u,"listItem"),l.setAttributes({...e.additionalAttributes,listIndent:0,listItemId:Sm.next(),listType:this.type},u),c.push(u);else for(const d of Vy(u,{withNested:!1}))d.getAttribute("listType")!=this.type&&(l.setAttributes({...e.additionalAttributes,listType:this.type},d),c.push(d));this._fireAfterExecute(c)}})}_fireAfterExecute(e){this.fire("afterExecute",Ph(new Set(e)))}_getValue(){const e=this.editor.model.document.selection,i=Array.from(e.getSelectedBlocks());if(!i.length)return!1;for(const s of i)if(s.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const e=this.editor.model,i=e.schema,s=e.document.selection,r=Array.from(s.getSelectedBlocks());if(!r.length)return!1;if(this.value)return!0;for(const o of r)if(i.checkAttribute(o,"listType")||HA(o,i))return!0;return!1}}class i5 extends _t{constructor(e,i){super(e);y(this,"_direction");this._direction=i}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:e=!1}={}){const i=this.editor.model,s=i.document.selection,r=[];i.change(o=>{const{firstElement:a,lastElement:l}=this._getMergeSubjectElements(s,e),c=a.getAttribute("listIndent")||0,u=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(c!=u){const h=gEe(l);r.push(...DI([l,...h],o,{indentBy:c-u,expand:c<u}))}if(e){let h=s;s.isCollapsed&&(h=o.createSelection(o.createRange(o.createPositionAt(a,"end"),o.createPositionAt(l,0)))),i.deleteContent(h,{doNotResetEntireContent:s.isCollapsed});const f=h.getLastPosition().parent,p=f.nextSibling;r.push(f),p&&p!==l&&p.getAttribute("listItemId")==d&&r.push(...OI(p,f,o))}else r.push(...OI(l,a,o));this._fireAfterExecute(r)})}_fireAfterExecute(e){this.fire("afterExecute",Ph(new Set(e)))}_checkEnabled(){const e=this.editor.model,i=e.document.selection,s=Qb(e);if(i.isCollapsed||s){const r=s||i.getFirstPosition().parent;if(!en(r))return!1;const o=this._direction=="backward"?r.previousSibling:r.nextSibling;if(!o||Zb([r,o]))return!1}else{const r=i.getLastPosition(),o=i.getFirstPosition();if(r.parent===o.parent||!en(r.parent))return!1}return!0}_getMergeSubjectElements(e,i){const s=this.editor.model,r=Qb(s);let o,a;if(e.isCollapsed||r){const l=r||e.getFirstPosition().parent,c=Yc(l);this._direction=="backward"?(a=l,c&&!i?o=Sr.first(l,{sameIndent:!0,lowerIndent:!0}):o=l.previousSibling):(o=l,a=l.nextSibling)}else o=e.getFirstPosition().parent,a=e.getLastPosition().parent;return{firstElement:o,lastElement:a}}}class s5 extends _t{constructor(e,i){super(e);y(this,"_direction");this._direction=i}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(i=>{const s=TO(this._getStartBlock(),i);this._fireAfterExecute(s)})}_fireAfterExecute(e){this.fire("afterExecute",Ph(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,i=this._getStartBlock();return e.isCollapsed&&en(i)&&!Yc(i)}_getStartBlock(){const i=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?i:i.nextSibling}}class yEe extends we{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}
569static get requires(){return[fo]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(fo);!t.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(s,r,o,a){r&&(s.addClass("ck-list-marker-bold",o),Ge.isSafari&&!(a&&a.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-bold","0",o))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemBold"}),e.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemBold"),t.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}class _Ee extends we{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[fo]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(fo);!t.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(s,r,o,a){r&&(s.addClass("ck-list-marker-italic",o),Ge.isSafari&&!(a&&a.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-italic","0",o))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),e.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemItalic"),t.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}class EEe extends we{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[fo]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(fo);if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const s=VN(t.config.get("fontSize.options"));e.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(r,o,a,l){if(o){const c=s.find(u=>u.model==o);c&&c.view&&typeof c.view!="string"?c.view.styles?(r.addClass("ck-list-marker-font-size",a),r.setStyle("--ck-content-list-marker-font-size",c.view.styles["font-size"],a)):c.view.classes&&(r.addClass(`ck-list-marker-font-size-${o}`,a),Ge.isSafari&&!(l&&l.dataPipeline)&&r.setStyle("--ck-content-list-marker-dummy-font-size","0",a)):(r.addClass("ck-list-marker-font-size",a),r.setStyle("--ck-content-list-marker-font-size",o,a))}}})}afterInit(){const t=this.editor,e=t.model;if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;e.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),e.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),e.schema.addAttributeCheck(s=>{if(!s.last.getAttribute("listItemId"))return!1},"listItemFontSize"),t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:s=>s.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const i=VN(t.config.get("fontSize.options"));for(const s of i)s.model&&s.view&&t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:s.model},view:{name:"li",classes:`ck-list-marker-font-size-${s.model}`}})}}class SEe extends we{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}
569static get requires(){return[fo]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(fo);!t.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(s,r,o){r&&(s.addClass("ck-list-marker-color",o),s.setStyle("--ck-content-list-marker-color",r,o))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),e.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontColor"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:i=>i.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}class TEe extends we{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[fo]}init(){const t=this.editor,e=t.plugins.get("ListFormatting"),i=t.plugins.get(fo);!t.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(s,r,o){r&&(s.addClass("ck-list-marker-font-family",o),s.setStyle("--ck-content-list-marker-font-family",r,o))}}))}afterInit(){const t=this.editor,e=t.model;!t.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(e.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),e.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),e.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:i=>i.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}class xEe extends we{constructor(e){super(e);y(this,"_loadedFormatting",{});e.config.define("list.enableListItemMarkerFormatting",!0)}static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[yEe,_Ee,EEe,SEe,TEe]}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const e=this.editor.model;e.document.registerPostFixer(i=>{const s=e.document.differ.getChanges(),r=new Set;let o=!1;for(const a of s)if(a.type==="attribute")(a.attributeKey=="listItemId"||a.attributeKey=="listType"||this._isInlineOrSelectionFormatting(a.attributeKey)||Object.values(this._loadedFormatting).includes(a.attributeKey))&&(en(a.range.start.nodeAfter)?r.add(a.range.start.nodeAfter):en(a.range.start.parent)&&r.add(a.range.start.parent));else if(en(a.position.nodeAfter)&&r.add(a.position.nodeAfter),en(a.position.nodeBefore)&&r.add(a.position.nodeBefore),en(a.position.parent)&&r.add(a.position.parent),a.type=="insert"&&a.name!="$text"){const l=i.createRangeIn(a.position.nodeAfter);for(const c of l.getItems())en(c)&&r.add(c)}for(const a of r){const l=AEe(e,a,Object.keys(this._loadedFormatting));for(const[c,u]of Object.entries(l)){const d=this._loadedFormatting[c];(u&&CEe(i,a,d,u)||!u&&kEe(i,a,d))&&(o=!0)}}return o})}registerFormatAttribute(e,i){this._loadedFormatting[e]=i}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}}function AEe(n,t,e){if(Yc(t))return r5(n,t,e);const i=Vm(t);return r5(n,i[0],e)}function r5(n,t,e){if(!IEe(t)||n.schema.isLimit(t))return Object.fromEntries(e.map(a=>[a]));if(t.isEmpty)return Object.fromEntries(e.map(a=>[a,t.getAttribute(`selection:${a}`)]));const i=new Set(e),s={},o=n.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(const{item:a}of o){for(const l of i)if(n.schema.checkAttribute(a,l)){const c=a.getAttribute(l);c===void 0?(i.delete(l),s[l]=void 0):s[l]===void 0?s[l]=c:s[l]!==c&&(i.delete(l),s[l]=void 0)}else l in s||(s[l]=void 0);if(!i.size)break;n.schema.isLimit(a)&&o.jumpTo(n.createPositionAfter(a))}return s}function CEe(n,t,e,i){const s=Vm(t);let r=!1;for(const o of s)(!o.hasAttribute(e)||o.getAttribute(e)!==i)&&(n.setAttribute(e,i,o),r=!0);return r}function kEe(n,t,e){const i=Vm(t);let s=!1;for(const r of i)r.hasAttribute(e)&&(n.removeAttribute(e,r),s=!0);return s}function IEe(n){return["numbered","bulleted","customNumbered","customBulleted"].includes(n.getAttribute("listType"))}class PEe extends we{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return mEe(t)}isFirstBlockOfListItem(t){return Yc(t)}isListItemBlock(t){return en(t)}expandListBlocksToCompleteItems(t,e={}){return Vy(t,e)}isNumberedListType(t){return wEe(t)}}/** 570 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 571 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 572 */function MEe(n){return n.is("element","ol")||n.is("element","ul")}function RI(n){return n.is("element","li")}function OEe(n){let t=0,e=n.parent;for(;e;){if(RI(e))t++;else{const i=e.previousSibling;i&&RI(i)&&t++}e=e.parent}return t}function DEe(n,t,e,i=zU(e,t)){return n.createAttributeElement(HU(e),null,{priority:2*t/100-100,id:i})}function REe(n,t,e){return n.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:e})}function HU(n){return n=="numbered"||n=="customNumbered"?"ol":"ul"}function zU(n,t){return`list-${n}-${t}`}function Xr(n,t,e){const i=n.nodeBefore;if(en(i)){let s=i;for(const{node:r}of new By(s,"backward"))if(s=r,e.has(s)||(e.add(s),t.has(i)))return;t.add(s)}else{const s=n.nodeAfter;en(s)&&t.add(s)}}function LEe(n,t){let e=0,i=-1,s=null,r=!1;for(const{node:o}of n){const a=o.getAttribute("listIndent");if(a>e){let l;s===null?(s=a-e,l=e):(s>a&&(s=a),l=a-s),l>i+1&&(l=i+1),t.setAttribute("listIndent",l,o),r=!0,i=l}else s=null,e=a+1,i=a}return r}function FEe(n,t,e){const i=new Set;let s=!1;for(const{node:r}of n){if(i.has(r))continue;let o=r.getAttribute("listType"),a=r.getAttribute("listItemId");if(t.has(a)&&(a=Sm.next()),t.add(a),r.is("element","listItem")){r.getAttribute("listItemId")!=a&&(e.setAttribute("listItemId",a,r),s=!0);continue}for(const l of Gc(r,{direction:"forward"}))i.add(l),l.getAttribute("listType")!=o&&(a=Sm.next(),o=l.getAttribute("listType")),l.getAttribute("listItemId")!=a&&(e.setAttribute("listItemId",a,l),s=!0)}return s}function NEe(){return(n,t,e)=>{const{writer:i,schema:s}=e;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(d=>s.checkAttribute(d,"listItemId"));if(!r.length)return;const o=t.viewItem.getAttribute("data-list-item-id")||Sm.next();e.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});const a=OEe(t.viewItem);let l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const c=r[0].getAttribute("listType");c&&(l=c);const u={listItemId:o,listIndent:a,listType:l};for(const d of r)d.hasAttribute("listItemId")||i.setAttributes(u,d);r.length>1&&r[1].getAttribute("listItemId")!=u.listItemId&&e.keepEmptyElement(r[0])}}function BEe(n,t,e,i){return()=>{const l=n.document.differ.getChanges(),c=[],u=new Set,d=new Set,h=new Set;for(const f of l)if(f.type=="insert"&&f.name!="$text")Xr(f.position,u,h),f.attributes.has("listItemId")?d.add(f.position.nodeAfter):Xr(f.position.getShiftedBy(f.length),u,h);else if(f.type=="remove"&&f.attributes.has("listItemId"))Xr(f.position,u,h);else if(f.type=="attribute"){const p=f.range.start.nodeAfter;e.includes(f.attributeKey)?(Xr(f.range.start,u,h),f.attributeNewValue===null?(Xr(f.range.start.getShiftedBy(1),u,h),r(p)&&c.push(p)):d.add(p)):en(p)&&r(p)&&c.push(p)}for(const f of u.values())c.push(...s(f,d));
572for(const f of new Set(c))t.reconvertItem(f)};function s(l,c){const u=[],d=new Set,h=[];for(const{node:f,previous:p}of new By(l)){if(d.has(f))continue;const v=f.getAttribute("listIndent");p&&v<p.getAttribute("listIndent")&&(h.length=v+1),h[v]={modelAttributes:Object.fromEntries(Array.from(f.getAttributes()).filter(([x])=>e.includes(x))),modelElement:f};const E=Gc(f,{direction:"forward"});for(const x of E)d.add(x),(r(x,E)||a(x,h,c))&&u.push(x)}return u}function r(l,c){const u=t.mapper.toViewElement(l);if(!u)return!1;if(o(u)||i.fire("checkElement",{modelElement:l,viewElement:u}))return!0;if(!l.is("element","paragraph")&&!l.is("element","listItem"))return!1;const h=WU(l,e,c);return h&&u.is("element","p")?!0:!!(!h&&u.is("element","span"))}function o(l){for(l=l.parent;l.is("attributeElement")&&["ol","ul","li"].includes(l.name);)l=l.parent;return!!(l.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(l))}function a(l,c,u){if(u.has(l))return!1;const d=t.mapper.toViewElement(l);let h=c.length-1;for(let f=d.parent;!f.is("editableElement");f=f.parent){const p=RI(f),v=MEe(f);if(!v&&!p)continue;const E=`checkAttributes:${p?"item":"list"}`;if(i.fire(E,{viewElement:f,modelAttributes:c[h].modelAttributes,modelReferenceElement:c[h].modelElement}))break;if(v&&(h--,h<0))return!1}return!0}}function o5(n,t,e,{dataPipeline:i}={}){const s=jEe(n,t);return(r,o,a)=>{const{writer:l,mapper:c,consumable:u}=a,d=o.item;if(!n.includes(o.attributeKey)||!s(d,u))return;const h={...a.options,dataPipeline:i},f=HEe(d,c,e,l);$U(f,l,c),WEe(f,l);const p=$Ee(d,f,t,l,h);UEe(d,p,t,l,h)}}function VEe(n){return(t,e,i)=>{const{writer:s,mapper:r}=i,o=t.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const a=r.toViewPosition(e.position),l=e.position.getShiftedBy(e.length),c=r.toViewPosition(l,{isPhantom:!0}),d=s.createRange(a,c).getTrimmed().end.nodeBefore;/* istanbul ignore next -- @preserve */d&&$U(d,s,r)}}function a5(n,{dataPipeline:t}={}){return(e,{writer:i})=>{if(!WU(e,n))return null;if(!t)return i.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const s=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function HEe(n,t,e,i){const s=e.createRangeOn(n),o=t.toViewRange(s).getTrimmed().getWalker();for(const{item:a}of o)if(a.is("element")&&a.getCustomProperty("listItemMarker"))o.jumpTo(i.createPositionAfter(a));else if(a.is("element")&&!a.getCustomProperty("listItemWrapper"))return a}function zEe(n,t){return(e,i)=>{if(i.modelPosition.offset>0)return;const s=i.modelPosition.parent;if(!en(s)||!n.some(c=>c.scope=="itemMarker"&&c.canInjectMarkerIntoElement&&c.canInjectMarkerIntoElement(s)))return;const r=i.mapper.toViewElement(s),o=t.createRangeIn(r),a=o.getWalker();let l=o.start;for(const{item:c}of a){if(c.is("element")&&i.mapper.toModelElement(c)||c.is("$textProxy"))break;c.is("element")&&c.getCustomProperty("listItemMarker")&&(l=t.createPositionAfter(c),a.skip(({previousPosition:u})=>!u.isEqual(l)))}i.viewPosition=l}}function $U(n,t,e){for(;n.parent.is("attributeElement")&&n.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(n),n.parent);const i=[];s(t.createPositionBefore(n).getWalker({direction:"backward"})),s(t.createRangeIn(n).getWalker());for(const r of i)t.remove(r);function s(r){for(const{item:o}of r){if(o.is("element")&&e.toModelElement(o))break;o.is("element")&&o.getCustomProperty("listItemMarker")&&i.push(o)}}}function $Ee(n,t,e,i,{dataPipeline:s}){let r=i.createRangeOn(t);if(!Yc(n))return r;for(const o of e){if(o.scope!="itemMarker")continue;const a=o.createElement(i,n,{dataPipeline:s});if(!a||(i.setCustomProperty("listItemMarker",!0,a),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(n)?i.insert(i.createPositionAt(t,0),a):(i.insert(r.start,a),r=i.createRange(i.createPositionBefore(a),i.createPositionAfter(t))),!o.createWrapperElement||!o.canWrapElement))continue;const l=o.createWrapperElement(i,n,{dataPipeline:s});i.setCustomProperty("listItemWrapper",!0,l),o.canWrapElement(n)?r=i.wrap(r,l):(r=i.wrap(i.createRangeOn(a),l),r=i.createRange(r.start,i.createPositionAfter(t)))}return r}function WEe(n,t){let e=n.parent;for(;e.is("attributeElement")&&["ul","ol","li"].includes(e.name);){const i=e.parent;t.unwrap(t.createRangeOn(n),e),e=i}}function UEe(n,t,e,i,s){if(!n.hasAttribute("listIndent"))return;const r=n.getAttribute("listIndent");let o=n;for(let a=r;a>=0;a--){const l=REe(i,a,o.getAttribute("listItemId")),c=DEe(i,a,o.getAttribute("listType"));for(const u of e)(u.scope=="list"||u.scope=="item")&&o.hasAttribute(u.attributeName)&&u.setAttributeOnDowncast(i,o.getAttribute(u.attributeName),u.scope=="list"?c:l,s,o);if(t=i.wrap(t,l),t=i.wrap(t,c),a==0||(o=Sr.first(o,{lowerIndent:!0}),!o))break}}function jEe(n,t){const e=t.filter(i=>i.consume===!1).map(i=>i.attributeName);return(i,s)=>{const r=[];for(const o of n)i.hasAttribute(o)&&!e.includes(o)&&r.push(`attribute:${o}`);return r.every(o=>s.test(i,o)!==!1)?(r.forEach(o=>s.consume(i,o)),!0):!1}}function WU(n,t,e=Vm(n)){if(!en(n))return!1;for(const i of n.getAttributeKeys())if(!(i.startsWith("selection:")||i=="htmlEmptyBlock")&&!t.includes(i))return!1;return e.length<2}const K0=["listType","listIndent","listItemId"];class fo extends we{constructor(e){super(e);y(this,"_downcastStrategies",[]);e.config.define("list.multiBlock",!0)}static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[sx,Ih,PEe,Er,xEe]}init(){const e=this.editor,i=e.model,s=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new ee("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});i.schema.register("$listItem",{allowAttributes:K0}),s?(i.schema.extend("$container",{allowAttributesOf:"$listItem"}),i.schema.extend("$block",{allowAttributesOf:"$listItem"}),i.schema.extend("$blockObject",{allowAttributesOf:"$listItem"}
572)):i.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const r of K0)i.schema.setAttributeProperties(r,{copyOnReplace:!0});e.commands.add("numberedList",new H_(e,"numbered")),e.commands.add("bulletedList",new H_(e,"bulleted")),e.commands.add("customNumberedList",new H_(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new H_(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new t5(e,"forward")),e.commands.add("outdentList",new t5(e,"backward")),e.commands.add("splitListItemBefore",new s5(e,"before")),e.commands.add("splitListItemAfter",new s5(e,"after")),s&&(e.commands.add("mergeListItemBackward",new i5(e,"backward")),e.commands.add("mergeListItemForward",new i5(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const i=this.editor.commands,s=i.get("indent"),r=i.get("outdent");s&&s.registerChildCommand(i.get("indentList"),{priority:"high"}),r&&r.registerChildCommand(i.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...K0,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){const e=this.editor,i=e.commands.get("mergeListItemBackward"),s=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(r,o)=>{const a=e.model.document.selection;Qb(e.model)||e.model.change(()=>{const l=a.getFirstPosition();if(a.isCollapsed&&o.direction=="backward"){if(!l.isAtStart)return;const c=l.parent;if(!en(c))return;if(!Sr.first(c,{sameAttributes:"listType",sameIndent:!0})&&c.getAttribute("listIndent")===0)e5(c)||e.execute("splitListItemAfter"),e.execute("outdentList");else{if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:l5(e.model,"backward")})}o.preventDefault(),r.stop()}else{if(a.isCollapsed&&!a.getLastPosition().isAtEnd||!s||!s.isEnabled)return;s.execute({shouldMergeOnBlocksContentLevel:l5(e.model,"forward")}),o.preventDefault(),r.stop()}})},{context:"li"})}_setupEnterIntegration(){const e=this.editor,i=e.model,s=e.commands,r=s.get("enter");this.listenTo(e.editing.view.document,"enter",(o,a)=>{const l=i.document,c=l.selection.getFirstPosition().parent;if(l.selection.isCollapsed&&en(c)&&c.isEmpty&&!a.isSoft){const u=Yc(c),d=e5(c);u&&d?(e.execute("outdentList"),a.preventDefault(),o.stop()):u&&!d?(e.execute("splitListItemAfter"),a.preventDefault(),o.stop()):d&&(e.execute("splitListItemBefore"),a.preventDefault(),o.stop())}},{context:"li"}),this.listenTo(r,"afterExecute",()=>{const o=s.get("splitListItemBefore");if(o.refresh(),!o.isEnabled)return;const l=e.model.document.selection.getLastPosition().parent;Vm(l).length===2&&o.execute()})}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",(i,s)=>{const r=s.shiftKey?"outdentList":"indentList";this.editor.commands.get(r).isEnabled&&(e.execute(r),s.stopPropagation(),s.preventDefault(),i.stop())},{context:"li"})}_setupConversion(){const e=this.editor,i=e.model,s=this.getListAttributeNames(),r=e.config.get("list.multiBlock"),o=r?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(l,{writer:c})=>c.createElement(o,{listType:""})}).elementToElement({view:"p",model:(l,{writer:c})=>l.parent&&l.parent.is("element","li")?c.createElement(o,{listType:""}):null,converterPriority:"high"}).add(l=>{l.on("element:li",NEe())}),r||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:o,view:a5(s),converterPriority:"high"}).add(l=>{l.on("attribute",o5(s,this._downcastStrategies,i)),l.on("remove",VEe(i.schema))}),e.conversion.for("dataDowncast").elementToElement({model:o,view:a5(s,{dataPipeline:!0}),converterPriority:"high"}).add(l=>{l.on("attribute",o5(s,this._downcastStrategies,i,{dataPipeline:!0}))});const a=zEe(this._downcastStrategies,e.editing.view);e.editing.mapper.on("modelToViewPosition",a),e.data.mapper.on("modelToViewPosition",a),this.listenTo(i.document,"change:data",BEe(i,e.editing,s,this),{priority:"high"}),this.on("checkAttributes:item",(l,{viewElement:c,modelAttributes:u})=>{c.id!=u.listItemId&&(l.return=!0,l.stop())}),this.on("checkAttributes:list",(l,{viewElement:c,modelAttributes:u})=>{(c.name!=HU(u.listType)||c.id!=zU(u.listType,u.listIndent))&&(l.return=!0,l.stop())})}_setupModelPostFixing(){const e=this.editor.model,i=this.getListAttributeNames();e.document.registerPostFixer(s=>GEe(e,s,i,this)),this.on("postFixer",(s,{listNodes:r,writer:o})=>{s.return=LEe(r,o)||s.return},{priority:"high"}),this.on("postFixer",(s,{listNodes:r,writer:o,seenIds:a})=>{s.return=FEe(r,a,o)||s.return},{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,i=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",YEe(e),{priority:"high"}),this.listenTo(i,"outputTransformation",(s,r)=>{e.change(o=>{const a=Array.from(r.content.getChildren()),l=a[a.length-1];if(a.length>1&&l.is("element")&&l.isEmpty&&a.slice(0,-1).every(en)&&o.remove(l),r.method=="copy"||r.method=="cut"){const c=Array.from(r.content.getChildren());Zb(c)&&ox(c,o)}})})}_setupAccessibilityIntegration(){const e=this.editor,i=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:i("Keystrokes that can be used in a list"),keystrokes:[{label:i("Increase list item indent"),keystroke:"Tab"},{label:i("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,i,s,r){r&&(r.skipListItemIds||r.isClipboardPipeline)||e.setAttribute("data-list-item-id",i,s)}})}}function GEe(n,t,e,i){const s=n.document.differ.getChanges(),r=new Set,o=new Set,a=i.editor.config.get("list.multiBlock");let l=!1;for(const u of s){if(u.type=="insert"&&u.name!="$text"){const d=u.position.nodeAfter;if(!n.schema.checkAttribute(d,"listItemId"))for(const h of Array.from(d.getAttributeKeys()))e.includes(h)&&
572(t.removeAttribute(h,d),l=!0);Xr(u.position,o,r),u.attributes.has("listItemId")||Xr(u.position.getShiftedBy(u.length),o,r);for(const{item:h,previousPosition:f}of n.createRangeIn(d))en(h)&&Xr(f,o,r)}else u.type=="remove"?Xr(u.position,o,r):u.type=="attribute"&&e.includes(u.attributeKey)&&(Xr(u.range.start,o,r),u.attributeNewValue===null&&Xr(u.range.start.getShiftedBy(1),o,r));if(!a&&u.type=="attribute"&&K0.includes(u.attributeKey)){const d=u.range.start.nodeAfter;u.attributeNewValue===null&&d&&d.is("element","listItem")?(t.rename(d,"paragraph"),l=!0):u.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(t.rename(d,"listItem"),l=!0)}}const c=new Set;for(const u of o.values())l=i.fire("postFixer",{listNodes:new fEe(u),listHead:u,writer:t,seenIds:c})||l;return l}function YEe(n){return(t,[e,i])=>{const s=e.is("documentFragment")?Array.from(e.getChildren()):[e];if(!s.length)return;const o=(i?n.createSelection(i):n.document.selection).getFirstPosition();let a;if(en(o.parent))a=o.parent;else if(en(o.nodeBefore)&&en(o.nodeAfter))a=o.nodeBefore;else return;n.change(l=>{const c=a.getAttribute("listType"),u=a.getAttribute("listIndent"),d=s[0].getAttribute("listIndent")||0,h=Math.max(u-d,0);for(const f of s){const p=en(f);a.is("element","listItem")&&f.is("element","paragraph")&&l.rename(f,"listItem"),l.setAttributes({listIndent:(p?f.getAttribute("listIndent"):0)+h,listItemId:p?f.getAttribute("listItemId"):Sm.next(),listType:c},f)}})}}function l5(n,t){const e=n.document.selection;if(!e.isCollapsed)return!Qb(n);if(t==="forward")return!0;const s=e.getFirstPosition().parent,r=s.previousSibling;return n.schema.isObject(r)?!1:r.isEmpty?!0:Zb([s,r])}function c5(n,t,e,i){n.ui.componentFactory.add(t,()=>{const s=u5(pt,n,t,e,i);return s.set({tooltip:!0,isToggleable:!0}),s}),n.ui.componentFactory.add(`menuBar:${t}`,()=>{const s=u5(Cr,n,t,e,i);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s})}function u5(n,t,e,i,s){const r=t.commands.get(e),o=new n(t.locale);return o.set({label:i,icon:s}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",()=>{t.execute(e),t.editing.view.focus()}),o}class qEe extends we{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||c5(this.editor,"numberedList",t("Numbered List"),nbe),this.editor.ui.componentFactory.has("bulletedList")||c5(this.editor,"bulletedList",t("Bulleted List"),Gpe)}}class KEe extends we{static get requires(){return[fo,qEe]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}const XEe=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:n,typeAttribute:t,listType:e}of XEe);/** 573 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 574 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 575 */ft.arrowup,ft.arrowdown,ft.esc;ft.enter,ft.tab;/** 576 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 577 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 578 */const d5={left:{className:"table-style-align-left"},center:{className:"table-style-align-center"},right:{className:"table-style-align-right"},blockLeft:{className:"table-style-block-align-left"},blockRight:{className:"table-style-block-align-right"}},z_={center:{align:"center",style:"margin-left: auto; margin-right: auto;",className:"table-style-align-center"},left:{align:"left",style:"float: left;",className:"table-style-align-left"},right:{align:"right",style:"float: right;",className:"table-style-align-right"},blockLeft:{align:void 0,style:"margin-left: 0; margin-right: auto;",className:d5.blockLeft.className},blockRight:{align:void 0,style:"margin-left: auto; margin-right: 0;",className:d5.blockRight.className}};/** 579 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 580 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 581 */class Ct{constructor(t,e={}){y(this,"_table");y(this,"_startRow");y(this,"_endRow");y(this,"_startColumn");y(this,"_endColumn");y(this,"_includeAllSlots");y(this,"_skipRows");y(this,"_row");y(this,"_rowIndex");y(this,"_column");y(this,"_cellIndex");y(this,"_spannedCells");y(this,"_nextCellAtColumn");y(this,"_jumpedToStartRow",!1);this._table=t,this._startRow=e.row!==void 0?e.row:e.startRow||0,this._endRow=e.row!==void 0?e.row:e.endRow,this._startColumn=e.column!==void 0?e.column:e.startColumn||0,this._endColumn=e.column!==void 0?e.column:e.endColumn,this._includeAllSlots=!!e.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();const t=this._table.getChild(this._rowIndex);if(!t||this._isOverEndRow())return{done:!0,value:void 0};if(!t.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let e=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(e=this._formatOutValue(i.cell,i.row,i.column));else{const s=t.getChild(this._cellIndex);if(!s)return this._advanceToNextRow();const r=parseInt(s.getAttribute("colspan")||"1"),o=parseInt(s.getAttribute("rowspan")||"1");(r>1||o>1)&&this._recordSpans(s,o,r),this._shouldSkipSlot()||(e=this._formatOutValue(s)),this._nextCellAtColumn=this._column+r}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,e||this.next()}
581skipRow(t){this._skipRows.add(t)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(t,e=this._row,i=this._column){return{done:!1,value:new JEe(this,t,e,i)}}_shouldSkipSlot(){const t=this._skipRows.has(this._row),e=this._row<this._startRow,i=this._column<this._startColumn,s=this._endColumn!==void 0&&this._column>this._endColumn;return t||e||i||s}_getSpanned(){const t=this._spannedCells.get(this._row);return t&&t.get(this._column)||null}_recordSpans(t,e,i){const s={cell:t,row:this._row,column:this._column};for(let r=this._row;r<this._row+e;r++)for(let o=this._column;o<this._column+i;o++)(r!=this._row||o!=this._column)&&this._markSpannedCell(r,o,s)}_markSpannedCell(t,e,i){this._spannedCells.has(t)||this._spannedCells.set(t,new Map),this._spannedCells.get(t).set(e,i)}_canJumpToStartRow(){return!!this._startRow&&this._startRow>0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const t=this._getRowLength(0);for(let e=this._startRow;!this._jumpedToStartRow;e--)t===this._getRowLength(e)&&(this._row=e,this._rowIndex=e,this._jumpedToStartRow=!0)}_getRowLength(t){return[...this._table.getChild(t).getChildren()].reduce((i,s)=>i+parseInt(s.getAttribute("colspan")||"1"),0)}}class JEe{constructor(t,e,i,s){y(this,"cell");y(this,"row");y(this,"column");y(this,"cellAnchorRow");y(this,"cellAnchorColumn");y(this,"_cellIndex");y(this,"_rowIndex");y(this,"_table");this.cell=e,this.row=t._row,this.column=t._column,this.cellAnchorRow=i,this.cellAnchorColumn=s,this._cellIndex=t._cellIndex,this._rowIndex=t._rowIndex,this._table=t._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function On(n,t,e,i,s=1){t!=null&&s!==void 0&&s!==null&&t>s?i.setAttribute(n,t,e):i.removeAttribute(n,e)}function Mh(n,t,e={}){const i=n.createElement("tableCell",e);return n.insertElement("paragraph",i),n.insert(i,t),i}function LI(n,t){const e=t.parent.parent,i=parseInt(e.getAttribute("headingColumns")||"0"),{column:s}=n.getCellLocation(t);return!!i&&s<i}function Yh({table:n,row:t,column:e}){const i=new Ct(n,{row:t,column:e});for(const{cell:s}of i)if(s.getAttribute("tableCellType")!=="header")return!1;return!0}function Ta(n){const{model:t,config:e}=n;return t.schema.checkAttribute("tableCell","tableCellType")&&e.get("experimentalFlags.tableCellTypeSupport")===!0}function UU(n,t,e){const{startRow:i,startColumn:s,endRow:r,endColumn:o}=t,a=e.createElement("table"),l=n.getAttribute("tableType");l&&e.setAttribute("tableType",l,a);const c=r-i+1;for(let d=0;d<c;d++)e.insertElement("tableRow",a,"end");const u=[...new Ct(n,{startRow:i,endRow:r,startColumn:s,endColumn:o,includeAllSlots:!0})];for(const{row:d,column:h,cell:f,isAnchor:p,cellAnchorRow:v,cellAnchorColumn:E}of u){const x=d-i,A=a.getChild(x);if(!p)(v<i||E<s)&&Mh(e,e.createPositionAt(A,"end"));else{const O=e.cloneElement(f);e.append(O,A),KU(O,d,h,r,o,e)}}return ZEe(a,n,i,s,e),a}function jU(n,t,e=0){const i=[],s=new Ct(n,{startRow:e,endRow:t-1});for(const r of s){const{row:o,cellHeight:a}=r,l=o+a-1;o<t&&t<=l&&i.push(r)}return i}function GU(n,t,e){const i=n.parent,s=i.parent,r=i.index,o=parseInt(n.getAttribute("rowspan")),a=t-r,l={},c=o-a;c>1&&(l.rowspan=c);const u=parseInt(n.getAttribute("colspan")||"1");u>1&&(l.colspan=u);const d=r,h=d+a,f=[...new Ct(s,{startRow:d,endRow:h,includeAllSlots:!0})];let p=null,v;for(const E of f){const{row:x,column:A,cell:O}=E;O===n&&v===void 0&&(v=A),v!==void 0&&v===A&&x===h&&(p=Mh(e,E.getPositionBefore(),l))}return On("rowspan",a,n,e),p}function YU(n,t){const e=[],i=new Ct(n);for(const s of i){const{column:r,cellWidth:o}=s,a=r+o-1;r<t&&t<=a&&e.push(s)}return e}function qU(n,t,e,i){const s=parseInt(n.getAttribute("colspan")),r=e-t,o={},a=s-r;a>1&&(o.colspan=a);const l=parseInt(n.getAttribute("rowspan")||"1");l>1&&(o.rowspan=l);const c=Mh(i,i.createPositionAfter(n),o);return On("colspan",r,n,i),c}function KU(n,t,e,i,s,r){const o=parseInt(n.getAttribute("colspan")||"1"),a=parseInt(n.getAttribute("rowspan")||"1");if(e+o-1>s){const u=s-e+1;On("colspan",u,n,r,1)}if(t+a-1>i){const u=i-t+1;On("rowspan",u,n,r,1)}}function ZEe(n,t,e,i,s){const r=parseInt(t.getAttribute("headingRows")||"0");if(r>0){const a=r-e;On("headingRows",a,n,s,0)}const o=parseInt(t.getAttribute("headingColumns")||"0");if(o>0){const a=o-i;On("headingColumns",a,n,s,0)}}function FI(n,t){const e=t.getColumns(n),i=new Array(e).fill(0);for(const{column:r}of new Ct(n))i[r]++;const s=i.reduce((r,o,a)=>o?r:[...r,a],[]);if(s.length>0){const r=s[s.length-1];return t.removeColumns(n,{at:r}),!0}return!1}function NI(n,t){const e=[],i=t.getRows(n);for(let s=0;s<i;s++)n.getChild(s).isEmpty&&e.push(s);if(e.length>0){const s=e[e.length-1];return t.removeRows(n,{at:s}),!0}return!1}function xO(n,t){FI(n,t)||NI(n,t)}function XU(n,t){const e=Array.from(new Ct(n,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(e.every(({cellHeight:r})=>r===1))return t.lastRow;const s=e[0].cellHeight-1;return t.lastRow+s}function JU(n,t){const e=Array.from(new Ct(n,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(e.every(({cellWidth:r})=>
581r===1))return t.lastColumn;const s=e[0].cellWidth-1;return t.lastColumn+s}function QEe(n){for(const t of n.getChildren())if(t.is("element","table"))return t}function e1e(){return n=>{n.on("element:figure",(t,e,i)=>{if(!i.consumable.test(e.viewItem,{name:!0,classes:"table"}))return;const s=QEe(e.viewItem);if(!s||!i.consumable.test(s,{name:!0}))return;i.consumable.consume(e.viewItem,{name:!0,classes:"table"});const r=i.convertItem(s,e.modelCursor),o=$i(r.modelRange.getItems());if(!o||!o.is("element","table")){i.consumable.revert(e.viewItem,{name:!0,classes:"table"}),r.modelRange&&!r.modelRange.isCollapsed&&(e.modelRange=r.modelRange,e.modelCursor=r.modelCursor);return}i.convertChildren(e.viewItem,i.writer.createPositionAt(o,"end")),i.updateConversionResult(o,e)})}}function t1e(){return n=>{n.on("element:table",(t,e,i)=>{const s=e.viewItem;if(!i.consumable.test(s,{name:!0}))return;const{rows:r,headingRows:o,headingColumns:a}=i1e(s),l={};a&&(l.headingColumns=a),o&&(l.headingRows=o);const c=i.writer.createElement("table",l);if(i.safeInsert(c,e.modelCursor)){if(i.consumable.consume(s,{name:!0}),r.forEach(u=>i.convertItem(u,i.writer.createPositionAt(c,"end"))),i.convertChildren(s,i.writer.createPositionAt(c,"end")),c.isEmpty){const u=i.writer.createElement("tableRow");i.writer.insert(u,i.writer.createPositionAt(c,"end")),Mh(i.writer,i.writer.createPositionAt(u,"end"))}i.updateConversionResult(c,e)}})}}function n1e(){return n=>{n.on("element:tr",(t,e)=>{e.viewItem.isEmpty&&e.modelCursor.index==0&&t.stop()},{priority:"high"})}}function h5(n){return t=>{t.on(`element:${n}`,(e,i,{writer:s})=>{if(!i.modelRange)return;const r=i.modelRange.start.nodeAfter,o=s.createPositionAt(r,0);if(i.viewItem.isEmpty){s.insertElement("paragraph",o);return}const a=Array.from(r.getChildren());if(a.every(l=>l.is("element","$marker"))){const l=s.createElement("paragraph");s.insert(l,s.createPositionAt(r,0));for(const c of a)s.move(s.createRangeOn(c),s.createPositionAt(l,"end"))}},{priority:"low"})}}function i1e(n){var a;let t,e=!0;const i=[],s=[];let r;for(const l of Array.from(n.getChildren())){if(l.name!=="tbody"&&l.name!=="thead"&&l.name!=="tfoot")continue;l.name==="thead"&&!r&&(e=!0,r=l);const c=Array.from(l.getChildren()).filter(d=>d.is("element","tr"));let u=null;for(const d of c){const h=Array.from(d.getChildren()).filter(f=>f.is("element","td")||f.is("element","th"));r&&l===r||l.name==="tbody"&&h.length>0&&(u===null||h.length===u)&&h.every(f=>f.is("element","th"))&&e?(i.push(d),e=!0):(s.push(d),e=!1),u=Math.max(u||0,h.length)}}const o=s1e(s);for(const l of o){let c=0;for(;c<l.length&&((a=l[c])==null?void 0:a.name)==="th";)c+=1;(t===void 0||c<t)&&(t=c)}return{headingRows:i.length,headingColumns:t||0,rows:[...i,...s]}}function s1e(n){let t=new Map,e=0;const i=n.map(s=>{const r=[],o=Array.from(s.getChildren()).filter(l=>l.name==="th"||l.name==="td"),a=new Map;for(;o.length||r.length<e;){const l=t.get(r.length);if(l&&l.remaining>0)r.push(l.cell);else{const c=o.shift();if(c){const u=parseInt(c.getAttribute("colspan")||"1"),d=parseInt(c.getAttribute("rowspan")||"1");for(let h=0;h<u;h++)d>1&&a.set(r.length,{cell:c,remaining:d-1}),r.push(c)}else{r.push(null);continue}}}for(const[l,c]of t.entries())c.remaining-=1,c.remaining>0&&!a.has(l)&&a.set(l,c);return t=a,e=Math.max(e,r.length),r});for(const s of i)for(;s.length<e;)s.push(null);return i}function r1e(n,t={}){const e={borderStyle:"none",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",...n};return t.includeAlignmentProperty&&!e.alignment&&(e.alignment="center"),t.includePaddingProperty&&!e.padding&&(e.padding=""),t.includeVerticalAlignmentProperty&&!e.verticalAlignment&&(e.verticalAlignment="middle"),t.includeHorizontalAlignmentProperty&&!e.horizontalAlignment&&(e.horizontalAlignment=t.isRightToLeftContent?"right":"left"),e}function o1e(n,t){return r1e({borderStyle:"double",borderColor:"hsl(0, 0%, 70%)",borderWidth:"1px",...n},t)}function f5(n,t){return(e,{writer:i})=>{const s=e.getAttribute("headingRows")||0,r=i.createContainerElement("table",null,[]),o=i.createContainerElement("figure",{class:"table"},r);s>0&&i.insert(i.createPositionAt(r,"end"),i.createContainerElement("thead",null,i.createSlot(a=>
581a.is("element","tableRow")&&a.index<s))),s<n.getRows(e)&&i.insert(i.createPositionAt(r,"end"),i.createContainerElement("tbody",null,i.createSlot(a=>a.is("element","tableRow")&&a.index>=s)));for(const{positionOffset:a,filter:l}of t.additionalSlots)i.insert(i.createPositionAt(r,a),i.createSlot(l));return i.insert(i.createPositionAt(r,"after"),i.createSlot(a=>a.is("element","tableRow")?!1:!t.additionalSlots.some(({filter:l})=>l(a)))),t.asWidget?l1e(o,i):o}}function a1e(){return(n,{writer:t})=>n.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}function g5(n){return(e,{writer:i})=>{var d;if((d=n.cellTypeEnabled)!=null&&d.call(n)){const h=e.getAttribute("tableCellType")==="header"?"th":"td";return t(i,h)}const s=e.parent,r=s.parent,o=r.getChildIndex(s),a=new Ct(r,{row:o}),l=r.getAttribute("headingRows")||0,c=r.getAttribute("headingColumns")||0;let u=null;for(const h of a)if(h.cell==e){const f=h.row<l||h.column<c;u=t(i,f?"th":"td");break}return u};function t(e,i){return n.asWidget?J4(e.createEditableElement(i),e,{withAriaRole:!1}):e.createContainerElement(i)}}function m5(n={}){return(t,{writer:e})=>{if(!t.parent.is("element","tableCell")||!ZU(t))return null;if(n.asWidget)return e.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const i=e.createContainerElement("p");return e.setCustomProperty("dataPipeline:transparentRendering",!0,i),i}}}function ZU(n){return n.parent.childCount==1&&!c1e(n)}function l1e(n,t){return t.setCustomProperty("table",!0,n),K4(n,t,{hasSelectionHandle:!0})}function c1e(n){for(const t of n.getAttributeKeys())if(!(t.startsWith("selection:")||t=="htmlEmptyBlock"))return!0;return!1}function u1e(n){return(t,e)=>{const i=n.plugins.has("PlainTableOutput"),s=e.options.isClipboardPipeline,r=n.config.get("experimentalFlags.useExtendedTableBlockAlignment");return!i&&!(r&&s)?null:h1e(t,e,n)}}function d1e(n){return(t,{writer:e,options:i})=>{const s=n.plugins.has("PlainTableOutput"),r=i.isClipboardPipeline,o=n.config.get("experimentalFlags.useExtendedTableBlockAlignment");return!s&&!(o&&r)?null:t.parent.name==="table"?e.createContainerElement("caption"):null}}
581function h1e(n,t,e){const i=t.writer,s=n.getAttribute("headingRows")||0,r=i.createSlot(h=>h.is("element","tableRow")&&h.index<s),o=i.createSlot(h=>h.is("element","tableRow")&&h.index>=s),a=i.createSlot(h=>!h.is("element","tableRow")),l=i.createContainerElement("thead",null,r),c=i.createContainerElement("tbody",null,o),u=[];s&&u.push(l),s<n.childCount&&u.push(c);const d={class:"table"};if(e.plugins.has("TablePropertiesEditing")&&t.options.isClipboardPipeline){const h=o1e(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),f=n.getAttribute("tableAlignment");let p=h.alignment;n.getAttribute("tableType")==="layout"&&(p="");const v=f||p;v&&(d.class+=" "+z_[v].className,d.style=z_[v].style,z_[v].align!==void 0&&(d.align=z_[v].align))}return i.createContainerElement("table",d,[a,...u])}function f1e(n){const t={"border-width":"tableBorderWidth","border-color":"tableBorderColor","border-style":"tableBorderStyle","background-color":"tableBackgroundColor"};for(const[e,i]of Object.entries(t))n.conversion.for("dataDowncast").add(s=>s.on(`attribute:${i}:table`,(r,o,a)=>{const{item:l,attributeNewValue:c}=o,{mapper:u,writer:d}=a,h=n.plugins.has("PlainTableOutput"),f=a.options.isClipboardPipeline,p=n.config.get("experimentalFlags.useExtendedTableBlockAlignment");if(!h&&!(p&&f)||!a.consumable.consume(l,r.name))return;const v=u.toViewElement(l);c?d.setStyle(e,c,v):d.removeStyle(e,v)},{priority:"high"}))}class g1e extends _t{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema;this.isEnabled=m1e(e,i)}execute(t={}){const e=this.editor,i=e.model,s=e.plugins.get("TableUtils"),r=e.config.get("table.defaultHeadings.rows"),o=e.config.get("table.defaultHeadings.columns");t.headingRows===void 0&&r&&(t.headingRows=r),t.headingColumns===void 0&&o&&(t.headingColumns=o),i.change(a=>{const l=s.createTable(a,t);i.insertObject(l,null,null,{findOptimalPosition:"auto"}),a.setSelection(a.createPositionAt(l.getNodeByPath([0,0,0]),0))})}}function m1e(n,t){const e=n.getFirstPosition().parent,i=e===e.root?e:e.parent;return t.checkChild(i,"table")}class p5 extends _t{constructor(e,i={}){super(e);y(this,"order");this.order=i.order||"below"}refresh(){const e=this.editor.model.document.selection,s=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=s}execute(){const e=this.editor,i=e.model.document.selection,s=e.plugins.get("TableUtils"),r=this.order==="above",o=s.getSelectionAffectedTableCells(i),a=s.getRowIndexes(o),l=r?a.first:a.last,c=o[0].findAncestor("table");s.insertRows(c,{at:r?l:l+1,copyStructureFromAbove:!r})}}class b5 extends _t{constructor(e,i={}){super(e);y(this,"order");this.order=i.order||"right"}refresh(){const e=this.editor.model.document.selection,s=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=s}execute(){const e=this.editor,i=e.model.document.selection,s=e.plugins.get("TableUtils"),r=this.order==="left",o=s.getSelectionAffectedTableCells(i),a=s.getColumnIndexes(o),l=r?a.first:a.last,c=o[0].findAncestor("table");s.insertColumns(c,{columns:1,at:r?l:l+1})}}class w5 extends _t{constructor(e,i={}){super(e);y(this,"direction");this.direction=i.direction||"horizontally"}refresh(){const i=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=i.length===1}execute(){const e=this.editor.plugins.get("TableUtils"),i=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];this.direction==="horizontally"?e.splitCellHorizontally(i,2):e.splitCellVertically(i,2)}}class $_ extends _t{constructor(e,i){super(e);y(this,"direction");y(this,"isHorizontal");this.direction=i.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,i=e.document,r=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(i.selection)[0],o=this.value,a=this.direction;e.change(l=>{const c=a=="right"||a=="down",u=c?r:o,d=c?o:r,h=d.parent;w1e(d,u,l);const f=this.isHorizontal?"colspan":"rowspan",p=parseInt(r.getAttribute(f)||"1"),v=parseInt(o.getAttribute(f)||"1");l.setAttribute(f,p+v,u),l.setSelection(l.createRangeIn(u));
581const E=this.editor.plugins.get("TableUtils"),x=h.findAncestor("table");xO(x,E)})}_getMergeableCell(){const i=this.editor.model.document,s=this.editor.plugins.get("TableUtils"),r=s.getTableCellsContainingSelection(i.selection)[0];if(!r)return;const o=this.isHorizontal?p1e(r,this.direction,s):b1e(r,this.direction,s);if(!o)return;const a=this.isHorizontal?"rowspan":"colspan",l=parseInt(r.getAttribute(a)||"1");if(parseInt(o.getAttribute(a)||"1")===l)return o}}function p1e(n,t,e){const s=n.parent.parent,r=t=="right"?n.nextSibling:n.previousSibling,o=(s.getAttribute("headingColumns")||0)>0;if(!r)return;const a=t=="right"?n:r,l=t=="right"?r:n,{column:c}=e.getCellLocation(a),{column:u}=e.getCellLocation(l),d=parseInt(a.getAttribute("colspan")||"1"),h=LI(e,a),f=LI(e,l);return o&&h!=f?void 0:c+d===u?r:void 0}function b1e(n,t,e){const i=n.parent,s=i.parent,r=s.getChildIndex(i);if(t=="down"&&r===e.getRows(s)-1||t=="up"&&r===0)return null;const o=parseInt(n.getAttribute("rowspan")||"1"),a=s.getAttribute("headingRows")||0,l=t=="down"&&r+o===a,c=t=="up"&&r===a;if(a&&(l||c))return null;const u=parseInt(n.getAttribute("rowspan")||"1"),d=t=="down"?r+u:r,h=[...new Ct(s,{endRow:d})],p=h.find(E=>E.cell===n).column,v=h.find(({row:E,cellHeight:x,column:A})=>A!==p?!1:t=="down"?E===d:d===E+x);return v&&v.cell?v.cell:null}function w1e(n,t,e){v5(n)||(v5(t)&&e.remove(e.createRangeIn(t)),e.move(e.createRangeIn(n),e.createPositionAt(t,"end"))),e.remove(n)}function v5(n){const t=n.getChild(0);return n.childCount==1&&t.is("element","paragraph")&&t.isEmpty}class v1e extends _t{refresh(){const t=this.editor.plugins.get("TableUtils"),e=t.getSelectionAffectedTableCells(this.editor.model.document.selection),i=e[0];if(i){const s=i.findAncestor("table"),o=t.getRows(s)-1,a=t.getRowIndexes(e),l=a.first===0&&a.last===o;this.isEnabled=!l}else this.isEnabled=!1}execute(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),i=e.getSelectionAffectedTableCells(t.document.selection),s=e.getRowIndexes(i),r=i[0],o=r.findAncestor("table"),a=e.getCellLocation(r).column;t.change(l=>{const c=s.last-s.first+1;e.removeRows(o,{at:s.first,rows:c});const u=y1e(o,s.first,a,e.getRows(o));l.setSelection(l.createPositionAt(u,0))})}}function y1e(n,t,e,i){const s=n.getChild(Math.min(t,i-1));let r=s.getChild(0),o=0;for(const a of s.getChildren()){if(o>e)return r;r=a,o+=parseInt(a.getAttribute("colspan")||"1")}return r}class _1e extends _t{refresh(){const t=this.editor.plugins.get("TableUtils"),e=t.getSelectionAffectedTableCells(this.editor.model.document.selection),i=e[0];if(i){const s=i.findAncestor("table"),r=t.getColumns(s),{first:o,last:a}=t.getColumnIndexes(e);this.isEnabled=a-o<r-1}else this.isEnabled=!1}execute(){const t=this.editor.plugins.get("TableUtils"),[e,i]=S1e(this.editor.model.document.selection,t),s=e.parent.parent,r=[...new Ct(s)],o={first:r.find(l=>l.cell===e).column,last:r.find(l=>l.cell===i).column},a=E1e(r,e,i,o);this.editor.model.change(l=>{const c=o.last-o.first+1;t.removeColumns(s,{at:o.first,columns:c}),l.setSelection(l.createPositionAt(a,0))})}}function E1e(n,t,e,i){return parseInt(e.getAttribute("colspan")||"1")>1?e:t.previousSibling||e.nextSibling?e.nextSibling||t.previousSibling:i.first?n.reverse().find(({column:r})=>r<i.first).cell:n.reverse().find(({column:r})=>r>i.last).cell}function S1e(n,t){const e=t.getSelectionAffectedTableCells(n),i=e[0],s=e.pop(),r=[i,s];return i.isBefore(s)?r:r.reverse()}class T1e extends _t{refresh(){const t=this.editor.plugins.get("TableUtils"),e=this.editor.model,i=t.getSelectionAffectedTableCells(e.document.selection);if(i.length===0){this.isEnabled=!1,this.value=!1;return}const s=i[0].findAncestor("table");this.isEnabled=e.schema.checkAttribute(s,"headingRows"),this.value=i.every(r=>this._isInHeading(r,r.parent.parent))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.plugins.get("TableUtils"),i=this.editor.model,s=e.getSelectionAffectedTableCells(i.document.selection),r=s[0].findAncestor("table"),{first:o,last:a}=e.getRowIndexes(s),l=this.value?o:a+1,c=r.getAttribute("headingRows")||0;i.change(u=>{if(l){const d=l>c?c:0,h=jU(r,l,d);for(const{cell:f}of h)GU(f,l,u)}e.setHeadingRowsCount(u,r,l)}
581)}_isInHeading(t,e){const i=parseInt(e.getAttribute("headingRows")||"0");return!!i&&t.parent.index<i}}class x1e extends _t{refresh(){const t=this.editor.plugins.get("TableUtils"),e=this.editor.model,i=t.getSelectionAffectedTableCells(e.document.selection);if(i.length===0){this.isEnabled=!1,this.value=!1;return}const s=i[0].findAncestor("table");this.isEnabled=e.schema.checkAttribute(s,"headingColumns"),this.value=i.every(r=>LI(t,r))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.plugins.get("TableUtils"),i=this.editor.model,s=e.getSelectionAffectedTableCells(i.document.selection),r=s[0].findAncestor("table"),{first:o,last:a}=e.getColumnIndexes(s),l=this.value?o:a+1;i.change(c=>{if(l){const u=YU(r,l);for(const{cell:d,column:h}of u)qU(d,h,l,c)}e.setHeadingColumnsCount(c,r,l)})}}function A1e(n){if(n.is("element","tableColumnGroup"))return n;const t=n.getChildren();return Array.from(t).find(e=>e.is("element","tableColumnGroup"))}function C1e(n){const t=A1e(n);return t?Array.from(t.getChildren()):[]}class Ei extends we{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(t){const e=t.parent,i=e.parent,s=i.getChildIndex(e),r=new Ct(i,{row:s});for(const{cell:o,row:a,column:l}of r)if(o===t)return{row:a,column:l};/* istanbul ignore next -- @preserve */}createTable(t,e){const i=t.createElement("table"),s=e.rows||2,r=e.columns||2;return zA(t,i,0,s,r),e.headingRows&&this.setHeadingRowsCount(t,i,Math.min(e.headingRows,s)),e.headingColumns&&this.setHeadingColumnsCount(t,i,Math.min(e.headingColumns,r)),i}insertRows(t,e={}){const i=this.editor.model,s=e.at||0,r=e.rows||1,o=e.copyStructureFromAbove!==void 0,a=e.copyStructureFromAbove?s-1:s,l=Ta(this.editor),c=this.getRows(t),u=this.getColumns(t);if(s>c)throw new ee("tableutils-insertrows-insert-out-of-range",this,{options:e});i.change(d=>{let h=t.getAttribute("headingRows")||0;const f=t.getAttribute("headingColumns")||0;if(h>s&&(h+=r,this.setHeadingRowsCount(d,t,h,{shallow:!0})),!o&&(s===0||s===c)){const x=zA(d,t,s,r,u);if(l)for(let A=0;A<x.length;A++){const O=x[A];for(let I=0;I<u;I++){const T=O[I];(s+A<h||I<f)&&d.setAttribute("tableCellType","header",T)}}return}const p=o?Math.max(s,a):s,v=new Ct(t,{endRow:p}),E=new Array(u).fill(1);for(const{row:x,column:A,cellHeight:O,cellWidth:I,cell:T}of v){const P=x+O-1,k=x<s&&s<=P,D=x<=a&&a<=P;k?(d.setAttribute("rowspan",O+r,T),E[A]=-I):o&&D&&(E[A]=I)}for(let x=0;x<r;x++){const A=d.createElement("tableRow");d.insert(A,t,s);for(let O=0;O<E.length;O++){const I=E[O],T=d.createPositionAt(A,"end");if(I>0){const P=Mh(d,T,I>1?{colspan:I}:void 0);l&&(s+x<h||O<f)&&d.setAttribute("tableCellType","header",P)}O+=Math.abs(I)-1}}})}insertColumns(t,e={}){const i=this.editor.model,s=e.at||0,r=e.columns||1,o=Ta(this.editor);i.change(a=>{const l=t.getAttribute("headingRows")||0;let c=t.getAttribute("headingColumns");s<c&&(c+=r,this.setHeadingColumnsCount(a,t,c,{shallow:!0}));const u=this.getColumns(t);if(s===0||u===s){let h=0;for(const f of t.getChildren()){if(!f.is("element","tableRow"))continue;const p=af(r,a,a.createPositionAt(f,s?"end":0));if(o)for(let v=0;v<p.length;v++)(s+v<c||h<l)&&a.setAttribute("tableCellType","header",p[v]);h++}return}const d=new Ct(t,{column:s,includeAllSlots:!0});for(const h of d){const{row:f,cell:p,cellAnchorColumn:v,cellAnchorRow:E,cellWidth:x,cellHeight:A}=h;if(v<s){a.setAttribute("colspan",x+r,p);const O=E+A-1;for(let I=f;I<=O;I++)d.skipRow(I)}else{const O=af(r,a,h.getPositionBefore());if(o)for(let I=0;I<O.length;I++)(s+I<c||f<l)&&a.setAttribute("tableCellType","header",O[I])}}})}removeRows(t,e){const i=this.editor.model,s=e.rows||1,r=this.getRows(t),o=e.at,a=o+s-1;if(a>r-1)throw new ee("tableutils-removerows-row-index-out-of-range",this,{table:t,options:e});i.change(l=>{const c={first:o,last:a},{cellsToMove:u,cellsToTrim:d}=P1e(t,c);if(u.size){const h=a+1;M1e(t,h,u,l)}for(let h=a;h>=o;h--)l.remove(t.getChild(h));for(const{rowspan:h,cell:f}of d)On("rowspan",h,f,l);if(I1e(t,c,l),FI(t,this)||NI(t,this),Ta(this.editor)){let h=t.getAttribute("headingRows")||0;const f=this.getRows(t);for(;h<f&&Yh({table:t,row:h});)h++;this.setHeadingRowsCount(l,t,h,{shallow:!0})}})}
581removeColumns(t,e){const i=this.editor.model,s=e.at,r=e.columns||1,o=e.at+r-1;i.change(a=>{k1e(t,{first:s,last:o},a);const l=C1e(t);for(let c=o;c>=s;c--){for(const{cell:u,column:d,cellWidth:h}of[...new Ct(t)])d<=c&&h>1&&d+h>c?On("colspan",h-1,u,a):d===c&&a.remove(u);if(l[c]){const u=c===0?l[1]:l[c-1],d=parseFloat(l[c].getAttribute("columnWidth")),h=parseFloat(u.getAttribute("columnWidth"));a.remove(l[c]),a.setAttribute("columnWidth",d+h+"%",u)}}if(NI(t,this)||FI(t,this),Ta(this.editor)){let c=t.getAttribute("headingColumns")||0;const u=this.getColumns(t);for(;c<u&&Yh({table:t,column:c});)c++;this.setHeadingColumnsCount(a,t,c,{shallow:!0})}})}splitCellVertically(t,e=2){const i=this.editor.model,r=t.parent.parent,o=parseInt(t.getAttribute("rowspan")||"1"),a=parseInt(t.getAttribute("colspan")||"1");i.change(l=>{if(a>1){const{newCellsSpan:c,updatedSpan:u}=y5(a,e);On("colspan",u,t,l);const d={};c>1&&(d.colspan=c),o>1&&(d.rowspan=o);const h=a>e?e-1:a-1;af(h,l,l.createPositionAfter(t),d)}if(a<e){const c=e-a,u=[...new Ct(r)],{column:d}=u.find(({cell:v})=>v===t),h=u.filter(({cell:v,cellWidth:E,column:x})=>{const A=v!==t&&x===d,O=x<d&&x+E>d;return A||O});for(const{cell:v,cellWidth:E}of h)l.setAttribute("colspan",E+c,v);const f={};o>1&&(f.rowspan=o),af(c,l,l.createPositionAfter(t),f);const p=r.getAttribute("headingColumns")||0;p>d&&On("headingColumns",p+c,r,l)}})}splitCellHorizontally(t,e=2){const i=this.editor.model,s=t.parent,r=s.parent,o=r.getChildIndex(s),a=parseInt(t.getAttribute("rowspan")||"1"),l=parseInt(t.getAttribute("colspan")||"1");i.change(c=>{if(a>1){const u=[...new Ct(r,{startRow:o,endRow:o+a-1,includeAllSlots:!0})],{newCellsSpan:d,updatedSpan:h}=y5(a,e);On("rowspan",h,t,c);const{column:f}=u.find(({cell:E})=>E===t),p={};d>1&&(p.rowspan=d),l>1&&(p.colspan=l);let v=0;for(const E of u){const{column:x,row:A}=E,O=A>=o+h,I=x===f;v>=d&&I&&(v=0),O&&I&&(v||af(1,c,E.getPositionBefore(),p),v++)}}if(a<e){const u=e-a,d=[...new Ct(r,{startRow:0,endRow:o})];for(const{cell:p,cellHeight:v,row:E}of d)if(p!==t&&E+v>o){const x=v+u;c.setAttribute("rowspan",x,p)}const h={};l>1&&(h.colspan=l),zA(c,r,o+1,u,1,h);const f=r.getAttribute("headingRows")||0;f>o&&On("headingRows",f+u,r,c)}})}getColumns(t){return[...t.getChild(0).getChildren()].filter(i=>i.is("element","tableCell")).reduce((i,s)=>{const r=parseInt(s.getAttribute("colspan")||"1");return i+r},0)}getRows(t){return Array.from(t.getChildren()).reduce((e,i)=>i.is("element","tableRow")?e+1:e,0)}createTableWalker(t,e={}){return new Ct(t,e)}getSelectedTableCells(t){const e=[];for(const i of this.sortRanges(t.getRanges())){const s=i.getContainedElement();s&&s.is("element","tableCell")&&e.push(s)}return e}setHeadingRowsCount(t,e,i,s={}){const{shallow:r,resetFormerHeadingCells:o=!0,autoExpand:a=!0}=s,l=e.getAttribute("headingRows")||0;if(i!==l&&(On("headingRows",i,e,t,0),!(r||!Ta(this.editor)))){for(const{cell:c,row:u,column:d}of new Ct(e,{endRow:i-1}))W_({table:e,writer:t,cell:c,row:u,column:d});if(o&&i<l)for(let c=i;c<l&&Yh({table:e,row:c});c++)for(const{cell:u,row:d,column:h}of new Ct(e,{row:c}))W_({table:e,writer:t,cell:u,row:d,column:h});if(a&&i>l){const c=this.getRows(e);for(;i<c&&Yh({table:e,row:i});)i++;On("headingRows",i,e,t,0)}}}setHeadingColumnsCount(t,e,i,s={}){const{shallow:r,resetFormerHeadingCells:o=!0,autoExpand:a=!0}=s,l=e.getAttribute("headingColumns")||0;if(i!==l&&(On("headingColumns",i,e,t,0),!(r||!Ta(this.editor)))){for(const{cell:c,row:u,column:d}of new Ct(e,{endColumn:i-1}))W_({table:e,writer:t,cell:c,row:u,column:d});if(o&&i<l)for(let c=i;c<l&&Yh({table:e,column:c});c++)for(const{cell:u,row:d,column:h}of new Ct(e,{column:c}))W_({table:e,writer:t,cell:u,row:d,column:h});if(a&&i>l){const c=this.getColumns(e);for(;i<c&&Yh({table:e,column:i});)i++;On("headingColumns",i,e,t,0)}}}getTableCellsContainingSelection(t){const e=[];for(const i of t.getRanges()){const s=i.start.findAncestor("tableCell");s&&e.push(s)}return e}getSelectionAffectedTableCells(t){const e=this.getSelectedTableCells(t);return e.length?e:this.getTableCellsContainingSelection(t)}getRowIndexes(t){const e=t.map(i=>i.parent.index);return this._getFirstLastIndexesObject(e)}
581getColumnIndexes(t){const e=t[0].findAncestor("table"),s=[...new Ct(e)].filter(r=>t.includes(r.cell)).map(r=>r.column);return this._getFirstLastIndexesObject(s)}isSelectionRectangular(t){if(t.length<2||!this._areCellInTheSameTableSection(t))return!1;const e=new Set,i=new Set;let s=0;for(const o of t){const{row:a,column:l}=this.getCellLocation(o),c=parseInt(o.getAttribute("rowspan"))||1,u=parseInt(o.getAttribute("colspan"))||1;e.add(a),i.add(l),c>1&&e.add(a+c-1),u>1&&i.add(l+u-1),s+=c*u}return D1e(e,i)==s}sortRanges(t){return Array.from(t).sort(O1e)}_getFirstLastIndexesObject(t){const e=t.sort((r,o)=>r-o),i=e[0],s=e[e.length-1];return{first:i,last:s}}_areCellInTheSameTableSection(t){const e=t[0].findAncestor("table"),i=this.getRowIndexes(t),s=parseInt(e.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(i,s))return!1;const r=this.getColumnIndexes(t),o=parseInt(e.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(r,o)}_areIndexesInSameSection({first:t,last:e},i){const s=t<i,r=e<i;return s===r}}function zA(n,t,e,i,s,r={}){const o=[];for(let a=0;a<i;a++){const l=n.createElement("tableRow");n.insert(l,t,e),o.push(af(s,n,n.createPositionAt(l,"end"),r))}return o}function af(n,t,e,i={}){const s=[];let r=e;for(let o=0;o<n;o++){const a=Mh(t,r,i);s.push(a),r=t.createPositionAfter(a)}return s}function y5(n,t){if(n<t)return{newCellsSpan:1,updatedSpan:1};const e=Math.floor(n/t),i=n-e*t+e;return{newCellsSpan:e,updatedSpan:i}}function k1e(n,t,e){const i=n.getAttribute("headingColumns")||0;if(i&&t.first<i){const s=Math.min(i-1,t.last)-t.first+1;e.setAttribute("headingColumns",i-s,n)}}function I1e(n,{first:t,last:e},i){const s=n.getAttribute("headingRows")||0;if(t<s){const r=e<s?s-(e-t+1):t;On("headingRows",r,n,i,0)}}function P1e(n,{first:t,last:e}){const i=new Map,s=[];for(const{row:r,column:o,cellHeight:a,cell:l}of new Ct(n,{endRow:e})){const c=r+a-1;if(r>=t&&r<=e&&c>e){const h=e-r+1,f=a-h;i.set(o,{cell:l,rowspan:f})}if(r<t&&c>=t){let h;c>=e?h=e-t+1:h=c-t+1,s.push({cell:l,rowspan:a-h})}}return{cellsToMove:i,cellsToTrim:s}}function M1e(n,t,e,i){const r=[...new Ct(n,{includeAllSlots:!0,row:t})],o=n.getChild(t);let a;for(const{column:l,cell:c,isAnchor:u}of r)if(e.has(l)){const{cell:d,rowspan:h}=e.get(l),f=a?i.createPositionAfter(a):i.createPositionAt(o,0);i.move(i.createRangeOn(d),f),On("rowspan",h,d,i),a=d}else u&&(a=c)}function O1e(n,t){const e=n.start,i=t.start;return e.isBefore(i)?-1:1}function D1e(n,t){const e=Array.from(n.values()),i=Array.from(t.values()),s=Math.max(...e),r=Math.min(...e),o=Math.max(...i),a=Math.min(...i);return(s-r+1)*(o-a+1)}function W_({writer:n,table:t,row:e,column:i,cell:s}){const r=t.getAttribute("headingRows")||0,o=t.getAttribute("headingColumns")||0;e>=r&&i>=o?n.removeAttribute("tableCellType",s):n.setAttribute("tableCellType","header",s)}class R1e extends _t{refresh(){const t=this.editor.plugins.get(Ei),e=t.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=t.isSelectionRectangular(e)}execute(){const t=this.editor.model,e=this.editor.plugins.get(Ei);t.change(i=>{const s=e.getSelectedTableCells(t.document.selection),r=s.shift(),{mergeWidth:o,mergeHeight:a}=F1e(r,s,e);On("colspan",o,r,i),On("rowspan",a,r,i);for(const c of s)L1e(c,r,i);const l=r.findAncestor("table");xO(l,e),i.setSelection(r,"in")})}}function L1e(n,t,e){_5(n)||(_5(t)&&e.remove(e.createRangeIn(t)),e.move(e.createRangeIn(n),e.createPositionAt(t,"end"))),e.remove(n)}function _5(n){const t=n.getChild(0);return n.childCount==1&&t.is("element","paragraph")&&t.isEmpty}function F1e(n,t,e){let i=0,s=0;for(const c of t){const{row:u,column:d}=e.getCellLocation(c);i=E5(c,d,i,"colspan"),s=E5(c,u,s,"rowspan")}const{row:r,column:o}=e.getCellLocation(n),a=i-o,l=s-r;return{mergeWidth:a,mergeHeight:l}}function E5(n,t,e,i){const s=parseInt(n.getAttribute(i)||"1");return Math.max(e,t+s)}class N1e extends _t{constructor(t){super(t),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),i=e.getSelectionAffectedTableCells(t.document.selection),s=e.getRowIndexes(i),r=i[0].findAnce
581stor("table"),o=[];for(let a=s.first;a<=s.last;a++)for(const l of r.getChild(a).getChildren())o.push(t.createRangeOn(l));t.change(a=>{a.setSelection(o)})}}class B1e extends _t{constructor(t){super(t),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const t=this.editor.plugins.get("TableUtils"),e=this.editor.model,i=t.getSelectionAffectedTableCells(e.document.selection),s=i[0],r=i.pop(),o=s.findAncestor("table"),a=t.getCellLocation(s),l=t.getCellLocation(r),c=Math.min(a.column,l.column),u=Math.max(a.column,l.column),d=[];for(const h of new Ct(o,{startColumn:c,endColumn:u}))d.push(e.createRangeOn(h.cell));e.change(h=>{h.setSelection(d)})}}function V1e(n){n.document.registerPostFixer(t=>H1e(t,n))}function H1e(n,t){const e=t.document.differ.getChanges();let i=!1;const s=new Set;for(const r of e){let o=null;r.type=="insert"&&r.name=="table"&&(o=r.position.nodeAfter),(r.type=="insert"||r.type=="remove")&&(r.name=="tableRow"||r.name=="tableCell")&&(o=r.position.findAncestor("table")),j1e(r)&&(o=r.range.start.findAncestor("table")),o&&!s.has(o)&&(i=z1e(o,n)||i,i=$1e(o,n)||i,s.add(o))}return i}function z1e(n,t){let e=!1;const i=W1e(n);if(i.length){e=!0;for(const s of i)On("rowspan",s.rowspan,s.cell,t,1)}return e}function $1e(n,t){let e=!1;const i=U1e(n),s=[];for(const[l,c]of i.entries())!c&&n.getChild(l).is("element","tableRow")&&s.push(l);if(s.length){e=!0;for(const l of s.reverse())t.remove(n.getChild(l)),i.splice(l,1)}const r=i.filter((l,c)=>n.getChild(c).is("element","tableRow")),o=r[0];if(!r.every(l=>l===o)){const l=r.reduce((c,u)=>u>c?u:c,0);for(const[c,u]of r.entries()){const d=l-u;if(d){for(let h=0;h<d;h++)Mh(t,t.createPositionAt(n.getChild(c),"end"));e=!0}}}return e}function W1e(n){const t=parseInt(n.getAttribute("headingRows")||"0"),e=Array.from(n.getChildren()).reduce((s,r)=>r.is("element","tableRow")?s+1:s,0),i=[];for(const{row:s,cell:r,cellHeight:o}of new Ct(n)){if(o<2)continue;const l=s<t?t:e;if(s+o>l){const c=l-s;i.push({cell:r,rowspan:c})}}return i}function U1e(n){const t=new Array(n.childCount).fill(0);for(const{rowIndex:e}of new Ct(n,{includeAllSlots:!0}))t[e]++;return t}function j1e(n){if(n.type!=="attribute")return!1;const t=n.attributeKey;return t==="headingRows"||t==="colspan"||t==="rowspan"}/** 582 * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. 583 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 584 */function G1e(n){n.document.registerPostFixer(t=>Y1e(t,n))}function Y1e(n,t){const e=t.document.differ.getChanges();let i=!1;for(const s of e)s.type=="insert"&&s.name=="table"&&(i=q1e(s.position.nodeAfter,n)||i),s.type=="insert"&&s.name=="tableRow"&&(i=QU(s.position.nodeAfter,n)||i),s.type=="insert"&&s.name=="tableCell"&&(i=BI(s.position.nodeAfter,n)||i),(s.type=="remove"||s.type=="insert")&&K1e(s)&&(i=BI(s.position.parent,n)||i);return i}function q1e(n,t){let e=!1;for(const i of n.getChildren())i.is("element","tableRow")&&(e=QU(i,t)||e);return e}function QU(n,t){let e=!1;for(const i of n.getChildren())e=BI(i,t)||e;return e}function BI(n,t){if(n.childCount==0)return t.insertElement("paragraph",n),!0;const e=Array.from(n.getChildren()).filter(i=>i.is("$text"));for(const i of e)t.wrap(t.createRangeOn(i),"paragraph");return!!e.length}function K1e(n){return n.position.parent.is("element","tableCell")?n.type=="insert"&&n.name=="$text"||n.type=="remove":!1}function X1e(n,t){const e=n.document.differ;for(const i of e.getChanges()){let s,r=!1;if(i.type=="attribute"){const c=i.range.start.nodeAfter;if(!c||!c.is("element","table")||i.attributeKey!="headingRows"&&i.attributeKey!="headingColumns")continue;s=c,r=i.attributeKey=="headingRows"}else(i.name=="tableRow"||i.name=="tableCell")&&(s=i.position.findAncestor("table"),r=i.name=="tableRow");if(!s)continue;const o=s.getAttribute("headingRows")||0,a=s.getAttribute("headingColumns")||0,l=new Ct(s);for(const c of l){const d=c.row<o||c.column<a?"th":"td",h=t.mapper.toViewElement(c.cell);h&&h.is("element")&&h.name!=d&&t.reconvertItem(r?c.cell.parent:c.cell)}}}function J1e(n,t){const e=n.document.differ,i=new Set;for(const s of e.getChanges()){const r=s.type=="attribute"?s.range.start.parent:s.position.parent;r.is("element","tableCell")&&i.add(r)}for(const s of i.values()){const r=Array.from(s.getChildren()).filter(o=>Z1e(o,t.mapper));for(const o of r)t.reconvertItem(o)}}function Z1e(n,t){if(!n.is("element","paragraph"))return!1;const e=t.toViewElement(n);return e?ZU(n)!==e.is("element","span"):!1}class Q1e extends we{constructor(e){super(e);y(this,"_additionalSlots");this._additionalSlots=[]}static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ei]}init(){const e=this.editor,i=e.model,s=i.schema,r=e.conversion,o=e.plugins.get(Ei);
vendor: 8,913 bytes, line 584
584s.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),s.register("tableRow",{allowIn:"table",isLimit:!0}),s.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),r.for("upcast").add(e1e()),r.for("upcast").add(t1e()),r.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:f5(o,{asWidget:!0,additionalSlots:this._additionalSlots})}),r.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:f5(o,{additionalSlots:this._additionalSlots})}),r.for("upcast").elementToElement({model:"tableRow",view:"tr"}),r.for("upcast").add(n1e()),r.for("downcast").elementToElement({model:"tableRow",view:a1e()}),r.for("upcast").elementToElement({model:"tableCell",view:"td"}),r.for("upcast").elementToElement({model:"tableCell",view:"th"}),r.for("upcast").add(h5("td")),r.for("upcast").add(h5("th")),r.for("editingDowncast").elementToElement({model:"tableCell",view:g5({asWidget:!0,cellTypeEnabled:()=>Ta(this.editor)})}),r.for("dataDowncast").elementToElement({model:"tableCell",view:g5({cellTypeEnabled:()=>Ta(this.editor)})}),r.for("editingDowncast").elementToElement({model:"paragraph",view:m5({asWidget:!0}),converterPriority:"high"}),r.for("dataDowncast").elementToElement({model:"paragraph",view:m5(),converterPriority:"high"}),r.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),r.for("upcast").attributeToAttribute({model:{key:"colspan",value:S5("colspan")},view:"colspan"}),r.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),r.for("upcast").attributeToAttribute({model:{key:"rowspan",value:S5("rowspan")},view:"rowspan"}),this._addPlainTableOutputConverters(),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.config.define("table.showHiddenBorders",!0),e.config.get("table.showHiddenBorders")&&e.editing.view.change(a=>{for(const l of e.editing.view.document.roots)a.addClass("ck-table-show-hidden-borders",l)}),e.commands.add("insertTable",new g1e(e)),e.commands.add("insertTableRowAbove",new p5(e,{order:"above"})),e.commands.add("insertTableRowBelow",new p5(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new b5(e,{order:"left"})),e.commands.add("insertTableColumnRight",new b5(e,{order:"right"})),e.commands.add("removeTableRow",new v1e(e)),e.commands.add("removeTableColumn",new _1e(e)),e.commands.add("splitTableCellVertically",new w5(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new w5(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new R1e(e)),e.commands.add("mergeTableCellRight",new $_(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new $_(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new $_(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new $_(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new x1e(e)),e.commands.add("setTableRowHeader",new T1e(e)),e.commands.add("selectTableRow",new N1e(e)),e.commands.add("selectTableColumn",new B1e(e)),V1e(i),G1e(i),this.listenTo(i.document,"change:data",()=>{Ta(e)||X1e(i,e.editing),J1e(i,e.editing)})}registerAdditionalSlot(e){this._additionalSlots.push(e)}_addPlainTableOutputConverters(){const e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:u1e(e),converterPriority:"high"}),e.plugins.has("TableCaptionEditing")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:d1e(e),converterPriority:"high"}),e.plugins.has("TablePropertiesEditing")&&f1e(e)}}function S5(n){return t=>{const e=parseInt(t.getAttribute(n));return Number.isNaN(e)||e<=0?null:e}}class T5 extends Ye{constructor(e){super(e);y(this,"items");y(this,"keystrokes");y(this,"focusTracker");const i=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new rs,this.focusTracker=new fi,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(s,r)=>`${r} Ã ${s}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"[email protected]":i.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:i.to("label")}]}],on:{mousedown:i.to(s=>{s.preventDefault()}),click:i.to(()=>{this.fire("execute")})}}),this.on("boxover",(s,r)=>{const{row:o,column:a}=r.target.dataset;this.items.get((parseInt(o,10)-1)*10+(parseInt(a,10)-1)).focus()}),this.focusTracker.on("change:focusedElement",(s,r,o)=>{if(!o)return;const{row:a,column:l}=o.dataset;this.set({rows:parseInt(a),columns:parseInt(l)})}),this.on("change:columns",()=>this._highlightGridBoxes()),this.on("change:rows",()=>this._highlightGridBoxes())}render(){super.render(),Kbe({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,i=this.columns;this.items.map((s,r)=>{const o=Math.floor(r/10),a=r%10,l=o<e&&a<i;s.set("isOn",l)})}_createGridButton(e,i,s,r){const o=new pt(e);return o.set({label:r,class:"ck-insert-table-dropdown-grid-box"}),o.extendTemplate({attributes:{"data-row":i,"data-column":s}}),o}_createGridCollection(){const e=[];for(let i=0;i<100;i++){const s=Math.floor(i/10),r=i%10,o=`${s+1} Ã ${r+1}`;e.push(this._createGridButton(this.locale,s+1,r+1,o))}return this.createCollection(e)}}class eSe extends we{static get pluginName(){return"TableUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,e=this.editor.t,s=t.locale.contentLanguageDirection==="ltr";t.ui.componentFactory.add("insertTable",r=>{const o=t.commands.get("insertTable"),a=hl(r);a.bind("isEnabled").to(o),a.buttonView.set({icon:jF,label:e("Insert table"),tooltip:!0});let l;return a.on("change:isOpen",()=>{l||(l=new T5(r),a.panelView.children.add(l),l.delegate("execute").to(a),a.on("execute",()=>{t.execute("insertTable",{rows:l.rows,columns:l.columns}),t.editing.view.focus()}))}),a}),t.ui.componentFactory.add("menuBar:insertTable",r=>{const o=t.commands.get("insertTable"),a=new Lc(r),l=new T5(r);return l.delegate("execute").to(a),a.on("change:isOpen",(c,u,d)=>{d||l.reset()}),l.on("execute",()=>{t.execute("insertTable",{rows:l.rows,columns:l.columns}),t.editing.view.focus()}),a.buttonView.set({label:e("Table"),icon:jF}),a.panelView.children.add(l),a.bind("isEnabled").to(o),a}),t.ui.componentFactory.add("tableColumn",r=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:s?"insertTableColumnLeft":"insertTableColumnRight",label:e("Insert column left")}},{type:"button",model:{commandName:s?"insertTableColumnRight":"insertTableColumnLeft",label:e("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:e("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:e("Select column")}}];return this._prepareDropdown(e("Column"),wbe,o,r)}),t.ui.componentFactory.add("tableRow",r=>{const o=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:e("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:e("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:e("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:e("Select row")}}];return this._prepareDropdown(e("Row"),ybe,o,r)}),t.ui.componentFactory.add("mergeTableCells",r=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("Merge cell up")}},{type:"button",model:{commandName:s?"mergeTableCellRight":"mergeTableCellLeft",label:e("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("Merge cell down")}},{type:"button",model:{commandName:s?"mergeTableCellLeft":"mergeTableCellRight",label:e("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(e("Merge cells"),vbe,o,r)})}_prepareDropdown(t,e,i,s){const r=this.editor,o=hl(s),a=this._fillDropdownWithListOptions(o,i);return o.buttonView.set({label:t,icon:e,tooltip:!0}),o.bind("isEnabled").toMany(a,"isEnabled",(...l)=>l.some(c=>
584c)),this.listenTo(o,"execute",l=>{r.execute(l.source.commandName),l.source instanceof QT||r.editing.view.focus()}),o}_prepareMergeSplitButtonDropdown(t,e,i,s){const r=this.editor,o=hl(s,tx),a="mergeTableCells",l=r.commands.get(a),c=this._fillDropdownWithListOptions(o,i);return o.buttonView.set({label:t,icon:e,tooltip:!0,isEnabled:!0}),o.bind("isEnabled").toMany([l,...c],"isEnabled",(...u)=>u.some(d=>d)),this.listenTo(o.buttonView,"execute",()=>{r.execute(a),r.editing.view.focus()}),this.listenTo(o,"execute",u=>{r.execute(u.source.commandName),r.editing.view.focus()}),o}_fillDropdownWithListOptions(t,e){const i=this.editor,s=[],r=new er;for(const o of e)tSe(o,i,s,r);return mO(t,r),s}}function tSe(n,t,e,i){if(n.type==="button"||n.type==="switchbutton"){const s=n.model=new JE(n.model),{commandName:r,bindIsOn:o}=n.model,a=t.commands.get(r);e.push(a),s.set({commandName:r}),s.bind("isEnabled").to(a),o&&s.bind("isOn").to(a,"value"),s.set({withText:!0})}i.add(n)}class Fc extends we{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[Ei,Ei]}init(){const t=this.editor,e=t.model,i=t.editing.view;this.listenTo(e,"deleteContent",(s,r)=>this._handleDeleteContent(s,r),{priority:"high"}),this.listenTo(i.document,"insertText",(s,r)=>this._handleInsertTextEvent(s,r),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const t=this.editor.plugins.get(Ei),e=this.editor.model.document.selection,i=t.getSelectedTableCells(e);return i.length==0?null:i}getSelectionAsFragment(){const t=this.editor.plugins.get(Ei),e=this.getSelectedTableCells();return e?this.editor.model.change(i=>{const s=i.createDocumentFragment(),{first:r,last:o}=t.getColumnIndexes(e),{first:a,last:l}
584=t.getRowIndexes(e),c=e[0].findAncestor("table");let u=l,d=o;if(t.isSelectionRectangular(e)){const p={firstColumn:r,lastColumn:o,firstRow:a,lastRow:l};u=XU(c,p),d=JU(c,p)}const f=UU(c,{startRow:a,startColumn:r,endRow:u,endColumn:d},i);return i.insert(f,s,0),s}):null}setCellSelection(t,e){const i=this._getCellsToSelect(t,e);this.editor.model.change(s=>{s.setSelection(i.cells.map(r=>s.createRangeOn(r)),{backward:i.backward})})}getFocusCell(){const i=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return i&&i.is("element","tableCell")?i:null}getAnchorCell(){const t=this.editor.model.document.selection,i=$i(t.getRanges()).getContainedElement();return i&&i.is("element","tableCell")?i:null}_defineSelectionConverter(){const t=this.editor,e=new Set;t.conversion.for("editingDowncast").add(s=>s.on("selection",(r,o,a)=>{const l=a.writer;i(l);const c=this.getSelectedTableCells();if(!c)return;for(const d of c){const h=a.mapper.toViewElement(d);l.addClass("ck-editor__editable_selected",h),e.add(h)}const u=a.mapper.toViewElement(c[c.length-1]);l.setSelection(u,0)},{priority:"lowest"}));function i(s){for(const r of e)s.removeClass("ck-editor__editable_selected",r);e.clear()}}_enablePluginDisabling(){const t=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const e=this.getSelectedTableCells();if(!e)return;t.model.change(i=>{const s=i.createPositionAt(e[0],0),r=t.model.schema.getNearestSelectionRange(s);i.setSelection(r)})}})}_handleDeleteContent(t,e){const i=this.editor.plugins.get(Ei),s=e[0],r=e[1],o=this.editor.model,a=!r||r.direction=="backward",l=i.getSelectedTableCells(s);l.length&&(t.stop(),o.change(c=>{const u=l[a?l.length-1:0];o.change(h=>{for(const f of l)o.deleteContent(h.createSelection(f,"in"))});const d=o.schema.getNearestSelectionRange(c.createPositionAt(u,0));s.is("documentSelection")?c.setSelection(d):s.setTo(d)}))}_handleInsertTextEvent(t,e){const i=this.editor,s=this.getSelectedTableCells();if(!s)return;const r=i.editing.view,o=i.editing.mapper,a=s.map(l=>r.createRangeOn(o.toViewElement(l)));e.selection=r.createSelection(a),e.preventDefault()}_getCellsToSelect(t,e){const i=this.editor.plugins.get("TableUtils"),s=i.getCellLocation(t),r=i.getCellLocation(e),o=Math.min(s.row,r.row),a=Math.max(s.row,r.row),l=Math.min(s.column,r.column),c=parseInt(e.getAttribute("colspan")||"1")-1,u=Math.max(s.column,r.column+c),d=new Array(a-o+1).fill(null).map(()=>[]),h={startRow:o,endRow:a,startColumn:l,endColumn:u};for(const{row:v,cell:E}of new Ct(t.findAncestor("table"),h))d[v-o].push(E);const f=r.row<s.row,p=r.column<s.column;return f&&d.reverse(),p&&d.forEach(v=>v.reverse()),{cells:d.flat(),backward:f||p}}}class nSe extends we{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[mb,Er,Fc,Ei]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"copy",(i,s)=>this._onCopyCut(i,s)),this.listenTo(e,"cut",(i,s)=>this._onCopyCut(i,s)),this._listenToContentInsertion(),this.decorate("_replaceTableSlotCell")}_listenToContentInsertion(){const{editor:t}=this,e=t.plugins.get(Er),i=t.plugins.get(Fc);let s=!1;e.on("contentInsertion",(r,o)=>{s=o.method==="paste"}),this.listenTo(t.model,"insertContent",(r,[o,a])=>{(s||i.getSelectedTableCells()!==null)&&this._onInsertContent(r,o,a)},{priority:"high"}),e.on("contentInsertion",()=>{s=!1},{priority:"lowest"})}_onCopyCut(t,e){const i=this.editor.editing.view,s=this.editor.plugins.get(Fc),r=this.editor.plugins.get(mb);s.getSelectedTableCells()&&(t.name=="cut"&&!this.editor.model.canEditAt(this.editor.model.document.selection)||(e.preventDefault(),t.stop(),this.editor.model.enqueueChange({isUndoable:t.name==="cut"},()=>{const o=r._copySelectedFragmentWithMarkers(t.name,this.editor.model.document.selection,()=>s.getSelectionAsFragment());i.document.fire("clipboardOutput",{dataTransfer:e.dataTransfer,content:this.editor.data.toView(o),method:t.name})})))}_onInsertContent(t,e,i){if(i&&!i.is("documentSelection"))return;const s=this.editor.model,r=this.editor.plugins.get(Ei),o=this.editor.plugins.get(mb),a=this.getTableIfOnlyTableInContent(e,s);if(!a)return;const l=r.getSelectionAffectedTableCells(s.document.selection);if(!l.length){xO(a,r);return}t.stop(),e.is("documentFragment")?o._pasteMarkersIntoTransformedElement(e.markers,c=>this._replaceSelectedCells(a,l,c)):this.editor.model.change(c=>{this._replaceSelectedCells(a,l,c)})}_replaceSelectedCells(t,e,i){const s=this.editor.plugins.get(Ei),r={width:s.getColumns(t),height:s.getRows(t)},o=iSe(e,r,i,s),a=o.lastRow-o.firstRow+1,l=o.lastColumn-o.firstColumn+1,c={startRow:0,startColumn:0,endRow:Math.min(a,r.height)-1,endColumn:Math.min(l,r.width)-1};t=UU(t,c,i);
584const u=e[0].findAncestor("table"),d=this._replaceSelectedCellsWithPasted(t,r,u,o,i);if(this.editor.plugins.get("TableSelection").isEnabled){const h=s.sortRanges(d.map(f=>i.createRangeOn(f)));i.setSelection(h)}else i.setSelection(d[0],0);return u}_replaceSelectedCellsWithPasted(t,e,i,s,r){const{width:o,height:a}=e,l=rSe(t,o,a),c=[...new Ct(i,{startRow:s.firstRow,endRow:s.lastRow,startColumn:s.firstColumn,endColumn:s.lastColumn,includeAllSlots:!0})],u=[];let d;for(const E of c){const{row:x,column:A}=E;A===s.firstColumn&&(d=E.getPositionBefore());const O=x-s.firstRow,I=A-s.firstColumn,T=l[O%a][I%o],P=T?r.cloneElement(T):null,k=this._replaceTableSlotCell(E,P,d,r);k&&(KU(k,x,A,s.lastRow,s.lastColumn,r),u.push(k),d=r.createPositionAfter(k))}const h=parseInt(i.getAttribute("headingRows")||"0"),f=parseInt(i.getAttribute("headingColumns")||"0"),p=s.firstRow<h&&h<=s.lastRow,v=s.firstColumn<f&&f<=s.lastColumn;if(p){const E={first:s.firstColumn,last:s.lastColumn},x=VI(i,h,E,r,s.firstRow);u.push(...x)}if(v){const E={first:s.firstRow,last:s.lastRow},x=HI(i,f,E,r);u.push(...x)}return u}_replaceTableSlotCell(t,e,i,s){const{cell:r,isAnchor:o}=t;return o&&s.remove(r),e?(s.insert(e,i),e):null}getTableIfOnlyTableInContent(t,e){if(!t.is("documentFragment")&&!t.is("element"))return null;if(t.is("element","table"))return t;if(t.childCount==1&&t.getChild(0).is("element","table"))return t.getChild(0);const i=e.createRangeIn(t);for(const s of i.getItems())if(s.is("element","table")){const r=e.createRange(i.start,e.createPositionBefore(s));if(e.hasContent(r,{ignoreWhitespaces:!0}))return null;const o=e.createRange(e.createPositionAfter(s),i.end);return e.hasContent(o,{ignoreWhitespaces:!0})?null:s}return null}}function iSe(n,t,e,i){const s=n[0].findAncestor("table"),r=i.getColumnIndexes(n),o=i.getRowIndexes(n),a={firstColumn:r.first,lastColumn:r.last,firstRow:o.first,lastRow:o.last},l=n.length===1;return l&&(a.lastRow+=t.height-1,a.lastColumn+=t.width-1,sSe(s,a.lastRow+1,a.lastColumn+1,i)),l||!i.isSelectionRectangular(n)?oSe(s,a,e):(a.lastRow=XU(s,a),a.lastColumn=JU(s,a)),a}function sSe(n,t,e,i){const s=i.getColumns(n),r=i.getRows(n);e>s&&i.insertColumns(n,{at:s,columns:e-s}),t>r&&i.insertRows(n,{at:r,rows:t-r})}function rSe(n,t,e){const i=new Array(e).fill(null).map(()=>new Array(t).fill(null));for(const{column:s,row:r,cell:o}of new Ct(n))i[r][s]=o;return i}function oSe(n,t,e){const{firstRow:i,lastRow:s,firstColumn:r,lastColumn:o}=t,a={first:i,last:s},l={first:r,last:o};HI(n,r,a,e),HI(n,o+1,a,e),VI(n,i,l,e),VI(n,s+1,l,e,i)}function VI(n,t,e,i,s=0){return t<1?void 0:jU(n,t,s).filter(({column:a,cellWidth:l})=>e6(a,l,e)).map(({cell:a})=>GU(a,t,i))}function HI(n,t,e,i){return t<1?void 0:YU(n,t).filter(({row:o,cellHeight:a})=>e6(o,a,e)).map(({cell:o,column:a})=>qU(o,a,t,i))}function e6(n,t,e){const i=n+t-1,{first:s,last:r}=e,o=n>=s&&n<=r,a=n<s&&i>=s;return o||a}class aSe extends we{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[Fc,Ei]}init(){const t=this.editor,i=t.editing.view.document,s=t.t;this.listenTo(i,"arrowKey",(...r)=>this._onArrowKey(...r),{context:"table"}),this.listenTo(i,"tab",(...r)=>this._handleTabOnSelectedTable(...r),{context:"figure"}),this.listenTo(i,"tab",(...r)=>this._handleTab(...r),{context:["th","td"]}),t.accessibility.addKeystrokeInfoGroup({id:"table",label:s("Keystrokes that can be used in a table cell"),keystrokes:[{label:s("Move the selection to the next cell"),keystroke:"Tab"},{label:s("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:s("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:s("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(t,e){const r=this.editor.model.document.selection.getSelectedElement();!r||!r.is("element","table")||e.stopPropagation()}_handleTab(t,e){const i=this.editor,s=this.editor.plugins.get(Ei),r=this.editor.plugins.get("TableSelection"),o=i.model.document.selection,a=!e.shiftKey;let l=s.getTableCellsContainingSelection(o)[0];if(l||(l=r.getFocusCell()),!l)return;e.stopPropagation();const c=l.parent,u=c.parent,d=u.getChildIndex(c),f=c.getChildIndex(l)===c.childCount-1,p=d===s.getRows(u)-1;a&&p&&f&&i.execute("insertTableRowBelow")}_onArrowKey(t,e){const i=this.editor,s=e.keyCode,r=YM(s,i.locale.contentLanguageDirection);this._handleArrowKeys(r,e.shiftKey)&&(e.preventDefault(),e.stopPropagation(),t.stop())}_handleArrowKeys(t,e){const i=this.editor.plugins.get(Ei),s=this.editor.plugins.get("TableSelection"),r=this.editor.model,o=r.document.selection,a=["right","down"].includes(t),l=i.getSelectedTableCells(o);if(l.length){let u;return e?u=s.getFocusCell():u=a?l[l.length-1]:l[0],this._navigateFromCellInDirection(u,t,e),!0}
584const c=o.focus.findAncestor("tableCell");/* istanbul ignore if: paranoid check -- @preserve */if(!c)return!1;if(!o.isCollapsed)if(e){if(o.isBackward==a&&!o.containsEntireContent(c))return!1}else{const u=o.getSelectedElement();if(!u||!r.schema.isObject(u))return!1}return this._isSelectionAtCellEdge(o,c,a)?(this._navigateFromCellInDirection(c,t,e),!0):!1}_isSelectionAtCellEdge(t,e,i){const s=this.editor.model,r=this.editor.model.schema,o=i?t.getLastPosition():t.getFirstPosition();if(!r.getLimitElement(o).is("element","tableCell"))return s.createPositionAt(e,i?"end":0).isTouching(o);const a=s.createSelection(o);return s.modifySelection(a,{direction:i?"forward":"backward"}),o.isEqual(a.focus)}_navigateFromCellInDirection(t,e,i=!1){const s=this.editor.model,r=t.findAncestor("table"),o=[...new Ct(r,{includeAllSlots:!0})],{row:a,column:l}=o[o.length-1],c=o.find(({cell:A})=>A==t);let{row:u,column:d}=c;switch(e){case"left":d--;break;case"up":u--;break;case"right":d+=c.cellWidth;break;case"down":u+=c.cellHeight;break}const h=u<0||u>a,f=d<0&&u<=0,p=d>l&&u>=a;if(h||f||p){s.change(A=>{A.setSelection(A.createRangeOn(r))});return}d<0?(d=i?0:l,u--):d>l&&(d=i?l:0,u++);const v=o.find(A=>A.row==u&&A.column==d).cell,E=["right","down"].includes(e),x=this.editor.plugins.get("TableSelection");if(i&&x.isEnabled){const A=x.getAnchorCell()||t;x.setCellSelection(A,v)}else{const A=s.createPositionAt(v,E?0:"end");s.change(O=>{O.setSelection(A)})}}}class lSe extends sa{constructor(){super(...arguments);y(this,"domEventType",["mousemove","mouseleave"])}onDomEvent(e){this.fire(e.type,e)}}class cSe extends we{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[Fc,Ei]}init(){this.editor.editing.view.addObserver(lSe),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const t=this.editor,e=t.plugins.get(Ei);let i=!1;const s=t.plugins.get(Fc);this.listenTo(t.editing.view.document,"mousedown",(r,o)=>{const a=t.model.document.selection;if(!this.isEnabled||!s.isEnabled||!o.domEvent.shiftKey)return;const l=s.getAnchorCell()||e.getTableCellsContainingSelection(a)[0];if(!l)return;const c=this._getModelTableCellFromDomEvent(o);c&&x5(l,c)&&(i=!0,s.setCellSelection(l,c),o.preventDefault())}),this.listenTo(t.editing.view.document,"mouseup",()=>{i=!1}),this.listenTo(t.editing.view.document,"selectionChange",r=>{i&&r.stop()},{priority:"highest"})}_enableMouseDragSelection(){const t=this.editor;let e,i,s=!1,r=!1;const o=t.plugins.get(Fc);this.listenTo(t.editing.view.document,"mousedown",(a,l)=>{!this.isEnabled||!o.isEnabled||l.domEvent.shiftKey||l.domEvent.ctrlKey||l.domEvent.altKey||(e=this._getModelTableCellFromDomEvent(l))}),this.listenTo(t.editing.view.document,"mousemove",(a,l)=>{if(!l.domEvent.buttons||!e)return;const c=this._getModelTableCellFromDomEvent(l);c&&x5(e,c)&&(i=c,!s&&i!=e&&(s=!0)),s&&(r=!0,o.setCellSelection(e,i),l.preventDefault())}),this.listenTo(t.editing.view.document,"mouseup",()=>{s=!1,r=!1,e=null,i=null}),this.listenTo(t.editing.view.document,"selectionChange",a=>{r&&a.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(t){const e=t.target,i=this.editor.editing.view.createPositionAt(e,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function x5(n,t){return n.parent.parent==t.parent.parent}class uSe extends we{static get requires(){return[Q1e,eSe,Fc,cSe,aSe,nSe,rx]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}}function dSe(n){const t=n.getSelectedElement();return t&&t6(t)?t:null}function hSe(n){const t=n.getFirstPosition();if(!t)return null;let e=t.parent;for(;e;){if(e.is("element")&&t6(e))return e;e=e.parent}return null}function t6(n){return n.is("element")&&!!n.getCustomProperty("table")&&gn(n)}class fSe extends we{static get requires(){return[e1]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const t=this.editor,e=t.t,i=t.plugins.get(e1),s=t.config.get("table.contentToolbar"),r=t.config.get("table.tableToolbar");s&&i.register("tableContent",{ariaLabel:e("Table toolbar"),items:s,getRelatedElement:hSe}),r&&i.register("table",{ariaLabel:e("Table toolbar"),items:r,getRelatedElement:dSe})}}window.axios=Vj;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.Chart=Ea;window.moment=ke;window.jQuery=window.$=s7;window.Swal=Cc;const gSe=Cc.mixin({toast:!0,position:"top-end",showConfirmButton:!1,timer:3e3,timerProgressBar:!0,didOpen:n=>{n.addEventListener("mouseenter",Cc.stopTimer),n.addEventListener("mouseleave",Cc.resumeTimer),n.addEventListener("click",Cc.clickConfirm)}});window.toast=gSe;fm(_3);fm(E3);fm(A3);window.FilePond=zre;window.interact=zoe;Ule.workerSrc=jle;window.PDFJSExpressViewer=Yle;window.Calendar=kue;window.ClassicEditor=Nye;window.CKEditorPlugins={Essentials:Xye,Bold:Eve,Italic:xve,Underline:kve,Link:rEe,Paragraph:t1,List:KEe,Heading:l_e,BlockQuote:Bve,Undo:vO,AutoImage:b_e,ImageBlock:C_e,ImageCaption:D_e,ImageInline:I_e,ImageResize:l0e,ImageStyle:E0e,ImageToolbar:S0e,ImageUpload:J_e,
vendor: 5,712 bytes, line 584
584LinkImage:hEe,Table:uSe,TableToolbar:fSe,Base64UploadAdapter:Wpe};/* flatpickr v4.6.13,, @license MIT */(function(n,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis<"u"?globalThis:n||self).flatpickr=t()})(globalThis,function(){var n=function(){return(n=Object.assign||function(L){for(var N,m=1,_=arguments.length;m<_;m++)for(var C in N=arguments[m])Object.prototype.hasOwnProperty.call(N,C)&&(L[C]=N[C]);return L}).apply(this,arguments)};function t(){for(var L=0,N=0,m=arguments.length;N<m;N++)L+=arguments[N].length;var _=Array(L),C=0;for(N=0;N<m;N++)for(var B=arguments[N],$=0,X=B.length;$<X;$++,C++)_[C]=B[$];return _}var e=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],i={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(L){return typeof console<"u"&&console.warn(L)},getWeek:function(L){var N=new Date(L.getTime());N.setHours(0,0,0,0),N.setDate(N.getDate()+3-(N.getDay()+6)%7);var m=new Date(N.getFullYear(),0,4);return 1+Math.round(((N.getTime()-m.getTime())/864e5-3+(m.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},s={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(L){var N=L%100;if(N>3&&N<21)return"th";switch(N%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},r=function(L,N){return N===void 0&&(N=2),("000"+L).slice(-1*N)},o=function(L){return L===!0?1:0};function a(L,N){var m;return function(){var _=this,C=arguments;clearTimeout(m),m=setTimeout(function(){return L.apply(_,C)},N)}}var l=function(L){return L instanceof Array?L:[L]};function c(L,N,m){if(m===!0)return L.classList.add(N);L.classList.remove(N)}function u(L,N,m){var _=window.document.createElement(L);return N=N||"",m=m||"",_.className=N,m!==void 0&&(_.textContent=m),_}function d(L){for(;L.firstChild;)L.removeChild(L.firstChild)}function h(L,N){return N(L)?L:L.parentNode?h(L.parentNode,N):void 0}function f(L,N){var m=u("div","numInputWrapper"),_=u("input","numInput "+L),C=u("span","arrowUp"),B=u("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?_.type="number":(_.type="text",_.pattern="\\d*"),N!==void 0)for(var $ in N)_.setAttribute($,N[$]);return m.appendChild(_),m.appendChild(C),m.appendChild(B),m}function p(L){try{return typeof L.composedPath=="function"?L.composedPath()[0]:L.target}catch{return L.target}}var v=function(){},E=function(L,N,m){return m.months[N?"shorthand":"longhand"][L]},x={D:v,F:function(L,N,m){L.setMonth(m.months.longhand.indexOf(N))},G:function(L,N){L.setHours((L.getHours()>=12?12:0)+parseFloat(N))},H:function(L,N){L.setHours(parseFloat(N))},J:function(L,N){L.setDate(parseFloat(N))},K:function(L,N,m){L.setHours(L.getHours()%12+12*o(new RegExp(m.amPM[1],"i").test(N)))},M:function(L,N,m){L.setMonth(m.months.shorthand.indexOf(N))},S:function(L,N){L.setSeconds(parseFloat(N))},U:function(L,N){return new Date(1e3*parseFloat(N))},W:function(L,N,m){var _=parseInt(N),C=new Date(L.getFullYear(),0,2+7*(_-1),0,0,0,0);return C.setDate(C.getDate()-C.getDay()+m.firstDayOfWeek),C},Y:function(L,N){L.setFullYear(parseFloat(N))},Z:function(L,N){return new Date(N)},d:function(L,N){L.setDate(parseFloat(N))},h:function(L,N){L.setHours((L.getHours()>=12?12:0)+parseFloat(N))},i:function(L,N){L.setMinutes(parseFloat(N))},j:function(L,N){L.setDate(parseFloat(N))},l:v,m:function(L,N){L.setMonth(parseFloat(N)-1)},n:function(L,N){L.setMonth(parseFloat(N)-1)},s:function(L,N){L.setSeconds(parseFloat(N))},u:function(L,N){return new Date(parseFloat(N))},w:v,y:function(L,N){L.setFullYear(2e3+parseFloat(N))}},A={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"
584(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},O={Z:function(L){return L.toISOString()},D:function(L,N,m){return N.weekdays.shorthand[O.w(L,N,m)]},F:function(L,N,m){return E(O.n(L,N,m)-1,!1,N)},G:function(L,N,m){return r(O.h(L,N,m))},H:function(L){return r(L.getHours())},J:function(L,N){return N.ordinal!==void 0?L.getDate()+N.ordinal(L.getDate()):L.getDate()},K:function(L,N){return N.amPM[o(L.getHours()>11)]},M:function(L,N){return E(L.getMonth(),!0,N)},S:function(L){return r(L.getSeconds())},U:function(L){return L.getTime()/1e3},W:function(L,N,m){return m.getWeek(L)},Y:function(L){return r(L.getFullYear(),4)},d:function(L){return r(L.getDate())},h:function(L){return L.getHours()%12?L.getHours()%12:12},i:function(L){return r(L.getMinutes())},j:function(L){return L.getDate()},l:function(L,N){return N.weekdays.longhand[L.getDay()]},m:function(L){return r(L.getMonth()+1)},n:function(L){return L.getMonth()+1},s:function(L){return L.getSeconds()},u:function(L){return L.getTime()},w:function(L){return L.getDay()},y:function(L){return String(L.getFullYear()).substring(2)}},I=function(L){var N=L.config,m=N===void 0?i:N,_=L.l10n,C=_===void 0?s:_,B=L.isMobile,$=B!==void 0&&B;return function(X,Z,ie){var fe=ie||C;return m.formatDate===void 0||$?Z.split("").map(function(ae,ge,he){return O[ae]&&he[ge-1]!=="\\"?O[ae](X,fe,m):ae!=="\\"?ae:""}).join(""):m.formatDate(X,Z,fe)}},T=function(L){var N=L.config,m=N===void 0?i:N,_=L.l10n,C=_===void 0?s:_;return function(B,$,X,Z){if(B===0||B){var ie,fe=Z||C,ae=B;if(B instanceof Date)ie=new Date(B.getTime());else if(typeof B!="string"&&B.toFixed!==void 0)ie=new Date(B);else if(typeof B=="string"){var ge=$||(m||i).dateFormat,he=String(B).trim();if(he==="today")ie=new Date,X=!0;else if(m&&m.parseDate)ie=m.parseDate(B,ge);else if(/Z$/.test(he)||/GMT$/.test(he))ie=new Date(B);else{for(var ye=void 0,et=[],_e=0,gt=0,$e="";_e<ge.length;_e++){var Vt=ge[_e],An=Vt==="\\",vt=ge[_e-1]==="\\"||An;if(A[Vt]&&!vt){$e+=A[Vt];var Bt=new RegExp($e).exec(B);Bt&&(ye=!0)&&et[Vt!=="Y"?"push":"unshift"]({fn:x[Vt],val:Bt[++gt]})}else An||($e+=".")}ie=m&&m.noCalendar?new Date(new Date().setHours(0,0,0,0)):new Date(new Date().getFullYear(),0,1,0,0,0,0),et.forEach(function(At){var Ti=At.fn,gi=At.val;return ie=Ti(ie,gi,fe)||ie}),ie=ye?ie:void 0}}if(ie instanceof Date&&!isNaN(ie.getTime()))return X===!0&&ie.setHours(0,0,0,0),ie;m.errorHandler(new Error("Invalid date provided: "+ae))}}};function P(L,N,m){return m===void 0&&(m=!0),m!==!1?new Date(L.getTime()).setHours(0,0,0,0)-new Date(N.getTime()).setHours(0,0,0,0):L.getTime()-N.getTime()}var k=function(L,N,m){return 3600*L+60*N+m},D=864e5;function U(L){var N=L.defaultHour,m=L.defaultMinute,_=L.defaultSeconds;if(L.minDate!==void 0){var C=L.minDate.getHours(),B=L.minDate.getMinutes(),$=L.minDate.getSeconds();N<C&&(N=C),N===C&&m<B&&(m=B),N===C&&m===B&&_<$&&(_=L.minDate.getSeconds())}if(L.maxDate!==void 0){var X=L.maxDate.getHours(),Z=L.maxDate.getMinutes();(N=Math.min(N,X))===X&&(m=Math.min(Z,m)),N===X&&m===Z&&(_=L.maxDate.getSeconds())}return{hours:N,minutes:m,seconds:_}}typeof Object.assign!="function"&&(Object.assign=function(L){for(var N=[],m=1;m<arguments.length;m++)N[m-1]=arguments[m];if(!L)throw TypeError("Cannot convert undefined or null to object");for(var _=function(X){X&&Object.keys(X).forEach(function(Z){return L[Z]=X[Z]})},C=0,B=N;C<B.length;C++){var $=B[C];_($)}return L});function Y(L,N){var m={config:n(n({},i),j.defaultConfig),l10n:s};function _(){var te;return((te=m.calendarContainer)===null||te===void 0?void 0:te.getRootNode()).activeElement||document.activeElement}function C(te){return te.bind(m)}function B(){var te=m.config;te.weekNumbers===!1&&te.showMonths===1||te.noCalendar!==!0&&window.requestAnimationFrame(function(){if(m.calendarContainer!==void 0&&(m.calendarContainer.style.visibility="hidden",m.calendarContainer.style.display="block"),m.daysContainer!==void 0){var Q=(m.days.offsetWidth+1)*te.showMonths;m.daysContainer.style.width=Q+"px",m.calendarContainer.style.width=Q+(m.weekWrapper!==void 0?m.weekWrapper.offsetWidth:0)+"px",m.calendarContainer.style.removeProperty("visibility"),m.calendarContainer.style.removeProperty("display")}})}function $(te){if(m.selectedDates.length===0){var Q=m.config.minDate===void 0||P(new Date,m.config.minDate)>=0?new Date:new Date(m.config.minDate.getTime()),se=U(m.config);Q.setHours(se.hours,se.minutes,se.seconds,Q.getMilliseconds()),m.selectedDates=[Q],m.latestSelectedDateObj=Q}te!==void 0&&te.type!=="blur"&&function(Ae){Ae.preventDefault();
vendor: 11,856 bytes, lines 584-588
584var Re=Ae.type==="keydown",We=p(Ae),Ce=We;m.amPM!==void 0&&We===m.amPM&&(m.amPM.textContent=m.l10n.amPM[o(m.amPM.textContent===m.l10n.amPM[0])]);var Ue=parseFloat(Ce.getAttribute("min")),qe=parseFloat(Ce.getAttribute("max")),Ze=parseFloat(Ce.getAttribute("step")),it=parseInt(Ce.value,10),yt=Ae.delta||(Re?Ae.which===38?1:-1:0),Oe=it+Ze*yt;if(Ce.value!==void 0&&Ce.value.length===2){var Wt=Ce===m.hourElement,Qn=Ce===m.minuteElement;Oe<Ue?(Oe=qe+Oe+o(!Wt)+(o(Wt)&&o(!m.amPM)),Qn&&et(void 0,-1,m.hourElement)):Oe>qe&&(Oe=Ce===m.hourElement?Oe-qe-o(!m.amPM):Ue,Qn&&et(void 0,1,m.hourElement)),m.amPM&&Wt&&(Ze===1?Oe+it===23:Math.abs(Oe-it)>Ze)&&(m.amPM.textContent=m.l10n.amPM[o(m.amPM.textContent===m.l10n.amPM[0])]),Ce.value=r(Oe)}}(te);var le=m._input.value;X(),ir(),m._input.value!==le&&m._debouncedChange()}function X(){if(m.hourElement!==void 0&&m.minuteElement!==void 0){var te,Q,se=(parseInt(m.hourElement.value.slice(-2),10)||0)%24,le=(parseInt(m.minuteElement.value,10)||0)%60,Ae=m.secondElement!==void 0?(parseInt(m.secondElement.value,10)||0)%60:0;m.amPM!==void 0&&(te=se,Q=m.amPM.textContent,se=te%12+12*o(Q===m.l10n.amPM[1]));var Re=m.config.minTime!==void 0||m.config.minDate&&m.minDateHasTime&&m.latestSelectedDateObj&&P(m.latestSelectedDateObj,m.config.minDate,!0)===0,We=m.config.maxTime!==void 0||m.config.maxDate&&m.maxDateHasTime&&m.latestSelectedDateObj&&P(m.latestSelectedDateObj,m.config.maxDate,!0)===0;if(m.config.maxTime!==void 0&&m.config.minTime!==void 0&&m.config.minTime>m.config.maxTime){var Ce=k(m.config.minTime.getHours(),m.config.minTime.getMinutes(),m.config.minTime.getSeconds()),Ue=k(m.config.maxTime.getHours(),m.config.maxTime.getMinutes(),m.config.maxTime.getSeconds()),qe=k(se,le,Ae);if(qe>Ue&&qe<Ce){var Ze=function(Oe){var Wt=Math.floor(Oe/3600),Qn=(Oe-3600*Wt)/60;return[Wt,Qn,Oe-3600*Wt-60*Qn]}(Ce);se=Ze[0],le=Ze[1],Ae=Ze[2]}}else{if(We){var it=m.config.maxTime!==void 0?m.config.maxTime:m.config.maxDate;(se=Math.min(se,it.getHours()))===it.getHours()&&(le=Math.min(le,it.getMinutes())),le===it.getMinutes()&&(Ae=Math.min(Ae,it.getSeconds()))}if(Re){var yt=m.config.minTime!==void 0?m.config.minTime:m.config.minDate;(se=Math.max(se,yt.getHours()))===yt.getHours()&&le<yt.getMinutes()&&(le=yt.getMinutes()),le===yt.getMinutes()&&(Ae=Math.max(Ae,yt.getSeconds()))}}ie(se,le,Ae)}}function Z(te){var Q=te||m.latestSelectedDateObj;Q&&Q instanceof Date&&ie(Q.getHours(),Q.getMinutes(),Q.getSeconds())}function ie(te,Q,se){m.latestSelectedDateObj!==void 0&&m.latestSelectedDateObj.setHours(te%24,Q,se||0,0),m.hourElement&&m.minuteElement&&!m.isMobile&&(m.hourElement.value=r(m.config.time_24hr?te:(12+te)%12+12*o(te%12==0)),m.minuteElement.value=r(Q),m.amPM!==void 0&&(m.amPM.textContent=m.l10n.amPM[o(te>=12)]),m.secondElement!==void 0&&(m.secondElement.value=r(se)))}function fe(te){var Q=p(te),se=parseInt(Q.value)+(te.delta||0);(se/1e3>1||te.key==="Enter"&&!/[^\d]/.test(se.toString()))&&nr(se)}function ae(te,Q,se,le){return Q instanceof Array?Q.forEach(function(Ae){return ae(te,Ae,se,le)}):te instanceof Array?te.forEach(function(Ae){return ae(Ae,Q,se,le)}):(te.addEventListener(Q,se,le),void m._handlers.push({remove:function(){return te.removeEventListener(Q,se,le)}}))}function ge(){Jt("onChange")}function he(te,Q){var se=te!==void 0?m.parseDate(te):m.latestSelectedDateObj||(m.config.minDate&&m.config.minDate>m.now?m.config.minDate:m.config.maxDate&&m.config.maxDate<m.now?m.config.maxDate:m.now),le=m.currentYear,Ae=m.currentMonth;try{se!==void 0&&(m.currentYear=se.getFullYear(),m.currentMonth=se.getMonth())}catch(Re){Re.message="Invalid date supplied: "+se,m.config.errorHandler(Re)}Q&&m.currentYear!==le&&(Jt("onYearChange"),Bt()),!Q||m.currentYear===le&&m.currentMonth===Ae||Jt("onMonthChange"),m.redraw()}function ye(te){var Q=p(te);~Q.className.indexOf("arrow")&&et(te,Q.classList.contains("arrowUp")?1:-1)}function et(te,Q,se){var le=te&&p(te),Ae=se||le&&le.parentNode&&le.parentNode.firstChild,Re=tu("increment");Re.delta=Q,Ae&&Ae.dispatchEvent(Re)}function _e(te,Q,se,le){var Ae=jn(Q,!0),Re=u("span",te,Q.getDate().toString());return Re.dateObj=Q,Re.$i=le,Re.setAttribute("aria-label",m.formatDate(Q,m.config.ariaDateFormat)),te.indexOf("hidden")===-1&&P(Q,m.now)===0&&(m.todayDateElem=Re,Re.classList.add("today"),Re.setAttribute("aria-current","date")),Ae?(Re.tabIndex=-1,Lh(Q)&&(Re.classList.add("selected"),m.selectedDateElem=Re,m.config.mode==="range"&&(c(Re,"startRange",m.selectedDates[0]&&P(Q,m.selectedDates[0],!0)===0),c(Re,"endRange",m.selectedDates[1]&&P(Q,m.selectedDates[1],!0)===0),te==="nextMonthDay"&&Re.classList.add("inRange")))):Re.classList.add("flatpickr-disabled"),m.config.mode==="range"&&function(We){return!(m.config.mode!=="range"||m.selectedDates.length<2)&&P(We,m.selectedDates[0])>=0&&P(We,m.selectedDates[1])<=0}(Q)&&!Lh(Q)&&Re.classList.add("inRange"),m.weekNumbers&&m.config.showMonths===1&&te!=="prevMonthDay"&&le%7==6&&m.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+m.config.getWeek(Q)+"</span>"),Jt("onDayCreate",Re),Re}function gt(te){te.focus(),m.config.mode==="range"&&El(te)}function $e(te){for(var Q=te>0?0:m.config.showMonths-1,se=te>0?m.config.showMonths:-1,le=Q;le!=se;le+=te)for(var Ae=m.daysContainer.children[le],Re=te>0?0:Ae.children.length-1,We=te>0?Ae.children.length:-1,Ce=Re;Ce!=We;Ce+=te){var Ue=Ae.children[Ce];if(Ue.className.indexOf("hidden")===-1&&jn(Ue.dateObj))return Ue}}function Vt(te,Q){var se=_(),le=Jc(se||document.body),Ae=te!==void 0?te:le?se:m.selectedDateElem!==void 0&&Jc(m.selectedDateElem)?m.selectedDateElem:m.todayDateElem!==void 0&&Jc(m.todayDateElem)?m.todayDateElem:$e(Q>0?1:-1);Ae===void 0?m._input.focus():le?function(Re,We){for(var Ce=Re.className.indexOf("Month")===-1?Re.dateObj.getMonth():m.currentMonth,Ue=We>0?m.config.showMonths:-1,qe=We>0?1:-1,Ze=Ce-m.currentMonth;Ze!=Ue;Ze+=qe)for(var it=m.daysContainer.children[Ze],yt=Ce-m.currentMonth===Ze?Re.$i+We:We<0?it.children.length-1:0,Oe=it.children.length,Wt=yt;Wt>=0&&Wt<Oe&&Wt!=(We>0?Oe:-1);Wt+=qe){var Qn=it.children[Wt];if(Qn.className.indexOf("hidden")===-1&&jn(Qn.dateObj)&&Math.abs(Re.$i-Wt)>=Math.abs(We))return gt(Qn)}m.changeMonth(qe),Vt($e(qe),0)}(Ae,Q):gt(Ae)}function An(te,Q){for(var se=(new Date(te,Q,1).getDay()-m.l10n.firstDayOfWeek+7)%7,le=m.utils.getDaysInMonth((Q-1+12)%12,te),Ae=m.utils.getDaysInMonth(Q,te),Re=window.document.createDocumentFragment(),We=m.config.showMonths>1,Ce=We?"prevMonthDay hidden":"prevMonthDay",Ue=We?"nextMonthDay hidden":"nextMonthDay",qe=le+1-se,Ze=0;qe<=le;qe++,Ze++)Re.appendChild(_e("flatpickr-day "+Ce,new Date(te,Q-1,qe),0,Ze));for(qe=1;qe<=Ae;qe++,Ze++)Re.appendChild(_e("flatpickr-day",new Date(te,Q,qe),0,Ze));for(var it=Ae+1;it<=42-se&&(m.config.showMonths===1||Ze%7!=0);it++,Ze++)Re.appendChild(_e("flatpickr-day "+Ue,new Date(te,Q+1,it%Ae),0,Ze));var yt=u("div","dayContainer");return yt.appendChild(Re),yt}function vt(){if(m.daysContainer!==void 0){d(m.daysContainer),m.weekNumbers&&d(m.weekNumbers);for(var te=document.createDocumentFragment(),Q=0;Q<m.config.showMonths;Q++){var se=new Date(m.currentYear,m.currentMonth,1);se.setMonth(m.currentMonth+Q),te.appendChild(An(se.getFullYear(),se.getMonth()))}m.daysContainer.appendChild(te),m.days=m.daysContainer.firstChild,m.config.mode==="range"&&m.selectedDates.length===1&&El()}}function Bt(){if(!(m.config.showMonths>1||m.config.monthSelectorType!=="dropdown")){var te=function(le){return!(m.config.minDate!==void 0&&m.currentYear===m.config.minDate.getFullYear()&&le<m.config.minDate.getMonth())&&!(m.config.maxDate!==void 0&&m.currentYear===m.config.maxDate.getFullYear()&&le>m.config.maxDate.getMonth())};m.monthsDropdownContainer.tabIndex=-1,m.monthsDropdownContainer.innerHTML="";for(var Q=0;Q<12;Q++)if(te(Q)){var se=u("option","flatpickr-monthDropdown-month");se.value=new Date(m.currentYear,Q).getMonth().toString(),se.textContent=E(Q,m.config.shorthandCurrentMonth,m.l10n),se.tabIndex=-1,m.currentMonth===Q&&(se.selected=!0),m.monthsDropdownContainer.appendChild(se)}}}function At(){var te,Q=u("div","flatpickr-month"),se=window.document.createDocumentFragment();m.config.showMonths>1||m.config.monthSelectorType==="static"?te=u("span","cur-month"):(m.monthsDropdownContainer=u("select","flatpickr-monthDropdown-months"),m.monthsDropdownContainer.setAttribute("aria-label",m.l10n.monthAriaLabel),ae(m.monthsDropdownContainer,"change",function(We){var Ce=p(We),Ue=parseInt(Ce.value,10);m.changeMonth(Ue-m.currentMonth),Jt("onMonthChange")}),Bt(),te=m.monthsDropdownContainer);var le=f("cur-year",{tabindex:"-1"}),Ae=le.getElementsByTagName("input")[0];Ae.setAttribute("aria-label",m.l10n.yearAriaLabel),m.config.minDate&&Ae.setAttribute("min",m.config.minDate.getFullYear().toString()),m.config.maxDate&&(Ae.setAttribute("max",m.config.maxDate.getFullYear().toString()),Ae.disabled=!!m.config.minDate&&m.config.minDate.getFullYear()===m.config.maxDate.getFullYear());var Re=u("div","flatpickr-current-month");return Re.appendChild(te),Re.appendChild(le),se.appendChild(Re),Q.appendChild(se),{container:Q,yearElement:Ae,monthElement:te}}function Ti(){d(m.monthNav),m.monthNav.appendChild(m.prevMonthNav),m.config.showMonths&&(m.yearElements=[],m.monthElements=[]);for(var te=m.config.showMonths;te--;){var Q=At();m.yearElements.push(Q.yearElement),m.monthElements.push(Q.monthElement),m.monthNav.appendChild(Q.container)}m.monthNav.appendChild(m.nextMonthNav)}function gi(){m.weekdayContainer?d(m.weekdayContainer):m.weekdayContainer=u("div","flatpickr-weekdays");for(var te=m.config.showMonths;te--;){var Q=u("div","flatpickr-weekdaycontainer");m.weekdayContainer.appendChild(Q)}return kr(),m.weekdayContainer}function kr(){if(m.weekdayContainer){var te=m.l10n.firstDayOfWeek,Q=t(m.l10n.weekdays.shorthand);te>0&&te<Q.length&&(Q=t(Q.splice(te,Q.length),Q.splice(0,te)));for(var se=m.config.showMonths;se--;)m.weekdayContainer.children[se].innerHTML=` 585 <span class='flatpickr-weekday'> 586 `+Q.join("</span><span class='flatpickr-weekday'>")+` 587 </span> 588 `}}function Wi(te,Q){Q===void 0&&(Q=!0);var se=Q?te:te-m.currentMonth;se<0&&m._hidePrevMonthArrow===!0||se>0&&m._hideNextMonthArrow===!0||(m.currentMonth+=se,(m.currentMonth<0||m.currentMonth>11)&&(m.currentYear+=m.currentMonth>11?1:-1,m.currentMonth=(m.currentMonth+12)%12,Jt("onYearChange"),Bt()),vt(),Jt("onMonthChange"),Al())}function xi(te){return m.calendarContainer.contains(te)}function mi(te){if(m.isOpen&&!m.config.inline){var Q=p(te),se=xi(Q),le=!(Q===m.input||Q===m.altInput||m.element.contains(Q)||te.path&&te.path.indexOf&&(~te.path.indexOf(m.input)||~te.path.indexOf(m.altInput)))&&!se&&!xi(te.relatedTarget),Ae=!m.config.ignoredFocusElements.some(function(Re){return Re.contains(Q)});le&&Ae&&(m.config.allowInput&&m.setDate(m._input.value,!1,m.config.altInput?m.config.altFormat:m.config.dateFormat),m.timeContainer!==void 0&&m.minuteElement!==void 0&&m.hourElement!==void 0&&m.input.value!==""&&m.input.value!==void 0&&$(),m.close(),m.config&&m.config.mode==="range"&&m.selectedDates.length===1&&m.clear(!1))}}function nr(te){if(!(!te||m.config.minDate&&te<m.config.minDate.getFullYear()||m.config.maxDate&&te>m.config.maxDate.getFullYear())){var Q=te,se=m.currentYear!==Q;m.currentYear=Q||m.currentYear,m.config.maxDate&&m.currentYear===m.config.maxDate.getFullYear()?m.currentMonth=Math.min(m.config.maxDate.getMonth(),m.currentMonth):m.config.minDate&&m.currentYear===m.config.minDate.getFullYear()&&(m.currentMonth=Math.max(m.config.minDate.getMonth(),m.currentMonth)),se&&(m.redraw(),Jt("onYearChange"),Bt())}}function jn(te,Q){var se;Q===void 0&&(Q=!0);var le=m.parseDate(te,void 0,Q);if(m.config.minDate&&le&&P(le,m.config.minDate,Q!==void 0?Q:!m.minDateHasTime)<0||m.config.maxDate&&le&&P(le,m.config.maxDate,Q!==void 0?Q:!m.maxDateHasTime)>0)return!1;if(!m.config.enable&&m.config.disable.length===0)return!0;
588if(le===void 0)return!1;for(var Ae=!!m.config.enable,Re=(se=m.config.enable)!==null&&se!==void 0?se:m.config.disable,We=0,Ce=void 0;We<Re.length;We++){if(typeof(Ce=Re[We])=="function"&&Ce(le)||Ce instanceof Date&&le!==void 0&&Ce.getTime()===le.getTime())return Ae;if(typeof Ce=="string"){var Ue=m.parseDate(Ce,void 0,!0);return Ue&&Ue.getTime()===le.getTime()?Ae:!Ae}if(typeof Ce=="object"&&le!==void 0&&Ce.from&&Ce.to&&le.getTime()>=Ce.from.getTime()&&le.getTime()<=Ce.to.getTime())return Ae}return!Ae}function Jc(te){return m.daysContainer!==void 0&&te.className.indexOf("hidden")===-1&&te.className.indexOf("flatpickr-disabled")===-1&&m.daysContainer.contains(te)}function Zc(te){var Q=te.target===m._input,se=m._input.value.trimEnd()!==nu();!Q||!se||te.relatedTarget&&xi(te.relatedTarget)||m.setDate(m._input.value,!0,te.target===m.altInput?m.config.altFormat:m.config.dateFormat)}function Hy(te){var Q=p(te),se=m.config.wrap?L.contains(Q):Q===m._input,le=m.config.allowInput,Ae=m.isOpen&&(!le||!se),Re=m.config.inline&&se&&!le;if(te.keyCode===13&&se){if(le)return m.setDate(m._input.value,!0,Q===m.altInput?m.config.altFormat:m.config.dateFormat),m.close(),Q.blur();m.open()}else if(xi(Q)||Ae||Re){var We=!!m.timeContainer&&m.timeContainer.contains(Q);switch(te.keyCode){case 13:We?(te.preventDefault(),$(),Sl()):zm(te);break;case 27:te.preventDefault(),Sl();break;case 8:case 46:se&&!m.config.allowInput&&(te.preventDefault(),m.clear());break;case 37:case 39:if(We||se)m.hourElement&&m.hourElement.focus();else{te.preventDefault();var Ce=_();if(m.daysContainer!==void 0&&(le===!1||Ce&&Jc(Ce))){var Ue=te.keyCode===39?1:-1;te.ctrlKey?(te.stopPropagation(),Wi(Ue),Vt($e(1),0)):Vt(void 0,Ue)}}break;case 38:case 40:te.preventDefault();var qe=te.keyCode===40?1:-1;m.daysContainer&&Q.$i!==void 0||Q===m.input||Q===m.altInput?te.ctrlKey?(te.stopPropagation(),nr(m.currentYear-qe),Vt($e(1),0)):We||Vt(void 0,7*qe):Q===m.currentYearElement?nr(m.currentYear-qe):m.config.enableTime&&(!We&&m.hourElement&&m.hourElement.focus(),$(te),m._debouncedChange());break;case 9:if(We){var Ze=[m.hourElement,m.minuteElement,m.secondElement,m.amPM].concat(m.pluginElements).filter(function(Oe){return Oe}),it=Ze.indexOf(Q);if(it!==-1){var yt=Ze[it+(te.shiftKey?-1:1)];te.preventDefault(),(yt||m._input).focus()}}else!m.config.noCalendar&&m.daysContainer&&m.daysContainer.contains(Q)&&te.shiftKey&&(te.preventDefault(),m._input.focus())}}if(m.amPM!==void 0&&Q===m.amPM)switch(te.key){case m.l10n.amPM[0].charAt(0):case m.l10n.amPM[0].charAt(0).toLowerCase():m.amPM.textContent=m.l10n.amPM[0],X(),ir();break;case m.l10n.amPM[1].charAt(0):case m.l10n.amPM[1].charAt(0).toLowerCase():m.amPM.textContent=m.l10n.amPM[1],X(),ir()}(se||xi(Q))&&Jt("onKeyDown",te)}function El(te,Q){if(Q===void 0&&(Q="flatpickr-day"),m.selectedDates.length===1&&(!te||te.classList.contains(Q)&&!te.classList.contains("flatpickr-disabled"))){for(var se=te?te.dateObj.getTime():m.days.firstElementChild.dateObj.getTime(),le=m.parseDate(m.selectedDates[0],void 0,!0).getTime(),Ae=Math.min(se,m.selectedDates[0].getTime()),Re=Math.max(se,m.selectedDates[0].getTime()),We=!1,Ce=0,Ue=0,qe=Ae;qe<Re;qe+=D)jn(new Date(qe),!0)||(We=We||qe>Ae&&qe<Re,qe<le&&(!Ce||qe>Ce)?Ce=qe:qe>le&&(!Ue||qe<Ue)&&(Ue=qe));Array.from(m.rContainer.querySelectorAll("*:nth-child(-n+"+m.config.showMonths+") > ."+Q)).forEach(function(Ze){var it,yt,Oe,Wt=Ze.dateObj.getTime(),Qn=Ce>0&&Wt<Ce||Ue>0&&Wt>Ue;if(Qn)return Ze.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(iu){Ze.classList.remove(iu)});We&&!Qn||(["startRange","inRange","endRange","notAllowed"].forEach(function(iu){Ze.classList.remove(iu)}),te!==void 0&&(te.classList.add(se<=m.selectedDates[0].getTime()?"startRange":"endRange"),le<se&&Wt===le?Ze.classList.add("startRange"):le>se&&Wt===le&&Ze.classList.add("endRange"),Wt>=Ce&&(Ue===0||Wt<=Ue)&&(yt=le,Oe=se,(it=Wt)>Math.min(yt,Oe)&&it<Math.max(yt,Oe))&&Ze.classList.add("inRange")))})}}function zy(){!m.isOpen||m.config.static||m.config.inline||Qc()}function Oh(te){return function(Q){var se=m.config["_"+te+"Date"]=m.parseDate(Q,m.config.dateFormat),le=m.config["_"+(te==="min"?"max":"min")+"Date"];se!==void 0&&(m[te==="min"?"minDateHasTime":"maxDateHasTime"]=se.getHours()>0||se.getMinutes()>0||se.getSeconds()>0),m.selectedDates&&(m.selectedDates=m.selectedDates.filter(function(Ae){return jn(Ae)}),m.selectedDates.length||te!=="min"||Z(se),ir()),m.daysContainer&&(Hm(),se!==void 0?m.currentYearElement[te]=se.getFullYear().toString():m.currentYearElement.removeAttribute(te),m.currentYearElement.disabled=!!le&&se!==void 0&&le.getFullYear()===se.getFullYear())}}function Dh(){return m.config.wrap?L.querySelector("[data-input]"):L}function Rh(){typeof m.config.locale!="object"&&j.l10ns[m.config.locale]===void 0&&m.config.errorHandler(new Error("flatpickr: invalid locale "+m.config.locale)),m.l10n=n(n({},j.l10ns.default),typeof m.config.locale=="object"?m.config.locale:m.config.locale!=="default"?j.l10ns[m.config.locale]:void 0),A.D="("+m.l10n.weekdays.shorthand.join("|")+")",A.l="("+m.l10n.weekdays.longhand.join("|")+")",A.M="("+m.l10n.months.shorthand.join("|")+")",A.F="("+m.l10n.months.longhand.join("|")+")",A.K="("+m.l10n.amPM[0]+"|"+m.l10n.amPM[1]+"|"+m.l10n.amPM[0].toLowerCase()+"|"+m.l10n.amPM[1].toLowerCase()+")",n(n({},N),JSON.parse(JSON.stringify(L.dataset||{}))).time_24hr===void 0&&j.defaultConfig.time_24hr===void 0&&(m.config.time_24hr=m.l10n.time_24hr),m.formatDate=I(m),m.parseDate=T({config:m.config,l10n:m.l10n})}function Qc(te){if(typeof m.config.position!="function"){if(m.calendarContainer!==void 0){Jt("onPreCalendarPosition");var Q=te||m._positionElement,se=Array.prototype.reduce.call(m.calendarContainer.children,function(ru,Cl){return ru+Cl.offsetHeight},0),le=m.calendarContainer.offsetWidth,Ae=m.config.position.split(" "),Re=Ae[0],We=Ae.length>1?Ae[1]:null,Ce=Q.getBoundingClientRect(),Ue=window.innerHeight-Ce.bottom,qe=Re==="above"||Re!=="below"&&Ue<se&&Ce.top>se,Ze=window.pageYOffset+Ce.top+(qe?-se-2:Q.offsetHeight+2);if(c(m.calendarContainer,"arrowTop",!qe),c(m.calendarContainer,"arrowBottom",qe),!m.config.inline){var it=window.pageXOffset+Ce.left,yt=!1,Oe=!1;We==="center"?(it-=(le-Ce.width)/2,yt=!0):We==="right"&&(it-=le-Ce.width,Oe=!0),c(m.calendarContainer,"arrowLeft",!yt&&!Oe),c(m.calendarContainer,"arrowCenter",yt),c(m.calendarContainer,"arrowRight",Oe);var Wt=window.document.body.offsetWidth-(window.pageXOffset+Ce.right),Qn=it+le>window.document.body.offsetWidth,iu=Wt+le>window.document.body.offsetWidth;if(c(m.calendarContainer,"rightMost",Qn),!m.config.static)if(m.calendarContainer.style.top=Ze+"px",Qn)if(iu){var $m=function(){for(var ru=null,Cl=0;Cl<document.styleSheets.length;Cl++){var Um=document.styleSheets[Cl];if(Um.cssRules){try{Um.cssRules}catch{continue}ru=Um;break}}return ru??(Fh=document.createElement("style"),document.head.appendChild(Fh),Fh.sheet);var Fh}();if($m===void 0)return;var su=window.document.body.offsetWidth,Wm=Math.max(0,su/2-le/2),ax=$m.cssRules.length,lx="{left:"+Ce.left+"px;right:auto;}";c(m.calendarContainer,"rightMost",!1),c(m.calendarContainer,"centerMost",!0),$m.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+lx,ax),m.calendarContainer.style.left=Wm+"px",m.calendarContainer.style.right="auto"}else m.calendarContainer.style.left="auto",m.calendarContainer.style.right=Wt+"px";else m.calendarContainer.style.left=it+"px",m.calendarContainer.style.right="auto"}}}else m.config.position(m,te)}function Hm(){m.config.noCalendar||m.isMobile||(Bt(),Al(),vt())}function Sl(){m._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(m.close,0):m.close()}function zm(te){te.preventDefault(),te.stopPropagation();var Q=h(p(te),function(qe){return qe.classList&&qe.classList.contains("flatpickr-day")&&!qe.classList.contains("flatpickr-disabled")&&!qe.classList.contains("notAllowed")});if(Q!==void 0){var se=Q,le=m.latestSelectedDateObj=new Date(se.dateObj.getTime()),Ae=(le.getMonth()<m.currentMonth||le.getMonth()>m.currentMonth+m.config.showMonths-1)&&m.config.mode!=="range";if(m.selectedDateElem=se,m.config.mode==="single")m.selectedDates=[le];else if(m.config.mode==="multiple"){var Re=Lh(le);Re?m.selectedDates.splice(parseInt(Re),1):m.selectedDates.push(le)}else m.config.mode==="range"&&(m.selectedDates.length===2&&m.clear(!1,!1),m.latestSelectedDateObj=le,m.selectedDates.push(le),P(le,m.selectedDates[0],!0)!==0&&m.selectedDates.sort(function(qe,Ze){return qe.getTime()-Ze.getTime()}));if(X(),Ae){var We=m.currentYear!==le.getFullYear();m.currentYear=le.getFullYear(),m.currentMonth=le.getMonth(),We&&(Jt("onYearChange"),Bt()),Jt("onMonthChange")}if(Al(),vt(),ir(),Ae||m.config.mode==="range"||m.config.showMonths!==1?m.selectedDateElem!==void 0&&m.hourElement===void 0&&m.selectedDateElem&&m.selectedDateElem.focus():gt(se),m.hourElement!==void 0&&m.hourElement!==void 0&&m.hourElement.focus(),m.config.closeOnSelect){var Ce=m.config.mode==="single"&&!m.config.enableTime,Ue=m.config.mode==="range"&&m.selectedDates.length===2&&!m.config.enableTime;(Ce||Ue)&&Sl()}
588ge()}}m.parseDate=T({config:m.config,l10n:m.l10n}),m._handlers=[],m.pluginElements=[],m.loadedPlugins=[],m._bind=ae,m._setHoursFromDate=Z,m._positionCalendar=Qc,m.changeMonth=Wi,m.changeYear=nr,m.clear=function(te,Q){if(te===void 0&&(te=!0),Q===void 0&&(Q=!0),m.input.value="",m.altInput!==void 0&&(m.altInput.value=""),m.mobileInput!==void 0&&(m.mobileInput.value=""),m.selectedDates=[],m.latestSelectedDateObj=void 0,Q===!0&&(m.currentYear=m._initialDate.getFullYear(),m.currentMonth=m._initialDate.getMonth()),m.config.enableTime===!0){var se=U(m.config),le=se.hours,Ae=se.minutes,Re=se.seconds;ie(le,Ae,Re)}m.redraw(),te&&Jt("onChange")},m.close=function(){m.isOpen=!1,m.isMobile||(m.calendarContainer!==void 0&&m.calendarContainer.classList.remove("open"),m._input!==void 0&&m._input.classList.remove("active")),Jt("onClose")},m.onMouseOver=El,m._createElement=u,m.createDay=_e,m.destroy=function(){m.config!==void 0&&Jt("onDestroy");for(var te=m._handlers.length;te--;)m._handlers[te].remove();if(m._handlers=[],m.mobileInput)m.mobileInput.parentNode&&m.mobileInput.parentNode.removeChild(m.mobileInput),m.mobileInput=void 0;else if(m.calendarContainer&&m.calendarContainer.parentNode)if(m.config.static&&m.calendarContainer.parentNode){var Q=m.calendarContainer.parentNode;if(Q.lastChild&&Q.removeChild(Q.lastChild),Q.parentNode){for(;Q.firstChild;)Q.parentNode.insertBefore(Q.firstChild,Q);Q.parentNode.removeChild(Q)}}else m.calendarContainer.parentNode.removeChild(m.calendarContainer);m.altInput&&(m.input.type="text",m.altInput.parentNode&&m.altInput.parentNode.removeChild(m.altInput),delete m.altInput),m.input&&(m.input.type=m.input._type,m.input.classList.remove("flatpickr-input"),m.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(se){try{delete m[se]}catch{}})},m.isEnabled=jn,m.jumpToDate=he,m.updateValue=ir,m.open=function(te,Q){if(Q===void 0&&(Q=m._positionElement),m.isMobile===!0){if(te){te.preventDefault();var se=p(te);se&&se.blur()}return m.mobileInput!==void 0&&(m.mobileInput.focus(),m.mobileInput.click()),void Jt("onOpen")}if(!(m._input.disabled||m.config.inline)){var le=m.isOpen;m.isOpen=!0,le||(m.calendarContainer.classList.add("open"),m._input.classList.add("active"),Jt("onOpen"),Qc(Q)),m.config.enableTime===!0&&m.config.noCalendar===!0&&(m.config.allowInput!==!1||te!==void 0&&m.timeContainer.contains(te.relatedTarget)||setTimeout(function(){return m.hourElement.select()},50))}},m.redraw=Hm,m.set=function(te,Q){if(te!==null&&typeof te=="object")for(var se in Object.assign(m.config,te),te)eu[se]!==void 0&&eu[se].forEach(function(le){return le()});else m.config[te]=Q,eu[te]!==void 0?eu[te].forEach(function(le){return le()}):e.indexOf(te)>-1&&(m.config[te]=l(Q));m.redraw(),ir(!0)},m.setDate=function(te,Q,se){if(Q===void 0&&(Q=!1),se===void 0&&(se=m.config.dateFormat),te!==0&&!te||te instanceof Array&&te.length===0)return m.clear(Q);Tl(te,se),m.latestSelectedDateObj=m.selectedDates[m.selectedDates.length-1],m.redraw(),he(void 0,Q),Z(),m.selectedDates.length===0&&m.clear(!1),ir(Q),Q&&Jt("onChange")},m.toggle=function(te){if(m.isOpen===!0)return m.close();m.open(te)};var eu={locale:[Rh,kr],showMonths:[Ti,B,gi],minDate:[he],maxDate:[he],positionElement:[ra],clickOpens:[function(){m.config.clickOpens===!0?(ae(m._input,"focus",m.open),ae(m._input,"click",m.open)):(m._input.removeEventListener("focus",m.open),m._input.removeEventListener("click",m.open))}]};function Tl(te,Q){var se=[];if(te instanceof Array)se=te.map(function(le){return m.parseDate(le,Q)});else if(te instanceof Date||typeof te=="number")se=[m.parseDate(te,Q)];else if(typeof te=="string")switch(m.config.mode){case"single":case"time":se=[m.parseDate(te,Q)];break;case"multiple":se=te.split(m.config.conjunction).map(function(le){return m.parseDate(le,Q)});break;case"range":se=te.split(m.l10n.rangeSeparator).map(function(le){return m.parseDate(le,Q)})}else m.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(te)));
vendor: 4,322 bytes, line 588
588m.selectedDates=m.config.allowInvalidPreload?se:se.filter(function(le){return le instanceof Date&&jn(le,!1)}),m.config.mode==="range"&&m.selectedDates.sort(function(le,Ae){return le.getTime()-Ae.getTime()})}function xl(te){return te.slice().map(function(Q){return typeof Q=="string"||typeof Q=="number"||Q instanceof Date?m.parseDate(Q,void 0,!0):Q&&typeof Q=="object"&&Q.from&&Q.to?{from:m.parseDate(Q.from,void 0),to:m.parseDate(Q.to,void 0)}:Q}).filter(function(Q){return Q})}function ra(){m._positionElement=m.config.positionElement||m._input}function Jt(te,Q){if(m.config!==void 0){var se=m.config[te];if(se!==void 0&&se.length>0)for(var le=0;se[le]&&le<se.length;le++)se[le](m.selectedDates,m.input.value,m,Q);te==="onChange"&&(m.input.dispatchEvent(tu("change")),m.input.dispatchEvent(tu("input")))}}function tu(te){var Q=document.createEvent("Event");return Q.initEvent(te,!0,!0),Q}function Lh(te){for(var Q=0;Q<m.selectedDates.length;Q++){var se=m.selectedDates[Q];if(se instanceof Date&&P(se,te)===0)return""+Q}return!1}function Al(){m.config.noCalendar||m.isMobile||!m.monthNav||(m.yearElements.forEach(function(te,Q){var se=new Date(m.currentYear,m.currentMonth,1);se.setMonth(m.currentMonth+Q),m.config.showMonths>1||m.config.monthSelectorType==="static"?m.monthElements[Q].textContent=E(se.getMonth(),m.config.shorthandCurrentMonth,m.l10n)+" ":m.monthsDropdownContainer.value=se.getMonth().toString(),te.value=se.getFullYear().toString()}),m._hidePrevMonthArrow=m.config.minDate!==void 0&&(m.currentYear===m.config.minDate.getFullYear()?m.currentMonth<=m.config.minDate.getMonth():m.currentYear<m.config.minDate.getFullYear()),m._hideNextMonthArrow=m.config.maxDate!==void 0&&(m.currentYear===m.config.maxDate.getFullYear()?m.currentMonth+1>m.config.maxDate.getMonth():m.currentYear>m.config.maxDate.getFullYear()))}function nu(te){var Q=te||(m.config.altInput?m.config.altFormat:m.config.dateFormat);return m.selectedDates.map(function(se){return m.formatDate(se,Q)}).filter(function(se,le,Ae){return m.config.mode!=="range"||m.config.enableTime||Ae.indexOf(se)===le}).join(m.config.mode!=="range"?m.config.conjunction:m.l10n.rangeSeparator)}function ir(te){te===void 0&&(te=!0),m.mobileInput!==void 0&&m.mobileFormatStr&&(m.mobileInput.value=m.latestSelectedDateObj!==void 0?m.formatDate(m.latestSelectedDateObj,m.mobileFormatStr):""),m.input.value=nu(m.config.dateFormat),m.altInput!==void 0&&(m.altInput.value=nu(m.config.altFormat)),te!==!1&&Jt("onValueUpdate")}function $y(te){var Q=p(te),se=m.prevMonthNav.contains(Q),le=m.nextMonthNav.contains(Q);se||le?Wi(se?-1:1):m.yearElements.indexOf(Q)>=0?Q.select():Q.classList.contains("arrowUp")?m.changeYear(m.currentYear+1):Q.classList.contains("arrowDown")&&m.changeYear(m.currentYear-1)}return function(){m.element=m.input=L,m.isOpen=!1,function(){var Q=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],se=n(n({},JSON.parse(JSON.stringify(L.dataset||{}))),N),le={};m.config.parseDate=se.parseDate,m.config.formatDate=se.formatDate,Object.defineProperty(m.config,"enable",{get:function(){return m.config._enable},set:function(it){m.config._enable=xl(it)}}),Object.defineProperty(m.config,"disable",{get:function(){return m.config._disable},set:function(it){m.config._disable=xl(it)}});var Ae=se.mode==="time";if(!se.dateFormat&&(se.enableTime||Ae)){var Re=j.defaultConfig.dateFormat||i.dateFormat;le.dateFormat=se.noCalendar||Ae?"H:i"+(se.enableSeconds?":S":""):Re+" H:i"+(se.enableSeconds?":S":"")}if(se.altInput&&(se.enableTime||Ae)&&!se.altFormat){var We=j.defaultConfig.altFormat||i.altFormat;le.altFormat=se.noCalendar||Ae?"h:i"+(se.enableSeconds?":S K":" K"):We+" h:i"+(se.enableSeconds?":S":"")+" K"}Object.defineProperty(m.config,"minDate",{get:function(){return m.config._minDate},set:Oh("min")}),Object.defineProperty(m.config,"maxDate",{get:function(){return m.config._maxDate},set:Oh("max")});var Ce=function(it){return function(yt){m.config[it==="min"?"_minTime":"_maxTime"]=m.parseDate(yt,"H:i:S")}};Object.defineProperty(m.config,"minTime",{get:function(){return m.config._minTime},set:Ce("min")}),Object.defineProperty(m.config,"maxTime",{get:function(){return m.config._maxTime},set:Ce("max")}
588),se.mode==="time"&&(m.config.noCalendar=!0,m.config.enableTime=!0),Object.assign(m.config,le,se);for(var Ue=0;Ue<Q.length;Ue++)m.config[Q[Ue]]=m.config[Q[Ue]]===!0||m.config[Q[Ue]]==="true";for(e.filter(function(it){return m.config[it]!==void 0}).forEach(function(it){m.config[it]=l(m.config[it]||[]).map(C)}),m.isMobile=!m.config.disableMobile&&!m.config.inline&&m.config.mode==="single"&&!m.config.disable.length&&!m.config.enable&&!m.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Ue=0;Ue<m.config.plugins.length;Ue++){var qe=m.config.plugins[Ue](m)||{};for(var Ze in qe)e.indexOf(Ze)>-1?m.config[Ze]=l(qe[Ze]).map(C).concat(m.config[Ze]):se[Ze]===void 0&&(m.config[Ze]=qe[Ze])}se.altInputClass||(m.config.altInputClass=Dh().className+" "+m.config.altInputClass),Jt("onParseConfig")}(),Rh(),function(){if(m.input=Dh(),!m.input)return void m.config.errorHandler(new Error("Invalid input element specified"));m.input._type=m.input.type,m.input.type="text",m.input.classList.add("flatpickr-input"),m._input=m.input,m.config.altInput&&(m.altInput=u(m.input.nodeName,m.config.altInputClass),m._input=m.altInput,m.altInput.placeholder=m.input.placeholder,m.altInput.disabled=m.input.disabled,m.altInput.required=m.input.required,m.altInput.tabIndex=m.input.tabIndex,m.altInput.type="text",m.input.setAttribute("type","hidden"),!m.config.static&&m.input.parentNode&&m.input.parentNode.insertBefore(m.altInput,m.input.nextSibling)),m.config.allowInput||m._input.setAttribute("readonly","readonly"),ra()}(),function(){m.selectedDates=[],m.now=m.parseDate(m.config.now)||new Date;var Q=m.config.defaultDate||(m.input.nodeName!=="INPUT"&&m.input.nodeName!=="TEXTAREA"||!m.input.placeholder||m.input.value!==m.input.placeholder?m.input.value:null);Q&&Tl(Q,m.config.dateFormat),m._initialDate=m.selectedDates.length>0?m.selectedDates[0]:m.config.minDate&&m.config.minDate.getTime()>m.now.getTime()?m.config.minDate:m.config.maxDate&&m.config.maxDate.getTime()<m.now.getTime()?m.config.maxDate:m.now,m.currentYear=m._initialDate.getFullYear(),m.currentMonth=m._initialDate.getMonth(),m.selectedDates.length>0&&(m.latestSelectedDateObj=m.selectedDates[0]),m.config.minTime!==void 0&&(m.config.minTime=m.parseDate(m.config.minTime,"H:i")),m.config.maxTime!==void 0&&(m.config.maxTime=m.parseDate(m.config.maxTime,"H:i")),m.minDateHasTime=!!m.config.minDate&&(m.config.minDate.getHours()>0||m.config.minDate.getMinutes()>0||m.config.minDate.getSeconds()>0),m.maxDateHasTime=!!m.config.maxDate&&(m.config.maxDate.getHours()>0||m.config.maxDate.getMinutes()>0||m.config.maxDate.getSeconds()>0)}(),m.utils={getDaysInMonth:function(Q,se){return Q===void 0&&(Q=m.currentMonth),se===void 0&&(se=m.currentYear),Q===1&&(se%4==0&&se%100!=0||se%400==0)?29:m.l10n.daysInMonth[Q]}},m.isMobile||function(){var Q=window.document.createDocumentFragment();if(m.calendarContainer=u("div","flatpickr-calendar"),m.calendarContainer.tabIndex=-1,!m.config.noCalendar){if(Q.appendChild((m.monthNav=u("div","flatpickr-months"),m.yearElements=[],m.monthElements=[],m.prevMonthNav=u("span","flatpickr-prev-month"),m.prevMonthNav.innerHTML=m.config.prevArrow,m.nextMonthNav=u("span","flatpickr-next-month"),m.nextMonthNav.innerHTML=m.config.nextArrow,Ti(),Object.defineProperty(m,"_hidePrevMonthArrow",{get:function(){return m.__hidePrevMonthArrow},set:function(Ce){m.__hidePrevMonthArrow!==Ce&&(c(m.prevMonthNav,"flatpickr-disabled",Ce),m.__hidePrevMonthArrow=Ce)}}),Object.defineProperty(m,"_hideNextMonthArrow",{get:function(){return m.__hideNextMonthArrow},set:function(Ce){m.__hideNextMonthArrow!==Ce&&(c(m.nextMonthNav,"flatpickr-disabled",Ce),m.__hideNextMonthArrow=Ce)}}),m.currentYearElement=m.yearElements[0],Al(),m.monthNav)),m.innerContainer=u("div","flatpickr-innerContainer"),m.config.weekNumbers){var se=function(){m.calendarContainer.classList.add("hasWeeks");var Ce=u("div","flatpickr-weekwrapper");Ce.appendChild(u("span","flatpickr-weekday",m.l10n.weekAbbreviation));var Ue=u("div","flatpickr-weeks");return Ce.appendChild(Ue),{weekWrapper:Ce,weekNumbers:Ue}}(),le=se.weekWrapper,Ae=se.weekNumbers;m.innerContainer.appendChild(le),m.weekNumbers=Ae,m.weekWrapper=le}m.rContainer=u("div","flatpickr-rContainer"),m.rContainer.appendChild(gi()),m.daysContainer||(m.daysContainer=u("div","flatpickr-days"),m.daysContainer.tabIndex=-1),vt(),m.rContainer.appendChild(m.daysContainer),m.innerContainer.appendChild(m.rContainer),Q.appendChild(m.innerContainer)}m.config.enableTime&&Q.appendChild(function(){m.calendarContainer.classList.add("hasTime"),m.config.noCalendar&&m.calendarContainer.classList.add("noCalendar");var Ce=U(m.config);m.timeContainer=u("div","flatpickr-time"),m.timeContainer.tabIndex=-1;var Ue=u("span","flatpickr-time-separator",":"),qe=f("flatpickr-hour",{"aria-label":m.l
vendor: 8,252 bytes, line 588
58810n.hourAriaLabel});m.hourElement=qe.getElementsByTagName("input")[0];var Ze=f("flatpickr-minute",{"aria-label":m.l10n.minuteAriaLabel});if(m.minuteElement=Ze.getElementsByTagName("input")[0],m.hourElement.tabIndex=m.minuteElement.tabIndex=-1,m.hourElement.value=r(m.latestSelectedDateObj?m.latestSelectedDateObj.getHours():m.config.time_24hr?Ce.hours:function(yt){switch(yt%24){case 0:case 12:return 12;default:return yt%12}}(Ce.hours)),m.minuteElement.value=r(m.latestSelectedDateObj?m.latestSelectedDateObj.getMinutes():Ce.minutes),m.hourElement.setAttribute("step",m.config.hourIncrement.toString()),m.minuteElement.setAttribute("step",m.config.minuteIncrement.toString()),m.hourElement.setAttribute("min",m.config.time_24hr?"0":"1"),m.hourElement.setAttribute("max",m.config.time_24hr?"23":"12"),m.hourElement.setAttribute("maxlength","2"),m.minuteElement.setAttribute("min","0"),m.minuteElement.setAttribute("max","59"),m.minuteElement.setAttribute("maxlength","2"),m.timeContainer.appendChild(qe),m.timeContainer.appendChild(Ue),m.timeContainer.appendChild(Ze),m.config.time_24hr&&m.timeContainer.classList.add("time24hr"),m.config.enableSeconds){m.timeContainer.classList.add("hasSeconds");var it=f("flatpickr-second");m.secondElement=it.getElementsByTagName("input")[0],m.secondElement.value=r(m.latestSelectedDateObj?m.latestSelectedDateObj.getSeconds():Ce.seconds),m.secondElement.setAttribute("step",m.minuteElement.getAttribute("step")),m.secondElement.setAttribute("min","0"),m.secondElement.setAttribute("max","59"),m.secondElement.setAttribute("maxlength","2"),m.timeContainer.appendChild(u("span","flatpickr-time-separator",":")),m.timeContainer.appendChild(it)}return m.config.time_24hr||(m.amPM=u("span","flatpickr-am-pm",m.l10n.amPM[o((m.latestSelectedDateObj?m.hourElement.value:m.config.defaultHour)>11)]),m.amPM.title=m.l10n.toggleTitle,m.amPM.tabIndex=-1,m.timeContainer.appendChild(m.amPM)),m.timeContainer}()),c(m.calendarContainer,"rangeMode",m.config.mode==="range"),c(m.calendarContainer,"animate",m.config.animate===!0),c(m.calendarContainer,"multiMonth",m.config.showMonths>1),m.calendarContainer.appendChild(Q);var Re=m.config.appendTo!==void 0&&m.config.appendTo.nodeType!==void 0;if((m.config.inline||m.config.static)&&(m.calendarContainer.classList.add(m.config.inline?"inline":"static"),m.config.inline&&(!Re&&m.element.parentNode?m.element.parentNode.insertBefore(m.calendarContainer,m._input.nextSibling):m.config.appendTo!==void 0&&m.config.appendTo.appendChild(m.calendarContainer)),m.config.static)){var We=u("div","flatpickr-wrapper");m.element.parentNode&&m.element.parentNode.insertBefore(We,m.element),We.appendChild(m.element),m.altInput&&We.appendChild(m.altInput),We.appendChild(m.calendarContainer)}m.config.static||m.config.inline||(m.config.appendTo!==void 0?m.config.appendTo:window.document.body).appendChild(m.calendarContainer)}(),function(){if(m.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(m.element.querySelectorAll("[data-"+le+"]"),function(Ae){return ae(Ae,"click",m[le])})}),m.isMobile)return void function(){var le=m.config.enableTime?m.config.noCalendar?"time":"datetime-local":"date";m.mobileInput=u("input",m.input.className+" flatpickr-mobile"),m.mobileInput.tabIndex=1,m.mobileInput.type=le,m.mobileInput.disabled=m.input.disabled,m.mobileInput.required=m.input.required,m.mobileInput.placeholder=m.input.placeholder,m.mobileFormatStr=le==="datetime-local"?"Y-m-d\\TH:i:S":le==="date"?"Y-m-d":"H:i:S",m.selectedDates.length>0&&(m.mobileInput.defaultValue=m.mobileInput.value=m.formatDate(m.selectedDates[0],m.mobileFormatStr)),m.config.minDate&&(m.mobileInput.min=m.formatDate(m.config.minDate,"Y-m-d")),m.config.maxDate&&(m.mobileInput.max=m.formatDate(m.config.maxDate,"Y-m-d")),m.input.getAttribute("step")&&(m.mobileInput.step=String(m.input.getAttribute("step"))),m.input.type="hidden",m.altInput!==void 0&&(m.altInput.type="hidden");try{m.input.parentNode&&m.input.parentNode.insertBefore(m.mobileInput,m.input.nextSibling)}catch{}ae(m.mobileInput,"change",function(Ae){m.setDate(p(Ae).value,!1,m.mobileFormatStr),Jt("onChange"),Jt("onClose")})}();var Q=a(zy,50);if(m._debouncedChange=a(ge,300),m.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&ae(m.daysContainer,"mouseover",function(le){m.config.mode==="range"&&El(p(le))}),ae(m._input,"keydown",Hy),m.calendarContainer!==void 0&&ae(m.calendarContainer,"keydown",Hy),m.config.inline||m.config.static||ae(window,"resize",Q),window.ontouchstart!==void 0?ae(window.document,"touchstart",mi):ae(window.document,"mousedown",mi),ae(window.document,"focus",mi,{capture:!0}),m.config.clickOpens===!0&&(ae(m._input,"focus",m.open),ae(m._input,"click",m.open)),m.daysContainer!==void 0&&(ae(m.monthNav,"click",$y),ae(m.monthNav,["keyup","increment"],fe),ae(m.daysContainer,"click",zm)),m.timeContainer!==void 0&&m.minuteElement!==void 0&&m.hourElement!==void 0){var se=function(le){return p(le).select()};ae(m.timeContainer,["increment"],$),ae(m.timeContainer,"blur",$,{capture:!0}),ae(m.timeContainer,"click",ye),ae([m.hourElement,m.minuteElement],["focus","click"],se),m.secondElement!==void 0&&ae(m.secondElement,"focus",function(){return m.secondElement&&m.secondElement.select()}),m.amPM!==void 0&&ae(m.amPM,"click",function(le){$(le)})}m.config.allowInput&&ae(m._input,"blur",Zc)}(),(m.selectedDates.length||m.config.noCalendar)&&(m.config.enableTime&&Z(m.config.noCalendar?m.latestSelectedDateObj:void 0),ir(!1)),B();var te=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!m.isMobile&&te&&Qc(),Jt("onReady")}(),m}function K(L,N){for(var m=Array.prototype.slice.call(L).filter(function($){return $ instanceof HTMLElement}),_=[],C=0;C<m.length;C++){var B=m[C];try{if(B.getAttribute("data-fp-omit")!==null)continue;B._flatpickr!==void 0&&(B._flatpickr.destroy(),B._flatpickr=void 0),B._flatpickr=Y(B,N||{}),_.push(B._flatpickr)}catch($){console.error($)}}return _.length===1?_[0]:_}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(L){return K(this,L)},HTMLElement.prototype.flatpickr=function(L){return K([this],L)});var j=function(L,N){return typeof L=="string"?K(window.document.querySelectorAll(L),N):L instanceof Node?K([L],N):K(L,N)};return j.defaultConfig={},j.l10ns={en:n({},s),default:n({},s)},j.localize=function(L){j.l10ns.default=n(n({},j.l10ns.default),L)},j.setDefaults=function(L){j.defaultConfig=n(n({},j.defaultConfig),L)},j.parseDate=T({}),j.formatDate=I({}),j.compareDates=P,typeof jQuery<"u"&&jQuery.fn!==void 0&&(jQuery.fn.flatpickr=function(L){return K(this,L)}),Date.prototype.fp_incr=function(L){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof L=="string"?parseInt(L,10):L))},typeof window<"u"&&(window.flatpickr=j),j});document.addEventListener("alpine:init",()=>{Alpine.data("laravellivewiretable",n=>({tableId:"",showBulkActionsAlpine:!1,primaryKeyName:"",shouldBeDisplayed:n.entangle("shouldBeDisplayed"),tableName:n.entangle("tableName"),dataTableFingerprint:n.entangle("dataTableFingerprint"),listeners:[],childElementOpen:!1,filtersOpen:n.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:n.entangle("paginationCurrentCount"),paginationTotalItemCount:n.entangle("paginationTotalItemCount"),paginationCurrentItems:n.entangle("paginationCurrentItems"),selectedItems:n.entangle("selected"),selectAllStatus:n.entangle("selectAll"),delaySelectAll:n.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:n.entangle("hideBulkActionsWhenEmpty"),dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:n.entangle("defaultReorderColumn"),reorderStatus:n.entangle("reorderStatus"),currentlyReorderingStatus:n.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:n.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:n.entangle("reorderDisplayColumn"),externalFilterPillsVals:n.entangle("externalFilterPillsValues"),internalFilterPillsVals:n.entangle("internalFilterPillsVals"),show
588FilterPillLabel:[],filterPillsSeparator:", ",showFilterPillsSection:!0,removeHTMLTags(t){return(new DOMParser().parseFromString(t,"text/html").body.innerText||"").trim()},resetSpecificFilter(t){this.externalFilterPillsVals[t]=[],n.call("resetFilter",t)},resetAllFilters(){this.externalFilterPillsVals=[],n.call("setFilterDefaults")},setInternalFilterPillVal(t,e){e!==void 0&&(this.internalFilterPillsVals[t]=e)},syncExternalFilterPillsValues(t,e){this.externalFilterPillsVals[t]=e,this.showFilterPillLabel[t]=this.getFilterPillsLength(t)},getFilterPillsLength(t){return Object.keys(this.externalFilterPillsVals[t]).length??0},showFilterPillsValue(t,e){e!==void 0?this.externalFilterPillsVals[t]=e:this.externalFilterPillsVals[t]=null},setFilterPillsLength(t){return t!==void 0?Object.keys(t).length??0:0},showFilterPillsLabel(t){return this.getFilterPillsLength(t),this.getFilterPillsLength(t)>0},getFilterPillImplodedValues(t,e){let i=this.externalFilterPillsVals[t];return i!=="undefined"?i.join(e):""},showFilterPillsSeparator(t,e){return e+1<this.getFilterPillsLength(t)},dragStart(t){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=t.target.id,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",t.target.id),t.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(t){typeof this.currentlyHighlightedElement=="object"&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let e=t.target.closest("tr");this.currentlyHighlightedElement=e,t.offsetY<e.getBoundingClientRect().height/2?(e.classList.add("laravel-livewire-tables-highlight-top"),e.classList.remove("laravel-livewire-tables-highlight-bottom")):(e.classList.remove("laravel-livewire-tables-highlight-top"),e.classList.add("laravel-livewire-tables-highlight-bottom"))},dragLeaveEvent(t){t.target.closest("tr").classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top")},dropEvent(t){typeof this.currentlyHighlightedElement=="object"&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let e=t.target.closest("tr"),i=t.target.closest("tr").parentNode,s=document.getElementById(this.sourceID).closest("tr");s.classList.remove("laravel-livewire-table-dragging"),s.rowIndex,e.rowIndex;let r=document.getElementById(this.tableId);t.offsetY>e.getBoundingClientRect().height/2?i.insertBefore(s,e.nextSibling):i.insertBefore(s,e);let o="even";for(let a=1,l;l=r.rows[a];a++)l.classList.contains("hidden")||l.classList.contains("md:hidden")||(o==="even"?(l.classList.remove(...this.oddNotInEven),l.classList.add(...this.evenNotInOdd),o="odd"):(l.classList.remove(...this.evenNotInOdd),l.classList.add(...this.oddNotInEven),o="even"))},reorderToggle(){this.currentlyReorderingStatus?n.disableReordering():(this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!0),this.setupEvenOddClasses(),n.enableReordering()),this.$nextTick(()=>{this.setupEvenOddClasses()})},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),n.disableReordering()},updateOrderedItems(){let t=document.getElementById(this.tableId),e=[];for(let i=1,s;s=t.rows[i];i++)e.push({[this.primaryKeyName]:s.getAttribute("rowpk"),[this.defaultReorderColumn]:i});n.storeReorder(e)},setupEvenOddClasses(){if(this.evenNotInOdd.length===void 0||this.evenNotInOdd.length==0||this.oddNotInEven.length===void 0||this.oddNotInEven.length==0){let t=document.getElementById(this.tableId).getElementsByTagName("tbody")[0],e=[],i=[];t.rows[0]!==void 0&&t.rows[1]!==void 0&&(e=Array.from(t.rows[0].classList),i=Array.from(t.rows[1].classList),this.evenNotInOdd=e.filter(s=>!i.includes(s)),this.oddNotInEven=i.filter(s=>!e.includes(s)),e=[],i=[])}},toggleSelectAll(){this.showBulkActionsAlpine&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){this.showBulkActionsAlpine&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):n.setAllSelected())},clearSelected(){this.showBulkActionsAlpine&&(this.selectAllStatus=!1,n.clearSelected())},selectAllOnPage(){if(!this.showBulkActionsAlpine)return;let t=this.selectedItems,e=this.paginationCurrentItems.values();for(let i of e)t.push(i.toString());this.selectedItems=[...new Set(t)]},setTableId(t){this.tableId=t},setAlpineBulkActions(t){this.showBulkActionsAlpine=t},setPrimaryKeyName(t){this.primaryKeyName=t},showTable(t){let e=t.detail.tableName??"",i=t.detail.tableFingerpint??"";((e??"")!=""&&e===this.tableName||i!=""&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!0)},hideTable(t){let e=t.detail.tableName??"",i=t.detail.tableFingerpint??"";(e!=""&&e===this.tableName||i!=""&&eventTableFingerpint===this.dataTableFingerprint)&&(this.shouldBeDisplayed=!1)}
588,destroy(){this.listeners.forEach(t=>{t()})}})),Alpine.data("booleanFilter",(n,t,e,i)=>({localListeners:[],switchOn:!1,value:n.entangle("filterComponents."+t).live,init(){this.switchOn=!1,this.value!==void 0&&(this.switchOn=!!Number(this.value)),this.localListeners.push(Livewire.on("filter-was-set",s=>{s.tableName==this.tableName&&s.filterKey==t&&(this.switchOn=s.value??i)}))},destroy(){this.localListeners.forEach(s=>{s()})}})),Alpine.data("newBooleanFilter",(n,t,e)=>({booleanFilterKey:n,switchOn:!1,value:!1,toggleStatus(){let i=!Number(this.$wire.get("filterComponents."+this.booleanFilterKey)??this.value);return this.switchOn=this.value=i,Number(i)},toggleStatusWithUpdate(){let i=this.toggleStatus();this.$wire.set("filterComponents."+this.booleanFilterKey,i)},toggleStatusWithReset(){this.toggleStatus(),this.$wire.call("resetFilter",this.booleanFilterKey)},setSwitchOn(i){let s=Number(i??0);this.switchOn=!!s},init(){this.$nextTick(()=>{this.value=this.$wire.get("filterComponents."+this.booleanFilterKey)??e,this.setSwitchOn(this.value??0)}),this.listeners.push(Livewire.on("filter-was-set",i=>{i.tableName==this.tableName&&i.filterKey==this.booleanFilterKey&&(this.switchOn=i.value??e)}))}})),Alpine.data("booleanFilterLatest",n=>({booleanFilterKey:n.filterKey,booleanFilterDefaultValue:n.defaultValue,switchOn:!1,value:!1,toggleStatus(){let t=!Number(this.$wire.get("filterComponents."+this.booleanFilterKey)??this.value);return this.switchOn=this.value=t,Number(t)},toggleStatusWithUpdate(){let t=this.toggleStatus();this.$wire.set("filterComponents."+this.booleanFilterKey,t)},toggleStatusWithReset(){this.toggleStatus(),this.$wire.call("resetFilter",this.booleanFilterKey)},setSwitchOn(t){let e=Number(t??0);this.switchOn=!!e},init(){this.$nextTick(()=>{this.value=this.$wire.get("filterComponents."+this.booleanFilterKey)??this.booleanFilterDefaultValue,this.setSwitchOn(this.value??0)}),this.listeners.push(Livewire.on("filter-was-set",t=>{t.tableName==this.tableName&&t.filterKey==this.booleanFilterKey&&(this.switchOn=t.value??this.booleanFilterDefaultValue)}))}})),Alpine.data("numberRangeFilter",(n,t,e,i,s)=>({allFilters:n.entangle("filterComponents",!1),originalMin:0,originalMax:100,filterMin:0,filterMax:100,currentMin:0,currentMax:100,hasUpdate:!1,wireValues:n.entangle("filterComponents."+t,!1),defaultMin:i.minRange,defaultMax:i.maxRange,restrictUpdates:!1,initialiseStyles(){let r=document.getElementById(e);r.style.setProperty("--value-a",this.wireValues.min??this.filterMin),r.style.setProperty("--text-value-a",JSON.stringify(this.wireValues.min??this.filterMin)),r.style.setProperty("--value-b",this.wireValues.max??this.filterMax),r.style.setProperty("--text-value-b",JSON.stringify(this.wireValues.max??this.filterMax))},updateStyles(r,o){let a=document.getElementById(e);a.style.setProperty("--value-a",r),a.style.setProperty("--text-value-a",JSON.stringify(r)),a.style.setProperty("--value-b",o),a.style.setProperty("--text-value-b",JSON.stringify(o))},setupWire(){this.wireValues!==void 0?(this.filterMin=this.originalMin=this.wireValues.min!==void 0?this.wireValues.min:this.defaultMin,this.filterMax=this.originalMax=this.wireValues.max!==void 0?this.wireValues.max:this.defaultMax):(this.filterMin=this.originalMin=this.defaultMin,this.filterMax=this.originalMax=this.defaultMax),this.updateStyles(this.filterMin,this.filterMax)},allowUpdates(){this.updateWire()},updateWire(){let r=parseInt(this.filterMin),o=parseInt(this.filterMax);(r!=this.originalMin||o!=this.originalMax)&&(o<r&&(this.filterMin=o,this.filterMax=r),this.hasUpdate=!0,this.originalMin=r,this.originalMax=o),this.updateStyles(this.filterMin,this.filterMax)},updateWireable(){this.hasUpdate&&(this.hasUpdate=!1,this.wireValues={min:this.filterMin,max:this.filterMax},n.set("filterComponents."+t,this.wireValues))},init(){this.initialiseStyles(),this.setupWire(),this.$watch("allFilters",r=>this.setupWire())}})),Alpine.data("flatpickrFilter",(n,t,e,i,s)=>({wireValues:n.entangle("filterComponents."+t),flatpickrInstance:flatpickr(i,{mode:"range",altFormat:e.altFormat??"F j, Y",altInput:e.altInput??!1,allowInput:e.allowInput??!1,allowInvalidPreload:e.allowInvalidPreload??!0,ariaDateFormat:e.ariaDateFormat??"F j, Y",clickOpens:!0,dateFormat:e.dateFormat??"Y-m-d",defaultDate:e.defaultDate??null,defaultHour:e.defaultHour??12,defaultMinute:e.defaultMinute??0,enableTime:e.enableTime??!1,enableSeconds:e.enableSeconds??!1,hourIncrement:e.hourIncrement??1,locale:e.locale??"en",minDate:e.earliestDate??null,maxDate:e.latestDate??null,minuteIncrement:e.minuteIncrement??5,shorthandCurrentMonth:e.shorthandCurrentMonth??!1,time_24hr:e.time_24hr??!1,weekNumbers:e.weekNumbers??!1,onOpen:function(){window.childElementOpen=!0},onChange:function(r,o,a){if(r.length>1){var l=o.split(" "),c={};window.childElementOpen=!1,window.filterPopoverOpen=!1,c={minDate:l[0],maxDate:l[2]===void 0?l[0]:l[2]},n.set("filterComponents."+t,c)}}}),changedValue:function(r){r.length<5&&(this.flatpickrInstance.setDate([]),n.set("filterComponents."+t,{}))},setupWire(){if(this.wireValues!==void 0)if(this.wireValues.minDate!==void 0&&this.wireValues.maxDate!==void 0){let r=[this.wireValues.minDate,this.wireValues.maxDate];this.flatpickrInstance.setDate(r)}else this.flatpickrInstance.setDate([]);else this.flatpickrInstance.setDate([])},init(){this.setupWire(),this.$watch("wireValues",r=>this.setupWire())}})),Alpine.data("tableWrapper",(n,t)=>({shouldBeDisplayed:n.entangle("shouldBeDisplayed"),listeners:[],childElementOpen:!1,filtersOpen:n.entangle("filterSlideDownDefaultVisible"),paginationCurrentCount:n.entangle("paginationCurrentCount"),paginationTotalItemCount:n.entangle("paginationTotalItemCount"),paginationCurrentItems:n.entangle("paginationCurrentItems"),selectedItems:n.entangle("selected"),selectAllStatus:n.entangle("selectAll"),delaySelectAll:n.entangle("delaySelectAll"),hideBulkActionsWhenEmpty:n.entangle("hideBulkActionsWhenEmpty"),toggleSelectAll(){t&&(this.paginationTotalItemCount===this.selectedItems.length?(this.clearSelected(),this.selectAllStatus=!1):this.delaySelectAll?this.setAllItemsSelected():this.setAllSelected())},setAllItemsSelected(){t&&(this.selectAllStatus=!0,this.selectAllOnPage())},setAllSelected(){t&&(this.delaySelectAll?(this.selectAllStatus=!0,this.selectAllOnPage()):n.setAllSelected())},clearSelected(){t&&(this.selectAllStatus=!1,n.clearSelected())},selectAllOnPage(){if(!t)return;let e=this.selectedItems,i=this.paginationCurrentItems.values();for(let s of i)e.push(s.toString());this.selectedItems=[...new Set(e)]}
588,destroy(){this.listeners.forEach(e=>{e()})}})),Alpine.data("reorderFunction",(n,t,e)=>({dragging:!1,reorderEnabled:!1,sourceID:"",targetID:"",evenRowClasses:"",oddRowClasses:"",currentlyHighlightedElement:"",evenRowClassArray:{},oddRowClassArray:{},evenNotInOdd:{},oddNotInEven:{},orderedRows:[],defaultReorderColumn:n.get("defaultReorderColumn"),reorderStatus:n.get("reorderStatus"),currentlyReorderingStatus:n.entangle("currentlyReorderingStatus"),hideReorderColumnUnlessReorderingStatus:n.entangle("hideReorderColumnUnlessReorderingStatus"),reorderDisplayColumn:n.entangle("reorderDisplayColumn"),dragStart(i){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.sourceID=i.target.id,i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",i.target.id),i.target.classList.add("laravel-livewire-tables-dragging")},dragOverEvent(i){typeof this.currentlyHighlightedElement=="object"&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let s=i.target.closest("tr");this.currentlyHighlightedElement=s,i.offsetY<s.getBoundingClientRect().height/2?(s.classList.add("laravel-livewire-tables-highlight-top"),s.classList.remove("laravel-livewire-tables-highlight-bottom")):(s.classList.remove("laravel-livewire-tables-highlight-top"),s.classList.add("laravel-livewire-tables-highlight-bottom"))},dragLeaveEvent(i){i.target.closest("tr").classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top")},dropEvent(i){typeof this.currentlyHighlightedElement=="object"&&this.currentlyHighlightedElement.classList.remove("laravel-livewire-tables-highlight-bottom","laravel-livewire-tables-highlight-top");let s=i.target.closest("tr"),r=i.target.closest("tr").parentNode,o=document.getElementById(this.sourceID).closest("tr");o.classList.remove("laravel-livewire-table-dragging"),o.rowIndex,s.rowIndex;let a=document.getElementById(t);i.offsetY>s.getBoundingClientRect().height/2?r.insertBefore(o,s.nextSibling):r.insertBefore(o,s);let l="even";for(let c=1,u;u=a.rows[c];c++)u.classList.contains("hidden")||u.classList.contains("md:hidden")||(l==="even"?(u.classList.remove(...this.oddNotInEven),u.classList.add(...this.evenNotInOdd),l="odd"):(u.classList.remove(...this.evenNotInOdd),u.classList.add(...this.oddNotInEven),l="even"))},reorderToggle(){this.$nextTick(()=>{this.setupEvenOddClasses()}),this.currentlyReorderingStatus?n.disableReordering():(this.setupEvenOddClasses(),this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!0),n.enableReordering())},cancelReorder(){this.hideReorderColumnUnlessReorderingStatus&&(this.reorderDisplayColumn=!1),n.disableReordering()},updateOrderedItems(){let i=document.getElementById(t),s=[];for(let r=1,o;o=i.rows[r];r++)s.push({[e]:o.getAttribute("rowpk"),[this.defaultReorderColumn]:r});n.storeReorder(s)},setupEvenOddClasses(){if(this.evenNotInOdd.length===void 0||this.evenNotInOdd.length==0||this.oddNotInEven.length===void 0||this.oddNotInEven.length==0){let i=document.getElementById(t).getElementsByTagName("tbody")[0],s=[],r=[];i.rows[0]!==void 0&&i.rows[1]!==void 0&&(s=Array.from(i.rows[0].classList),r=Array.from(i.rows[1].classList),this.evenNotInOdd=s.filter(o=>!r.includes(o)),this.oddNotInEven=r.filter(o=>!s.includes(o)),s=[],r=[])}},init(){}})),Alpine.data("filterPillsHandler",n=>({localData:n,localFilterKey:"",localFilterTitle:"",isExternalFilter:!1,shouldRenderAsHTML:!1,shouldWatchPillValues:!1,pillsSeparator:",",pillValues:null,pillHasValues:!1,displayString:"",generateLocalFilterPillImplodedValues(t){if(t!==void 0){var e,i="---tablepillsseparator---",s=RegExp(i,"g");if(e=Array.isArray(t)?t.join(i):t,this.shouldRenderAsHTML||(e=this.removeHTMLTags(e)),e!==null)return e.replace(s,this.pillsSeparator)}return""},clearExternalFilterPill(){this.isExternalFilter&&(this.externalFilterPillsVals[this.localFilterKey]=[],this.displayString=this.generateLocalFilterPillImplodedValues(this.externalFilterPillsVals[this.localFilterKey]),this.updatePillHasValues(),this.resetSpecificFilter(this.localFilterKey))},trigger:{"@filterpillupdate.window"(t){this.watchForUpdateEvent(t)}},checkEventIsValid(t,e){return this.tableName===t&&this.localFilterKey===e},watchForUpdateEvent(t){if(this.checkEventIsValid(t.detail.tableName??"",t.detail.filterKey??"")){let e=t.detail.pillItem??"";if(this.shouldRenderAsHTML||(e=this.removeHTMLTags(e)),e!="")if(this.isExternalFilter){let i=this.externalFilterPillsVals[this.localFilterKey];i.push(e),this.updatePillValues(i)}else this.updatePillValues(e)}},updatePillValues(t){return this.pillValues=t,this.displayString=this.generateLocalFilterPillImplodedValues(t),this.updatePillHasValues(),this.displayString},updatePillHasValues(){this.pillHasValues=this.displayString.length>0},init(){this.localFilterKey=this.localData.filterKey??"unknown",this.localFilterTitle=this.localData.filterPillTitle??"Unknown",this.pillsSeparator=this.localData.separator??",",this.shouldWatchPillValues=!!(this.localData.watchForEvents??0),this.isExternalFilter=!!(this.localData.isAnExternalLivewireFilter??0),this.shouldRenderAsHTML=!!(this.localData.renderPillsAsHtml??0),this.pillValues=this.localData.pillValues??null,this.$nextTick(()=>{this.isExternalFilter?this.updatePillValues(this.externalFilterPillsVals[this.localFilterKey]):this.updatePillValues(this.pillValues)}),this.isExternalFilter&&this.shouldWatchPillValues&&this.$watch("externalFilterPillsVals."+this.localFilterKey,t=>{this.updatePillValues(t)})}})),Alpine.data("tablesExternalFilter",(n,t)=>({externalFilterKey:t,pillValues:[],optionsAvailable:n.entangle("optionsAvailable"),optionsSelected:n.entangle("optionsSelected").live,selectedItems:n.entangle("selectedItems"),sendValueToPill(e){let i=this.removeHTMLTags(e);this.$dispatch("filterpillupdate",{tableName:this.tableName,filterKey:this.externalFilterKey,pillItem:i})},overridePill(e){let i=this.removeHTMLTags(e);this.$dispatch("filterpillupdate",{tableName:this.tableName,filterKey:this.externalFilterKey,pillItem:i})},syncItems(e){this.pillValues=[],e.forEach(i=>
588{this.pillValues.push(this.optionsAvailable[i])}),this.pillValues.length>0&&(this.pillValues.sort(),this.syncExternalFilterPillsValues(this.externalFilterKey,this.pillValues)),this.optionsSelected=this.selectedItems,n.set("value",this.selectedItems)},init(){this.selectedItems=this.optionsSelected,this.syncItems(this.selectedItems),this.$watch("selectedItems",e=>this.syncItems(e))}}))});
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.