recce 1.34.1__py3-none-any.whl → 1.35.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. recce/VERSION +1 -1
  2. recce/data/404/index.html +2 -2
  3. recce/data/404.html +2 -2
  4. recce/data/__next.@lineage.!KHNsb3Qp.__PAGE__.txt +2 -2
  5. recce/data/__next.@lineage.!KHNsb3Qp.txt +1 -1
  6. recce/data/__next.__PAGE__.txt +1 -1
  7. recce/data/__next._full.txt +9 -9
  8. recce/data/__next._head.txt +1 -1
  9. recce/data/__next._index.txt +5 -5
  10. recce/data/__next._tree.txt +1 -1
  11. recce/data/_next/static/chunks/0a923708f953a4d5.js +1 -0
  12. recce/data/_next/static/chunks/2001bbd020dd9677.js +1 -0
  13. recce/data/_next/static/chunks/2ca0ead49cd6e3d8.js +1 -0
  14. recce/data/_next/static/chunks/{a30fe1ec4d0d0199.js → 5aca6207265dcd75.js} +8 -8
  15. recce/data/_next/static/chunks/{b491ab151a29aba2.js → 783d6361d7afa31d.js} +11 -11
  16. recce/data/_next/static/chunks/{1bbfc841a3bbdeab.js → 8563e224cbc87121.js} +1 -1
  17. recce/data/_next/static/chunks/9b0af135176cb39a.js +72 -0
  18. recce/data/_next/static/chunks/{9469a701a796ba64.js → dd3c746dfbaa94c7.js} +2 -2
  19. recce/data/_next/static/chunks/{7bb921acbf2d3876.js → ebee0d57fc14b2aa.js} +44 -44
  20. recce/data/_next/static/chunks/{5d86ee6b69e79ebd.js → fa00228e4374d59f.js} +1 -1
  21. recce/data/_not-found/__next._full.txt +6 -6
  22. recce/data/_not-found/__next._head.txt +1 -1
  23. recce/data/_not-found/__next._index.txt +5 -5
  24. recce/data/_not-found/__next._not-found.__PAGE__.txt +1 -1
  25. recce/data/_not-found/__next._not-found.txt +1 -1
  26. recce/data/_not-found/__next._tree.txt +1 -1
  27. recce/data/_not-found/index.html +2 -2
  28. recce/data/_not-found/index.txt +6 -6
  29. recce/data/checks/__next.@lineage.__DEFAULT__.txt +2 -2
  30. recce/data/checks/__next._full.txt +12 -12
  31. recce/data/checks/__next._head.txt +1 -1
  32. recce/data/checks/__next._index.txt +5 -5
  33. recce/data/checks/__next._tree.txt +1 -1
  34. recce/data/checks/__next.checks.__PAGE__.txt +2 -2
  35. recce/data/checks/__next.checks.txt +1 -1
  36. recce/data/checks/index.html +2 -2
  37. recce/data/checks/index.txt +12 -12
  38. recce/data/index.html +2 -2
  39. recce/data/index.txt +9 -9
  40. recce/data/lineage/__next.@lineage.__DEFAULT__.txt +2 -2
  41. recce/data/lineage/__next._full.txt +9 -9
  42. recce/data/lineage/__next._head.txt +1 -1
  43. recce/data/lineage/__next._index.txt +5 -5
  44. recce/data/lineage/__next._tree.txt +1 -1
  45. recce/data/lineage/__next.lineage.__PAGE__.txt +2 -2
  46. recce/data/lineage/__next.lineage.txt +1 -1
  47. recce/data/lineage/index.html +2 -2
  48. recce/data/lineage/index.txt +9 -9
  49. recce/data/query/__next.@lineage.__DEFAULT__.txt +2 -2
  50. recce/data/query/__next._full.txt +10 -10
  51. recce/data/query/__next._head.txt +1 -1
  52. recce/data/query/__next._index.txt +5 -5
  53. recce/data/query/__next._tree.txt +1 -1
  54. recce/data/query/__next.query.__PAGE__.txt +2 -2
  55. recce/data/query/__next.query.txt +1 -1
  56. recce/data/query/index.html +2 -2
  57. recce/data/query/index.txt +10 -10
  58. {recce-1.34.1.dist-info → recce-1.35.0.dist-info}/METADATA +1 -1
  59. {recce-1.34.1.dist-info → recce-1.35.0.dist-info}/RECORD +65 -66
  60. recce/data/_next/static/chunks/1c9a95df941df4af.js +0 -1
  61. recce/data/_next/static/chunks/49dd9a35f25a3c78.js +0 -1
  62. recce/data/_next/static/chunks/55f691775a443af1.js +0 -72
  63. recce/data/_next/static/chunks/c141122216926f40.js +0 -1
  64. recce/data/_next/static/chunks/dafbfe5da3f2c3e7.js +0 -1
  65. /recce/data/_next/static/{rRopaMiU51gUmORexSTEw → zQ19NTs26n57QX8_nsBUN}/_buildManifest.js +0 -0
  66. /recce/data/_next/static/{rRopaMiU51gUmORexSTEw → zQ19NTs26n57QX8_nsBUN}/_clientMiddlewareManifest.json +0 -0
  67. /recce/data/_next/static/{rRopaMiU51gUmORexSTEw → zQ19NTs26n57QX8_nsBUN}/_ssgManifest.js +0 -0
  68. {recce-1.34.1.dist-info → recce-1.35.0.dist-info}/WHEEL +0 -0
  69. {recce-1.34.1.dist-info → recce-1.35.0.dist-info}/entry_points.txt +0 -0
  70. {recce-1.34.1.dist-info → recce-1.35.0.dist-info}/licenses/LICENSE +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,98340,e=>{"use strict";var t=e.i(600943),n=e.i(991047),r=t.createContext(void 0),i=e=>{let n=t.useContext(r);if(e)return e;if(!n)throw Error("No QueryClient set, use QueryClientProvider to set one");return n},o=({client:e,children:i})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,n.jsx)(r.Provider,{value:e,children:i}));e.s(["QueryClientProvider",()=>o,"useQueryClient",()=>i])},752036,e=>{"use strict";let t,n,r,i;var o,s,a,l,u=e.i(139507);function c(e,t){return function(){return e.apply(t,arguments)}}let{toString:h}=Object.prototype,{getPrototypeOf:d}=Object,{iterator:f,toStringTag:p}=Symbol,g=(t=Object.create(null),e=>{let n=h.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())}),m=e=>(e=e.toLowerCase(),t=>g(t)===e),v=e=>t=>typeof t===e,{isArray:y}=Array,b=v("undefined");function w(e){return null!==e&&!b(e)&&null!==e.constructor&&!b(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let x=m("ArrayBuffer"),S=v("string"),k=v("function"),_=v("number"),O=e=>null!==e&&"object"==typeof e,C=e=>{if("object"!==g(e))return!1;let t=d(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(p in e)&&!(f in e)},E=m("Date"),T=m("File"),P=m("Blob"),A=m("FileList"),R=m("URLSearchParams"),[M,I,D,L]=["ReadableStream","Request","Response","Headers"].map(m);function N(e,t,{allOwnKeys:n=!1}={}){let r,i;if(null!=e)if("object"!=typeof e&&(e=[e]),y(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{let i;if(w(e))return;let o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function B(e,t){let n;if(w(e))return null;t=t.toLowerCase();let r=Object.keys(e),i=r.length;for(;i-- >0;)if(t===(n=r[i]).toLowerCase())return n;return null}let F="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g,j=e=>!b(e)&&e!==F,U=(n="u">typeof Uint8Array&&d(Uint8Array),e=>n&&e instanceof n),q=m("HTMLFormElement"),W=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),z=m("RegExp"),V=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};N(n,(n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)}),Object.defineProperties(e,r)},H=m("AsyncFunction"),Q=(o="function"==typeof setImmediate,s=k(F.postMessage),o?setImmediate:s?(a=`axios@${Math.random()}`,l=[],F.addEventListener("message",({source:e,data:t})=>{e===F&&t===a&&l.length&&l.shift()()},!1),e=>{l.push(e),F.postMessage(a,"*")}):e=>setTimeout(e)),$="u">typeof queueMicrotask?queueMicrotask.bind(F):void 0!==u.default&&u.default.nextTick||Q,K={isArray:y,isArrayBuffer:x,isBuffer:w,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||k(e.append)&&("formdata"===(t=g(e))||"object"===t&&k(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&x(e.buffer)},isString:S,isNumber:_,isBoolean:e=>!0===e||!1===e,isObject:O,isPlainObject:C,isEmptyObject:e=>{if(!O(e)||w(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:M,isRequest:I,isResponse:D,isHeaders:L,isUndefined:b,isDate:E,isFile:T,isBlob:P,isRegExp:z,isFunction:k,isStream:e=>O(e)&&k(e.pipe),isURLSearchParams:R,isTypedArray:U,isFileList:A,forEach:N,merge:function e(){let{caseless:t,skipUndefined:n}=j(this)&&this||{},r={},i=(i,o)=>{let s=t&&B(r,o)||o;C(r[s])&&C(i)?r[s]=e(r[s],i):C(i)?r[s]=e({},i):y(i)?r[s]=i.slice():n&&b(i)||(r[s]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&N(arguments[e],i);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(N(t,(t,r)=>{n&&k(t)?Object.defineProperty(e,r,{value:c(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s,a={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=!1!==n&&d(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype)return t},kindOf:g,kindOfTest:m,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return -1!==r&&r===n},toArray:e=>{if(!e)return null;if(y(e))return e;let t=e.length;if(!_(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{let n,r=(e&&e[f]).call(e);for(;(n=r.next())&&!n.done;){let r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let n,r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:q,hasOwnProperty:W,hasOwnProp:W,reduceDescriptors:V,freezeMethods:e=>{V(e,(t,n)=>{if(k(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;if(k(e[n])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{let n={};return(y(e)?e:String(e).split(t)).forEach(e=>{n[e]=!0}),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:B,global:F,isContextDefined:j,isSpecCompliantForm:function(e){return!!(e&&k(e.append)&&"FormData"===e[p]&&e[f])},toJSONObject:e=>{let t=Array(10),n=(e,r)=>{if(O(e)){if(t.indexOf(e)>=0)return;if(w(e))return e;if(!("toJSON"in e)){t[r]=e;let i=y(e)?[]:{};return N(e,(e,t)=>{let o=n(e,r+1);b(o)||(i[t]=o)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:H,isThenable:e=>e&&(O(e)||k(e))&&k(e.then)&&k(e.catch),setImmediate:Q,asap:$,isIterable:e=>null!=e&&k(e[f])};var X=e.i(768072);class G extends Error{static from(e,t,n,r,i,o){let s=new G(e.message,t||e.code,n,r,i);return s.cause=e,s.name=e.name,o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){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:K.toJSONObject(this.config),code:this.code,status:this.status}}}G.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",G.ERR_BAD_OPTION="ERR_BAD_OPTION",G.ECONNABORTED="ECONNABORTED",G.ETIMEDOUT="ETIMEDOUT",G.ERR_NETWORK="ERR_NETWORK",G.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",G.ERR_DEPRECATED="ERR_DEPRECATED",G.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",G.ERR_BAD_REQUEST="ERR_BAD_REQUEST",G.ERR_CANCELED="ERR_CANCELED",G.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",G.ERR_INVALID_URL="ERR_INVALID_URL";let Z=G;function Y(e){return K.isPlainObject(e)||K.isArray(e)}function J(e){return K.endsWith(e,"[]")?e.slice(0,-2):e}function ee(e,t,n){return e?e.concat(t).map(function(e,t){return e=J(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}let et=K.toFlatObject(K,{},null,function(e){return/^is[A-Z]/.test(e)}),en=function(e,t,n){if(!K.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let r=(n=K.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!K.isUndefined(t[e])})).metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||"u">typeof Blob&&Blob)&&K.isSpecCompliantForm(t);if(!K.isFunction(i))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(K.isDate(e))return e.toISOString();if(K.isBoolean(e))return e.toString();if(!a&&K.isBlob(e))throw new Z("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(e)||K.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):X.Buffer.from(e):e}function u(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(K.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else{var u;if(K.isArray(e)&&(u=e,K.isArray(u)&&!u.some(Y))||(K.isFileList(e)||K.endsWith(n,"[]"))&&(a=K.toArray(e)))return n=J(n),a.forEach(function(e,r){K.isUndefined(e)||null===e||t.append(!0===s?ee([n],r,o):null===s?n:n+"[]",l(e))}),!1}return!!Y(e)||(t.append(ee(i,n,o),l(e)),!1)}let c=[],h=Object.assign(et,{defaultVisitor:u,convertValue:l,isVisitable:Y});if(!K.isObject(e))throw TypeError("data must be an object");return!function e(n,r){if(!K.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),K.forEach(n,function(n,o){!0===(!(K.isUndefined(n)||null===n)&&i.call(t,n,K.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])}),c.pop()}}(e),t};function er(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function ei(e,t){this._pairs=[],e&&en(e,this,t)}let eo=ei.prototype;function es(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ea(e,t,n){let r;if(!t)return e;let i=n&&n.encode||es,o=K.isFunction(n)?{serialize:n}:n,s=o&&o.serialize;if(r=s?s(t,o):K.isURLSearchParams(t)?t.toString():new ei(t,o).toString(i)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}eo.append=function(e,t){this._pairs.push([e,t])},eo.toString=function(e){let t=e?function(t){return e.call(this,t,er)}:er;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let el=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){K.forEach(this.handlers,function(t){null!==t&&e(t)})}},eu={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ec="u">typeof URLSearchParams?URLSearchParams:ei,eh="u">typeof FormData?FormData:null,ed="u">typeof Blob?Blob:null,ef="u">typeof window&&"u">typeof document,ep="object"==typeof navigator&&navigator||void 0,eg=ef&&(!ep||0>["ReactNative","NativeScript","NS"].indexOf(ep.product)),em="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ev=ef&&window.location.href||"http://localhost";e.s(["hasBrowserEnv",()=>ef,"hasStandardBrowserEnv",()=>eg,"hasStandardBrowserWebWorkerEnv",()=>em,"navigator",()=>ep,"origin",()=>ev],38892);let ey={...e.i(38892),isBrowser:!0,classes:{URLSearchParams:ec,FormData:eh,Blob:ed},protocols:["http","https","file","blob","url","data"]},eb=function(e){if(K.isFormData(e)&&K.isFunction(e.entries)){let t={};return K.forEachEntry(e,(e,n)=>{!function e(t,n,r,i){let o=t[i++];if("__proto__"===o)return!0;let s=Number.isFinite(+o),a=i>=t.length;return(o=!o&&K.isArray(r)?r.length:o,a)?K.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n:(r[o]&&K.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&K.isArray(r[o])&&(r[o]=function(e){let t,n,r={},i=Object.keys(e),o=i.length;for(t=0;t<o;t++)r[n=i[t]]=e[n];return r}(r[o]))),!s}(K.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),n,t,0)}),t}return null},ew={transitional:eu,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let n,r=t.getContentType()||"",i=r.indexOf("application/json")>-1,o=K.isObject(e);if(o&&K.isHTMLForm(e)&&(e=new FormData(e)),K.isFormData(e))return i?JSON.stringify(eb(e)):e;if(K.isArrayBuffer(e)||K.isBuffer(e)||K.isStream(e)||K.isFile(e)||K.isBlob(e)||K.isReadableStream(e))return e;if(K.isArrayBufferView(e))return e.buffer;if(K.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1){var s,a;return(s=e,a=this.formSerializer,en(s,new ey.classes.URLSearchParams,{visitor:function(e,t,n,r){return ey.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...a})).toString()}if((n=K.isFileList(e))||r.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return en(n?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(o||i){t.setContentType("application/json",!1);var l=e;if(K.isString(l))try{return(0,JSON.parse)(l),K.trim(l)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(l)}return e}],transformResponse:[function(e){let t=this.transitional||ew.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(K.isResponse(e)||K.isReadableStream(e))return e;if(e&&K.isString(e)&&(n&&!this.responseType||r)){let n=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}catch(e){if(!n&&r){if("SyntaxError"===e.name)throw Z.from(e,Z.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ey.classes.FormData,Blob:ey.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],e=>{ew.headers[e]={}});let ex=K.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"]),eS=Symbol("internals");function ek(e){return e&&String(e).trim().toLowerCase()}function e_(e){return!1===e||null==e?e:K.isArray(e)?e.map(e_):String(e)}function eO(e,t,n,r,i){if(K.isFunction(r))return r.call(this,t,n);if(i&&(t=n),K.isString(t)){if(K.isString(r))return -1!==t.indexOf(r);if(K.isRegExp(r))return r.test(t)}}class eC{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=ek(t);if(!i)throw Error("header name must be a non-empty string");let o=K.findKey(r,i);o&&void 0!==r[o]&&!0!==n&&(void 0!==n||!1===r[o])||(r[o||t]=e_(e))}let o=(e,t)=>K.forEach(e,(e,n)=>i(e,n,t));if(K.isPlainObject(e)||e instanceof this.constructor)o(e,t);else{let r;if(K.isString(e)&&(e=e.trim())&&(r=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var s;let n,r,i,a;o((a={},(s=e)&&s.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||a[n]&&ex[n]||("set-cookie"===n?a[n]?a[n].push(r):a[n]=[r]:a[n]=a[n]?a[n]+", "+r:r)}),a),t)}else if(K.isObject(e)&&K.isIterable(e)){let n={},r,i;for(let t of e){if(!K.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(r=n[i])?K.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(n,t)}else null!=e&&i(t,e,n)}return this}get(e,t){if(e=ek(e)){let n=K.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(!0===t){let t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=r.exec(e);)n[t[1]]=t[2];return n}if(K.isFunction(t))return t.call(this,e,n);if(K.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ek(e)){let n=K.findKey(this,e);return!!(n&&void 0!==this[n]&&(!t||eO(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=ek(e)){let i=K.findKey(n,e);i&&(!t||eO(n,n[i],i,t))&&(delete n[i],r=!0)}}return K.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||eO(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return K.forEach(this,(r,i)=>{let o=K.findKey(n,i);if(o){t[o]=e_(r),delete t[i];return}let s=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n):String(i).trim();s!==i&&delete t[i],t[s]=e_(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return K.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&K.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[eS]=this[eS]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=ek(e);if(!t[r]){let i;i=K.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(n,t+i,{value:function(n,r,i){return this[t].call(this,e,n,r,i)},configurable:!0})}),t[r]=!0}}return K.isArray(e)?e.forEach(r):r(e),this}}function eE(e,t){let n=this||ew,r=t||n,i=eC.from(r.headers),o=r.data;return K.forEach(e,function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function eT(e){return!!(e&&e.__CANCEL__)}eC.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(eC.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),K.freezeMethods(eC);let eP=class extends Z{constructor(e,t,n){super(null==e?"canceled":e,Z.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function eA(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Z("Request failed with status code "+n.status,[Z.ERR_BAD_REQUEST,Z.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}let eR=function(e,t){let n,r=Array(e=e||10),i=Array(e),o=0,s=0;return t=void 0!==t?t:1e3,function(a){let l=Date.now(),u=i[s];n||(n=l),r[o]=a,i[o]=l;let c=s,h=0;for(;c!==o;)h+=r[c++],c%=e;if((o=(o+1)%e)===s&&(s=(s+1)%e),l-n<t)return;let d=u&&l-u;return d?Math.round(1e3*h/d):void 0}},eM=function(e,t){let n,r,i=0,o=1e3/t,s=(t,o=Date.now())=>{i=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{let t=Date.now(),a=t-i;a>=o?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},o-a)))},()=>n&&s(n)]},eI=(e,t,n=3)=>{let r=0,i=eR(50,250);return eM(n=>{let o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-r,l=i(a);r=o,e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&o<=s?(s-o)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},eD=(e,t)=>{let n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},eL=e=>(...t)=>K.asap(()=>e(...t)),eN=ey.hasStandardBrowserEnv?(r=new URL(ey.origin),i=ey.navigator&&/(msie|trident)/i.test(ey.navigator.userAgent),e=>(e=new URL(e,ey.origin),r.protocol===e.protocol&&r.host===e.host&&(i||r.port===e.port))):()=>!0,eB=ey.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if("u"<typeof document)return;let a=[`${e}=${encodeURIComponent(t)}`];K.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),K.isString(r)&&a.push(`path=${r}`),K.isString(i)&&a.push(`domain=${i}`),!0===o&&a.push("secure"),K.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function eF(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||!1==n)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let ej=e=>e instanceof eC?{...e}:e;function eU(e,t){t=t||{};let n={};function r(e,t,n,r){return K.isPlainObject(e)&&K.isPlainObject(t)?K.merge.call({caseless:r},e,t):K.isPlainObject(t)?K.merge({},t):K.isArray(t)?t.slice():t}function i(e,t,n,i){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e,n,i):r(e,t,n,i)}function o(e,t){if(!K.isUndefined(t))return r(void 0,t)}function s(e,t){return K.isUndefined(t)?K.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}let l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>i(ej(e),ej(t),n,!0)};return K.forEach(Object.keys({...e,...t}),function(r){let o=l[r]||i,s=o(e[r],t[r],r);K.isUndefined(s)&&o!==a||(n[r]=s)}),n}let eq=e=>{let t=eU({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=eC.from(s),t.url=ea(eF(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),K.isFormData(n)){if(ey.hasStandardBrowserEnv||ey.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(K.isFunction(n.getHeaders)){let e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}}if(ey.hasStandardBrowserEnv&&(r&&K.isFunction(r)&&(r=r(t)),r||!1!==r&&eN(t.url))){let e=i&&o&&eB.read(o);e&&s.set(i,e)}return t},eW="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){var r;let i,o,s,a,l,u,c=eq(e),h=c.data,d=eC.from(c.headers).normalize(),{responseType:f,onUploadProgress:p,onDownloadProgress:g}=c;function m(){a&&a(),l&&l(),c.cancelToken&&c.cancelToken.unsubscribe(i),c.signal&&c.signal.removeEventListener("abort",i)}let v=new XMLHttpRequest;function y(){if(!v)return;let r=eC.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());eA(function(e){t(e),m()},function(e){n(e),m()},{data:f&&"text"!==f&&"json"!==f?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:r,config:e,request:v}),v=null}v.open(c.method.toUpperCase(),c.url,!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||4!==v.readyState||(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(y)},v.onabort=function(){v&&(n(new Z("Request aborted",Z.ECONNABORTED,e,v)),v=null)},v.onerror=function(t){let r=new Z(t&&t.message?t.message:"Network Error",Z.ERR_NETWORK,e,v);r.event=t||null,n(r),v=null},v.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||eu;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new Z(t,r.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,v)),v=null},void 0===h&&d.setContentType(null),"setRequestHeader"in v&&K.forEach(d.toJSON(),function(e,t){v.setRequestHeader(t,e)}),K.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),f&&"json"!==f&&(v.responseType=c.responseType),g&&([s,l]=eI(g,!0),v.addEventListener("progress",s)),p&&v.upload&&([o,a]=eI(p),v.upload.addEventListener("progress",o),v.upload.addEventListener("loadend",a)),(c.cancelToken||c.signal)&&(i=t=>{v&&(n(!t||t.type?new eP(null,e,v):t),v.abort(),v=null)},c.cancelToken&&c.cancelToken.subscribe(i),c.signal&&(c.signal.aborted?i():c.signal.addEventListener("abort",i)));let b=(r=c.url,(u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r))&&u[1]||"");b&&-1===ey.protocols.indexOf(b)?n(new Z("Unsupported protocol "+b+":",Z.ERR_BAD_REQUEST,e)):v.send(h||null)})},ez=function*(e,t){let n,r=e.byteLength;if(!t||r<t)return void(yield e);let i=0;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},eV=async function*(e,t){for await(let n of eH(e))yield*ez(n,t)},eH=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},eQ=(e,t,n,r)=>{let i,o=eV(e,t),s=0,a=e=>{!i&&(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await o.next();if(t){a(),e.close();return}let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:e$}=K,eK=(({Request:e,Response:t})=>({Request:e,Response:t}))(K.global),{ReadableStream:eX,TextEncoder:eG}=K.global,eZ=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},eY=e=>{let t,{fetch:n,Request:r,Response:i}=e=K.merge.call({skipUndefined:!0},eK,e),o=n?e$(n):"function"==typeof fetch,s=e$(r),a=e$(i);if(!o)return!1;let l=o&&e$(eX),u=o&&("function"==typeof eG?(t=new eG,e=>t.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer())),c=s&&l&&eZ(()=>{let e=!1,t=new r(ey.origin,{body:new eX,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=a&&l&&eZ(()=>K.isReadableStream(new i("").body)),d={stream:h&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{d[e]||(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Z(`Response type '${e}' is not supported`,Z.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(null==e)return 0;if(K.isBlob(e))return e.size;if(K.isSpecCompliantForm(e)){let t=new r(ey.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return K.isArrayBufferView(e)||K.isArrayBuffer(e)?e.byteLength:(K.isURLSearchParams(e)&&(e+=""),K.isString(e))?(await u(e)).byteLength:void 0},p=async(e,t)=>{let n=K.toFiniteNumber(e.getContentLength());return null==n?f(t):n};return async e=>{let t,{url:o,method:a,data:l,signal:u,cancelToken:f,timeout:g,onDownloadProgress:m,onUploadProgress:v,responseType:y,headers:b,withCredentials:w="same-origin",fetchOptions:x}=eq(e),S=n||fetch;y=y?(y+"").toLowerCase():"text";let k=((e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController,i=function(e){if(!n){n=!0,s();let t=e instanceof Error?e:this.reason;r.abort(t instanceof Z?t:new eP(t instanceof Error?t.message:t))}},o=t&&setTimeout(()=>{o=null,i(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t),s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));let{signal:a}=r;return a.unsubscribe=()=>K.asap(s),a}})([u,f&&f.toAbortSignal()],g),_=null,O=k&&k.unsubscribe&&(()=>{k.unsubscribe()});try{if(v&&c&&"get"!==a&&"head"!==a&&0!==(t=await p(b,l))){let e,n=new r(o,{method:"POST",body:l,duplex:"half"});if(K.isFormData(l)&&(e=n.headers.get("content-type"))&&b.setContentType(e),n.body){let[e,r]=eD(t,eI(eL(v)));l=eQ(n.body,65536,e,r)}}K.isString(w)||(w=w?"include":"omit");let n=s&&"credentials"in r.prototype,u={...x,signal:k,method:a.toUpperCase(),headers:b.normalize().toJSON(),body:l,duplex:"half",credentials:n?w:void 0};_=s&&new r(o,u);let f=await (s?S(_,x):S(o,u)),g=h&&("stream"===y||"response"===y);if(h&&(m||g&&O)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=f[t]});let t=K.toFiniteNumber(f.headers.get("content-length")),[n,r]=m&&eD(t,eI(eL(m),!0))||[];f=new i(eQ(f.body,65536,n,()=>{r&&r(),O&&O()}),e)}y=y||"text";let C=await d[K.findKey(d,y)||"text"](f,e);return!g&&O&&O(),await new Promise((t,n)=>{eA(t,n,{data:C,headers:eC.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:_})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Z("Network Error",Z.ERR_NETWORK,e,_),{cause:t.cause||t});throw Z.from(t,t&&t.code,e,_)}}},eJ=new Map,e0=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,o=[r,i,n],s=o.length,a,l,u=eJ;for(;s--;)a=o[s],void 0===(l=u.get(a))&&u.set(a,l=s?new Map:eY(t)),u=l;return l};e0();let e1={http:null,xhr:eW,fetch:{get:e0}};K.forEach(e1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e2=e=>`- ${e}`,e3=e=>K.isFunction(e)||null===e||!1===e,e4=function(e,t){let n,r,{length:i}=e=K.isArray(e)?e:[e],o={};for(let s=0;s<i;s++){let i;if(r=n=e[s],!e3(n)&&void 0===(r=e1[(i=String(n)).toLowerCase()]))throw new Z(`Unknown adapter '${i}'`);if(r&&(K.isFunction(r)||(r=r.get(t))))break;o[i||"#"+s]=r}if(!r){let e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Z("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(e2).join("\n"):" "+e2(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function e8(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eP(null,e)}function e6(e){return e8(e),e.headers=eC.from(e.headers),e.data=eE.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),e4(e.adapter||ew.adapter,e)(e).then(function(t){return e8(e),t.data=eE.call(e,e.transformResponse,t),t.headers=eC.from(t.headers),t},function(t){return!eT(t)&&(e8(e),t&&t.response&&(t.response.data=eE.call(e,e.transformResponse,t.response),t.response.headers=eC.from(t.response.headers))),Promise.reject(t)})}let e5="1.13.3",e9={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{e9[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});let e7={};e9.transitional=function(e,t,n){function r(e,t){return"[Axios v"+e5+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new Z(r(i," has been removed"+(t?" in "+t:"")),Z.ERR_DEPRECATED);return t&&!e7[i]&&(e7[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}},e9.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};let te=function(e,t,n){if("object"!=typeof e)throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let o=r[i],s=t[o];if(s){let t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new Z("option "+o+" must be "+n,Z.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Z("Unknown option "+o,Z.ERR_BAD_OPTION)}};class tt{constructor(e){this.defaults=e||{},this.interceptors={request:new el,response:new el}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){let n,r;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:o,headers:s}=t=eU(this.defaults,t);void 0!==i&&te(i,{silentJSONParsing:e9.transitional(e9.boolean),forcedJSONParsing:e9.transitional(e9.boolean),clarifyTimeoutError:e9.transitional(e9.boolean)},!1),null!=o&&(K.isFunction(o)?t.paramsSerializer={serialize:o}:te(o,{encode:e9.function,serialize:e9.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),te(t,{baseUrl:e9.spelling("baseURL"),withXsrfToken:e9.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&K.merge(s.common,s[t.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=eC.concat(a,s);let l=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let h=0;if(!u){let e=[e6.bind(this),void 0];e.unshift(...l),e.push(...c),r=e.length,n=Promise.resolve(t);let i=t;for(;h<r;)n=n.then(e[h++]).then(e=>{i=void 0!==e?e:i}).catch(e[h++]).then(()=>i);return n}r=l.length;let d=t;for(;h<r;){let e=l[h++],t=l[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{n=e6.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,r=c.length;h<r;)n=n.then(c[h++]).catch(c[h++]);return n}getUri(e){return ea(eF((e=eU(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}K.forEach(["delete","get","head","options"],function(e){tt.prototype[e]=function(t,n){return this.request(eU(n||{},{method:e,url:t,data:(n||{}).data}))}}),K.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(eU(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}tt.prototype[e]=t(),tt.prototype[e+"Form"]=t(!0)});class tn{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new eP(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new tn(function(t){e=t}),cancel:e}}}let tr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent: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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tr).forEach(([e,t])=>{tr[t]=e});let ti=function e(t){let n=new tt(t),r=c(tt.prototype.request,n);return K.extend(r,tt.prototype,n,{allOwnKeys:!0}),K.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(eU(t,n))},r}(ew);ti.Axios=tt,ti.CanceledError=eP,ti.CancelToken=tn,ti.isCancel=eT,ti.VERSION=e5,ti.toFormData=en,ti.AxiosError=Z,ti.Cancel=ti.CanceledError,ti.all=function(e){return Promise.all(e)},ti.spread=function(e){return function(t){return e.apply(null,t)}},ti.isAxiosError=function(e){return K.isObject(e)&&!0===e.isAxiosError},ti.mergeConfig=eU,ti.AxiosHeaders=eC,ti.formToJSON=e=>eb(K.isHTMLForm(e)?new FormData(e):e),ti.getAdapter=e4,ti.HttpStatusCode=tr,ti.default=ti,e.s(["default",0,ti],752036)},987562,e=>{"use strict";var t=e.i(991047),n=e.i(752036),r=e.i(600943);let i=(0,r.createContext)(null);function o(){return(0,r.useContext)(i)}function s(){return function(){let e=(0,r.useContext)(i);if(!e)throw Error("useApiConfig must be used within RecceProvider");return e}().apiClient}function a({children:e,config:o}){let s,a,l,u="client"in o,c=u?o.client:null,h=u?o.baseUrl??"":o.baseUrl,d=u?void 0:o.timeout,f=u?void 0:o.headers,p=o.apiPrefix??"",g=o.authToken,m=(s=(0,r.useRef)(f),a=(0,r.useRef)(f?JSON.stringify(f):""),(l=f?JSON.stringify(f):"")!==a.current&&(s.current=f,a.current=l),s.current),v=(0,r.useMemo)(()=>{var e;let t;return c?c:(e=d??3e4,t=n.default.create({baseURL:h,headers:m,timeout:e}),(p||g)&&t.interceptors.request.use(e=>{try{return p&&e.url&&("/api"===e.url?e.url=p:e.url.startsWith("/api/")&&(e.url=p+e.url.slice(4))),g&&(e.headers.Authorization=`Bearer ${g}`),e}catch(t){return console.warn("API request interceptor error, proceeding with unmodified request:",t),e}},e=>Promise.reject(e)),t)},[c,h,p,g,m,d]),y=(0,r.useMemo)(()=>({apiClient:v,apiPrefix:p,authToken:g,baseUrl:h}),[v,p,g,h]);return(0,t.jsx)(i.Provider,{value:y,children:e})}i.displayName="RecceApiContext",e.s(["ApiProvider",()=>a,"useApiClient",()=>s,"useApiConfigOptional",()=>o])},578889,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},305763,e=>{"use strict";var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},n=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function r(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>r,"timeoutManager",()=>n])},766271,e=>{"use strict";var t=e.i(305763),n="u"<typeof window||"Deno"in globalThis;function r(){}function i(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function a(e,t){return"function"==typeof e?e(t):e}function l(e,t){return"function"==typeof e?e(t):e}function u(e,t){let{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==h(s,t.options))return!1}else if(!f(t.queryKey,s))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!i||i===t.state.fetchStatus)&&(!o||!!o(t))}function c(e,t){let{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(d(t.options.mutationKey)!==d(o))return!1}else if(!f(t.options.mutationKey,o))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function h(e,t){return(t?.queryKeyHashFn||d)(e)}function d(e){return JSON.stringify(e,(e,t)=>v(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function f(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(n=>f(e[n],t[n]))}var p=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function m(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function v(e){if(!y(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!y(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return new Promise(n=>{t.timeoutManager.setTimeout(n,e)})}function w(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?function e(t,n,r=0){if(t===n)return t;if(r>500)return n;let i=m(t)&&m(n);if(!i&&!(v(t)&&v(n)))return n;let o=(i?t:Object.keys(t)).length,s=i?n:Object.keys(n),a=s.length,l=i?Array(a):{},u=0;for(let c=0;c<a;c++){let a=i?c:s[c],h=t[a],d=n[a];if(h===d){l[a]=h,(i?c<o:p.call(t,a))&&u++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){l[a]=d;continue}let f=e(h,d,r+1);l[a]=f,f===h&&u++}return o===a&&u===o?t:l}(e,t):t}function x(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function S(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var k=Symbol();function _(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==k?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function O(e,t){return"function"==typeof e?e(...t):!!e}function C(e,t,n){let r,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),e}e.s(["addConsumeAwareSignal",()=>C,"addToEnd",()=>x,"addToStart",()=>S,"ensureQueryFn",()=>_,"functionalUpdate",()=>i,"hashKey",()=>d,"hashQueryKeyByOptions",()=>h,"isServer",()=>n,"isValidTimeout",()=>o,"matchMutation",()=>c,"matchQuery",()=>u,"noop",()=>r,"partialMatchKey",()=>f,"replaceData",()=>w,"resolveEnabled",()=>l,"resolveStaleTime",()=>a,"shallowEqualObjects",()=>g,"shouldThrowError",()=>O,"skipToken",()=>k,"sleep",()=>b,"timeUntilStale",()=>s])},82679,e=>{"use strict";var t=e.i(578889),n=e.i(766271),r=new class extends t.Subscribable{#n;#r;#i;constructor(){super(),this.#i=e=>{if(!n.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#i=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>r])},259864,e=>{"use strict";let t,n,r,i,o,s;var a=e.i(305763).systemSetTimeoutZero,l=(t=[],n=0,r=e=>{e()},i=e=>{e()},o=a,{batch:e=>{let s;n++;try{s=e()}finally{let e;--n||(e=t,t=[],e.length&&o(()=>{i(()=>{e.forEach(e=>{r(e)})})}))}return s},batchCalls:e=>(...t)=>{s(()=>{e(...t)})},schedule:s=e=>{n?t.push(e):o(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{o=e}});e.s(["notifyManager",()=>l])},313805,60045,757142,e=>{"use strict";var t=e.i(82679),n=e.i(578889),r=e.i(766271),i=new class extends n.Subscribable{#o=!0;#r;#i;constructor(){super(),this.#i=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#i=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#o!==e&&(this.#o=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#o}};function o(){let e,t,n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function s(e){return Math.min(1e3*2**e,3e4)}function a(e){return(e??"online")!=="online"||i.isOnline()}e.s(["onlineManager",()=>i],60045),e.s(["pendingThenable",()=>o],757142);var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function u(e){let n,u=!1,c=0,h=o(),d=()=>t.focusManager.isFocused()&&("always"===e.networkMode||i.isOnline())&&e.canRun(),f=()=>a(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(n?.(),h.resolve(e))},g=e=>{"pending"===h.status&&(n?.(),h.reject(e))},m=()=>new Promise(t=>{n=e=>{("pending"!==h.status||d())&&t(e)},e.onPause?.()}).then(()=>{n=void 0,"pending"===h.status&&e.onContinue?.()}),v=()=>{let t;if("pending"!==h.status)return;let n=0===c?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if("pending"!==h.status)return;let n=e.retry??3*!r.isServer,i=e.retryDelay??s,o="function"==typeof i?i(c,t):i,a=!0===n||"number"==typeof n&&c<n||"function"==typeof n&&n(c,t);u||!a?g(t):(c++,e.onFail?.(c,t),(0,r.sleep)(o).then(()=>d()?void 0:m()).then(()=>{u?g(t):v()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let n=new l(t);g(n),e.onCancel?.(n)}},continue:()=>(n?.(),h),cancelRetry:()=>{u=!0},continueRetry:()=>{u=!1},canStart:f,start:()=>(f()?v():m().then(v),h)}}e.s(["CancelledError",()=>l,"canFetch",()=>a,"createRetryer",()=>u],313805)},539392,e=>{"use strict";var t=e.i(305763),n=e.i(766271),r=class{#s;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.isValidTimeout)(this.gcTime)&&(this.#s=t.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.isServer?1/0:3e5))}clearGcTimeout(){this.#s&&(t.timeoutManager.clearTimeout(this.#s),this.#s=void 0)}};e.s(["Removable",()=>r])},414822,959243,e=>{"use strict";var t=e.i(82679),n=e.i(259864);e.i(139507);var r=e.i(766271),i=e.i(313805),o=e.i(539392),s=class extends o.Removable{#a;#l;#u;#c;#h;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=u(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=u(this.options);void 0!==e.data&&(this.setState(l(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){let n=(0,r.replaceData)(this.state.data,e,this.options);return this.#p({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(r.noop).catch(r.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==(0,r.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===r.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,r.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,r.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#f?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,t){let n;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let o=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,o.signal)})},a=()=>{let e,n=(0,r.ensureQueryFn)(this.options,t),i=(s(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#f=!1,this.options.persister)?this.options.persister(n,i,this):n(i)},l=(s(n={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),n);this.options.behavior?.onFetch(l,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#p({type:"fetch",meta:l.fetchOptions?.meta}),this.#h=(0,i.createRetryer)({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:e=>{e instanceof i.CancelledError&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),o.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof i.CancelledError){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...a(t.data,this.options),fetchMeta:e.meta??null};case"success":let n={...t,...l(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?n:void 0,n;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),n.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function a(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,i.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function l(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>s,"fetchState",()=>a],959243);var c=e.i(578889),h=e.i(757142),d=e.i(305763),f=class extends c.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#g=null,this.#m=(0,h.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#v=void 0;#y=void 0;#b=void 0;#w;#x;#m;#g;#S;#k;#_;#O;#C;#E;#T=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#v.addObserver(this),p(this.#v,this.options)?this.#P():this.updateResult(),this.#A())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return g(this.#v,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return g(this.#v,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#M(),this.#v.removeObserver(this)}setOptions(e){let t=this.options,n=this.#v;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,r.resolveEnabled)(this.options.enabled,this.#v))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#I(),this.#v.setOptions(this.options),t._defaulted&&!(0,r.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#v,observer:this});let i=this.hasListeners();i&&m(this.#v,n,this.options,t)&&this.#P(),this.updateResult(),i&&(this.#v!==n||(0,r.resolveEnabled)(this.options.enabled,this.#v)!==(0,r.resolveEnabled)(t.enabled,this.#v)||(0,r.resolveStaleTime)(this.options.staleTime,this.#v)!==(0,r.resolveStaleTime)(t.staleTime,this.#v))&&this.#D();let o=this.#L();i&&(this.#v!==n||(0,r.resolveEnabled)(this.options.enabled,this.#v)!==(0,r.resolveEnabled)(t.enabled,this.#v)||o!==this.#E)&&this.#N(o)}getOptimisticResult(e){var t,n;let i=this.#c.getQueryCache().build(this.#c,e),o=this.createResult(i,e);return t=this,n=o,(0,r.shallowEqualObjects)(t.getCurrentResult(),n)||(this.#b=o,this.#x=this.options,this.#w=this.#v.state),o}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#m.status||this.#m.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#T.add(e)}getCurrentQuery(){return this.#v}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),n=this.#c.getQueryCache().build(this.#c,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#P({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#P(e){this.#I();let t=this.#v.fetch(this.options,e);return e?.throwOnError||(t=t.catch(r.noop)),t}#D(){this.#R();let e=(0,r.resolveStaleTime)(this.options.staleTime,this.#v);if(r.isServer||this.#b.isStale||!(0,r.isValidTimeout)(e))return;let t=(0,r.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#O=d.timeoutManager.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#L(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#v):this.options.refetchInterval)??!1}#N(e){this.#M(),this.#E=e,!r.isServer&&!1!==(0,r.resolveEnabled)(this.options.enabled,this.#v)&&(0,r.isValidTimeout)(this.#E)&&0!==this.#E&&(this.#C=d.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||t.focusManager.isFocused())&&this.#P()},this.#E))}#A(){this.#D(),this.#N(this.#L())}#R(){this.#O&&(d.timeoutManager.clearTimeout(this.#O),this.#O=void 0)}#M(){this.#C&&(d.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let n,i=this.#v,o=this.options,s=this.#b,l=this.#w,u=this.#x,c=e!==i?e.state:this.#y,{state:d}=e,f={...d},g=!1;if(t._optimisticResults){let n=this.hasListeners(),r=!n&&p(e,t),s=n&&m(e,i,t,o);(r||s)&&(f={...f,...a(d.data,e.options)}),"isRestoring"===t._optimisticResults&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:w}=f;n=f.data;let x=!1;if(void 0!==t.placeholderData&&void 0===n&&"pending"===w){let e;s?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(e=s.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#_?.state.data,this.#_):t.placeholderData,void 0!==e&&(w="success",n=(0,r.replaceData)(s?.data,e,t),g=!0)}if(t.select&&void 0!==n&&!x)if(s&&n===l?.data&&t.select===this.#S)n=this.#k;else try{this.#S=t.select,n=t.select(n),n=(0,r.replaceData)(s?.data,n,t),this.#k=n,this.#g=null}catch(e){this.#g=e}this.#g&&(y=this.#g,n=this.#k,b=Date.now(),w="error");let S="fetching"===f.fetchStatus,k="pending"===w,_="error"===w,O=k&&S,C=void 0!==n,E={status:w,fetchStatus:f.fetchStatus,isPending:k,isSuccess:"success"===w,isError:_,isInitialLoading:O,isLoading:O,data:n,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:S,isRefetching:S&&!k,isLoadingError:_&&!C,isPaused:"paused"===f.fetchStatus,isPlaceholderData:g,isRefetchError:_&&C,isStale:v(e,t),refetch:this.refetch,promise:this.#m,isEnabled:!1!==(0,r.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==E.data,n="error"===E.status&&!t,r=e=>{n?e.reject(E.error):t&&e.resolve(E.data)},o=()=>{r(this.#m=E.promise=(0,h.pendingThenable)())},s=this.#m;switch(s.status){case"pending":e.queryHash===i.queryHash&&r(s);break;case"fulfilled":(n||E.data!==s.value)&&o();break;case"rejected":n&&E.error===s.reason||o()}}return E}updateResult(){let e=this.#b,t=this.createResult(this.#v,this.options);if(this.#w=this.#v.state,this.#x=this.options,void 0!==this.#w.data&&(this.#_=this.#v),(0,r.shallowEqualObjects)(t,e))return;this.#b=t;let n=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#T.size)return!0;let r=new Set(n??this.#T);return this.options.throwOnError&&r.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&r.has(t))};this.#B({listeners:n()})}#I(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#v)return;let t=this.#v;this.#v=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#A()}#B(e){n.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#v,type:"observerResultsUpdated"})})}};function p(e,t){return!1!==(0,r.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&g(e,t,t.refetchOnMount)}function g(e,t,n){if(!1!==(0,r.resolveEnabled)(t.enabled,e)&&"static"!==(0,r.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&v(e,t)}return!1}function m(e,t,n,i){return(e!==t||!1===(0,r.resolveEnabled)(i.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&v(e,n)}function v(e,t){return!1!==(0,r.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,r.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",()=>f],414822)},955371,e=>{"use strict";let t;var n=e.i(414822);e.i(139507);var r=e.i(600943),i=e.i(766271),o=e.i(259864),s=e.i(98340);e.i(991047);var a=r.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),l=r.createContext(!1);l.Provider;var u=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function c(e,t){return function(e,t,n){let c,h=r.useContext(l),d=r.useContext(a),f=(0,s.useQueryClient)(n),p=f.defaultQueryOptions(e);f.getDefaultOptions().queries?._experimental_beforeQuery?.(p);let g=f.getQueryCache().get(p.queryHash);if(p._optimisticResults=h?"isRestoring":"optimistic",p.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=p.staleTime;p.staleTime="function"==typeof t?(...n)=>e(t(...n)):e(t),"number"==typeof p.gcTime&&(p.gcTime=Math.max(p.gcTime,1e3))}c=g?.state.error&&"function"==typeof p.throwOnError?(0,i.shouldThrowError)(p.throwOnError,[g.state.error,g]):p.throwOnError,(p.suspense||p.experimental_prefetchInRender||c)&&!d.isReset()&&(p.retryOnMount=!1),r.useEffect(()=>{d.clearReset()},[d]);let m=!f.getQueryCache().get(p.queryHash),[v]=r.useState(()=>new t(f,p)),y=v.getOptimisticResult(p),b=!h&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{let t=b?v.subscribe(o.notifyManager.batchCalls(e)):i.noop;return v.updateResult(),t},[v,b]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),r.useEffect(()=>{v.setOptions(p)},[p,v]),p?.suspense&&y.isPending)throw u(p,v,d);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&void 0===e.data||(0,i.shouldThrowError)(n,[e.error,r])))({result:y,errorResetBoundary:d,throwOnError:p.throwOnError,query:g,suspense:p.suspense}))throw y.error;if(f.getDefaultOptions().queries?._experimental_afterQuery?.(p,y),p.experimental_prefetchInRender&&!i.isServer&&y.isLoading&&y.isFetching&&!h){let e=m?u(p,v,d):g?.promise;e?.catch(i.noop).finally(()=>{v.updateResult()})}return p.notifyOnChangeProps?y:v.trackResult(y)}(e,n.QueryObserver,t)}e.s(["useQuery",()=>c],955371)},763123,e=>{"use strict";e.s(["cacheKeys",0,{rowCount:e=>["row_count",e],lineage:()=>["lineage"],checks:()=>["checks","list"],check:e=>["checks",e],checkEvents:e=>["checks",e,"events"],runs:()=>["runs"],run:e=>["runs",e],runsAggregated:()=>["runs_aggregated"],flag:()=>["flag"],instanceInfo:()=>["instance_info"],user:()=>["user"]}])},6245,e=>{"use strict";async function t(e){return(await e.get("/api/instance-info")).data}e.s(["getRecceInstanceInfo",()=>t])},837510,e=>{"use strict";var t=e.i(955371),n=e.i(752036),r=e.i(763123),i=e.i(6245),o=e.i(987562);let s=n.default.create();function a(){let e=(0,o.useApiConfigOptional)(),n=e?.apiClient??s;return(0,t.useQuery)({queryKey:r.cacheKeys.instanceInfo(),queryFn:()=>(0,i.getRecceInstanceInfo)(n)})}e.s(["useRecceInstanceInfo",()=>a])},238190,e=>{"use strict";let t={mode:null,disableSaveToFile:!1,disableExportStateFile:!1,disableImportStateFile:!1,disableUpdateChecklist:!1,disableDatabaseQuery:!1,disableViewActionDropdown:!1,disableNodeActionDropdown:!1,disableShare:!1};e.s(["defaultFeatureToggles",0,t,"defaultInstanceInfo",0,{singleEnv:!1,authed:!1,lifetimeExpiredAt:void 0,featureToggles:t,shareUrl:void 0,sessionId:void 0}])},457918,e=>{"use strict";var t=e.i(991047),n=e.i(600943),r=e.i(238190),i=e.i(837510);let o=(0,n.createContext)(r.defaultInstanceInfo);function s({children:e}){let{data:s,isLoading:a}=(0,i.useRecceInstanceInfo)(),[l,u]=(0,n.useState)(r.defaultFeatureToggles),[c,h]=(0,n.useState)(!1),[d,f]=(0,n.useState)(!1),[p,g]=(0,n.useState)(),[m,v]=(0,n.useState)(),[y,b]=(0,n.useState)(),[w,x]=(0,n.useState)(s);if(!a&&s&&s!==w){x(s),h(s.single_env),f(s.authed),v(s.share_url),b(s.session_id),s.lifetime_expired_at&&(g(new Date(s.lifetime_expired_at)),console.log("lifetime expired at",s.lifetime_expired_at));let e={...r.defaultFeatureToggles};"read-only"===s.server_mode?(e.mode="read only",e.disableSaveToFile=!0,e.disableExportStateFile=!0,e.disableImportStateFile=!0,e.disableUpdateChecklist=!0,e.disableDatabaseQuery=!0,e.disableViewActionDropdown=!0,e.disableNodeActionDropdown=!0,e.disableShare=!0):"preview"===s.server_mode&&(e.mode="metadata only",e.disableSaveToFile=!0,e.disableExportStateFile=!0,e.disableImportStateFile=!0,e.disableUpdateChecklist=!1,e.disableDatabaseQuery=!0,e.disableViewActionDropdown=!1,e.disableNodeActionDropdown=!1,e.disableShare=!0),s.single_env&&(e.disableUpdateChecklist=!0,e.disableShare=!0),s.cloud_instance&&(e.disableShare=!0),u(e)}return(0,t.jsx)(o.Provider,{value:{featureToggles:l,singleEnv:c,authed:d,lifetimeExpiredAt:p,shareUrl:m,sessionId:y},children:e})}function a(){return(0,n.useContext)(o)}o.displayName="RecceInstanceInfoContext",e.s(["RecceInstanceInfoProvider",()=>s,"useRecceInstanceContext",()=>a])},466040,e=>{"use strict";function t(e){return e&&e.ownerDocument||document}e.s(["default",()=>t])},60934,e=>{"use strict";var t=e.i(600943);function n(e){return parseInt(t.version,10)>=19?e?.props?.ref||null:e?.ref||null}e.s(["default",()=>n])},352184,634402,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(593152),r=e.i(466040),i=e.i(60934);let o=function(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t};e.s(["default",0,o],634402);var s=e.i(991047);function a(e){let t=[],n=[];return Array.from(e.querySelectorAll('input,select,textarea,a[href],button,[tabindex],audio[controls],video[controls],[contenteditable]:not([contenteditable="false"])')).forEach((e,r)=>{let i,o=Number.isNaN(i=parseInt(e.getAttribute("tabindex")||"",10))?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:i;-1===o||e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e)||(0===o?t.push(e):n.push({documentOrder:r,tabIndex:o,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function l(){return!0}e.s(["default",0,function(e){let{children:u,disableAutoFocus:c=!1,disableEnforceFocus:h=!1,disableRestoreFocus:d=!1,getTabbable:f=a,isEnabled:p=l,open:g}=e,m=t.useRef(!1),v=t.useRef(null),y=t.useRef(null),b=t.useRef(null),w=t.useRef(null),x=t.useRef(!1),S=t.useRef(null),k=(0,n.default)((0,i.default)(u),S),_=t.useRef(null);t.useEffect(()=>{g&&S.current&&(x.current=!c)},[c,g]),t.useEffect(()=>{if(!g||!S.current)return;let e=o((0,r.default)(S.current));return!S.current.contains(e)&&(S.current.hasAttribute("tabIndex")||S.current.setAttribute("tabIndex","-1"),x.current&&S.current.focus()),()=>{d||(b.current&&b.current.focus&&(m.current=!0,b.current.focus()),b.current=null)}},[g]),t.useEffect(()=>{if(!g||!S.current)return;let e=(0,r.default)(S.current),t=t=>{_.current=t,h||!p()||"Tab"!==t.key||o(e)===S.current&&t.shiftKey&&(m.current=!0,y.current&&y.current.focus())},n=()=>{let t=S.current;if(null===t)return;let n=o(e);if(!e.hasFocus()||!p()||m.current){m.current=!1;return}if(t.contains(n)||h&&n!==v.current&&n!==y.current)return;if(n!==w.current)w.current=null;else if(null!==w.current)return;if(!x.current)return;let r=[];if((n===v.current||n===y.current)&&(r=f(S.current)),r.length>0){let e=!!(_.current?.shiftKey&&_.current?.key==="Tab"),t=r[0],n=r[r.length-1];"string"!=typeof t&&"string"!=typeof n&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);let i=setInterval(()=>{let t=o(e);t&&"BODY"===t.tagName&&n()},50);return()=>{clearInterval(i),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}},[c,h,d,p,g,f]);let O=e=>{null===b.current&&(b.current=e.relatedTarget),x.current=!0};return(0,s.jsxs)(t.Fragment,{children:[(0,s.jsx)("div",{tabIndex:g?0:-1,onFocus:O,ref:v,"data-testid":"sentinelStart"}),t.cloneElement(u,{ref:k,onFocus:e=>{null===b.current&&(b.current=e.relatedTarget),x.current=!0,w.current=e.target;let t=u.props.onFocus;t&&t(e)}}),(0,s.jsx)("div",{tabIndex:g?0:-1,onFocus:O,ref:y,"data-testid":"sentinelEnd"})]})}],352184)},16720,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(631467),r=e.i(514934),i=e.i(593152);function o(e,t){"function"==typeof e?e(t):e&&(e.current=t)}var s=e.i(60934);let a=t.forwardRef(function(e,a){let{children:l,container:u,disablePortal:c=!1}=e,[h,d]=t.useState(null),f=(0,i.default)(t.isValidElement(l)?(0,s.default)(l):null,a);return((0,r.default)(()=>{c||d(("function"==typeof u?u():u)||document.body)},[u,c]),(0,r.default)(()=>{if(h&&!c)return o(a,h),()=>{o(a,null)}},[a,h,c]),c)?t.isValidElement(l)?t.cloneElement(l,{ref:f}):l:h?n.createPortal(l,h):h});e.s(["default",0,a],16720)},707706,509912,213063,687782,621586,682183,e=>{"use strict";var t=e.i(593152);let n=function(e){return"string"==typeof e};e.s(["default",0,n],509912);let r=function(e,t,r){return void 0===e||n(e)?t:{...t,ownerState:{...t.ownerState,...r}}};e.s(["default",0,r],213063);let i=function(e,t,n){return"function"==typeof e?e(t,n):e};e.s(["default",0,i],687782);var o=e.i(7284);let s=function(e,t=[]){if(void 0===e)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n};e.s(["default",0,s],621586);let a=function(e){if(void 0===e)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t},l=function(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:l}=e;if(!t){let e=(0,o.default)(n?.className,l,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},s={...n,...i,...r};return e.length>0&&(s.className=e),Object.keys(t).length>0&&(s.style=t),{props:s,internalRef:void 0}}let u=s({...i,...r}),c=a(r),h=a(i),d=t(u),f=(0,o.default)(d?.className,n?.className,l,i?.className,r?.className),p={...d?.style,...n?.style,...i?.style,...r?.style},g={...d,...n,...h,...c};return f.length>0&&(g.className=f),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:d.ref}};function u(e,n){let{className:o,elementType:s,ownerState:a,externalForwardedProps:u,internalForwardedProps:c,shouldForwardComponentProp:h=!1,...d}=n,{component:f,slots:p={[e]:void 0},slotProps:g={[e]:void 0},...m}=u,v=p[e]||s,y=i(g[e],a),{props:{component:b,...w},internalRef:x}=l({className:o,...d,externalForwardedProps:"root"===e?m:void 0,externalSlotProps:y}),S=(0,t.default)(x,y?.ref,n.ref),k="root"===e?b||f:b,_=r(v,{..."root"===e&&!f&&!p[e]&&c,..."root"!==e&&!p[e]&&c,...w,...k&&!h&&{as:k},...k&&h&&{component:k},ref:S},a);return[v,_]}e.s(["default",0,l],682183),e.s(["default",()=>u],707706)},596052,577408,e=>{"use strict";e.i(139507);var t=e.i(318680),n=e.i(399162),r=e.i(600943),i=e.i(631467),o=e.i(722627),s="unmounted",a="exited",l="entering",u="entered",c="exiting",h=function(e){function h(t,n){var r,i=e.call(this,t,n)||this,o=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?o?(r=a,i.appearStatus=l):r=u:r=t.unmountOnExit||t.mountOnEnter?s:a,i.state={status:r},i.nextCallback=null,i}(0,n.default)(h,e),h.getDerivedStateFromProps=function(e,t){return e.in&&t.status===s?{status:a}:null};var d=h.prototype;return d.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},d.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==l&&n!==u&&(t=l):(n===l||n===u)&&(t=c)}this.updateStatus(!1,t)},d.componentWillUnmount=function(){this.cancelNextCallback()},d.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},d.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===l){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:i.default.findDOMNode(this);n&&n.scrollTop}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===a&&this.setState({status:s})},d.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[i.default.findDOMNode(this),r],s=o[0],a=o[1],c=this.getTimeouts(),h=r?c.appear:c.enter;(e||n)&&1?(this.props.onEnter(s,a),this.safeSetState({status:l},function(){t.props.onEntering(s,a),t.onTransitionEnd(h,function(){t.safeSetState({status:u},function(){t.props.onEntered(s,a)})})})):this.safeSetState({status:u},function(){t.props.onEntered(s)})},d.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:i.default.findDOMNode(this);t?(this.props.onExit(r),this.safeSetState({status:c},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:a},function(){e.props.onExited(r)})})})):this.safeSetState({status:a},function(){e.props.onExited(r)})},d.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},d.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},d.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},d.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:i.default.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(!n||r)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=o[0],a=o[1];this.props.addEndListener(s,a)}null!=e&&setTimeout(this.nextCallback,e)},d.render=function(){var e=this.state.status;if(e===s)return null;var n=this.props,i=n.children,a=(n.in,n.mountOnEnter,n.unmountOnExit,n.appear,n.enter,n.exit,n.timeout,n.addEndListener,n.onEnter,n.onEntering,n.onEntered,n.onExit,n.onExiting,n.onExited,n.nodeRef,(0,t.default)(n,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r.default.createElement(o.default.Provider,{value:null},"function"==typeof i?i(e,a):r.default.cloneElement(r.default.Children.only(i),a))},h}(r.default.Component);function d(){}function f(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??("number"==typeof n?n:n[t.mode]||0),easing:i.transitionTimingFunction??("object"==typeof r?r[t.mode]:r),delay:i.transitionDelay}}h.contextType=o.default,h.propTypes={},h.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},h.UNMOUNTED=s,h.EXITED=a,h.ENTERING=l,h.ENTERED=u,h.EXITING=c,e.s(["Transition",0,h],596052),e.s(["getTransitionProps",()=>f,"reflow",0,e=>e.scrollTop],577408)},828843,799899,675383,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(721431),o=e.i(138961),s=e.i(707706),a=e.i(596052),l=e.i(60934),u=e.i(473287),c=e.i(577408),h=e.i(987074),d=e.i(991047);let f={entering:{opacity:1},entered:{opacity:1}},p=t.forwardRef(function(e,n){let r=(0,u.useTheme)(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:p,easing:g,in:m,onEnter:v,onEntered:y,onEntering:b,onExit:w,onExited:x,onExiting:S,style:k,timeout:_=i,TransitionComponent:O=a.Transition,...C}=e,E=t.useRef(null),T=(0,h.default)(E,(0,l.default)(p),n),P=e=>t=>{if(e){let n=E.current;void 0===t?e(n):e(n,t)}},A=P(b),R=P((e,t)=>{(0,c.reflow)(e);let n=(0,c.getTransitionProps)({style:k,timeout:_,easing:g},{mode:"enter"});e.style.webkitTransition=r.transitions.create("opacity",n),e.style.transition=r.transitions.create("opacity",n),v&&v(e,t)}),M=P(y),I=P(S),D=P(e=>{let t=(0,c.getTransitionProps)({style:k,timeout:_,easing:g},{mode:"exit"});e.style.webkitTransition=r.transitions.create("opacity",t),e.style.transition=r.transitions.create("opacity",t),w&&w(e)}),L=P(x);return(0,d.jsx)(O,{appear:s,in:m,nodeRef:E,onEnter:R,onEntered:M,onEntering:A,onExit:D,onExited:L,onExiting:I,addEndListener:e=>{o&&o(E.current,e)},timeout:_,...C,children:(e,{ownerState:n,...r})=>t.cloneElement(p,{style:{opacity:0,visibility:"exited"!==e||m?void 0:"hidden",...f[e],...k,...p.props.style},ref:T,...r})})});e.s(["default",0,p],799899);var g=e.i(11507),m=e.i(222942);function v(e){return(0,m.default)("MuiBackdrop",e)}(0,g.default)("MuiBackdrop",["root","invisible"]);let y=(0,i.styled)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),b=t.forwardRef(function(e,t){let i=(0,o.useDefaultProps)({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:u="div",invisible:c=!1,open:h,components:f={},componentsProps:g={},slotProps:m={},slots:b={},TransitionComponent:w,transitionDuration:x,...S}=i,k={...i,component:u,invisible:c},_=(e=>{let{classes:t,invisible:n}=e;return(0,r.default)({root:["root",n&&"invisible"]},v,t)})(k),O={component:u,slots:{transition:w,root:f.Root,...b},slotProps:{...g,...m}},[C,E]=(0,s.default)("root",{elementType:y,externalForwardedProps:O,className:(0,n.default)(_.root,l),ownerState:k}),[T,P]=(0,s.default)("transition",{elementType:p,externalForwardedProps:O,ownerState:k});return(0,d.jsx)(T,{in:h,timeout:x,...S,...P,children:(0,d.jsx)(C,{"aria-hidden":!0,...E,ref:t,children:a})})});function w(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}e.s(["default",0,b],828843),e.s(["default",()=>w],675383)},857482,e=>{"use strict";var t=e.i(466040);function n(e){return(0,t.default)(e).defaultView||window}e.s(["default",()=>n])},622743,603200,718533,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(352184),o=e.i(16720),s=e.i(721431),a=e.i(842196),l=e.i(138961),u=e.i(828843),c=e.i(466040),h=e.i(593152),d=e.i(907480),f=e.i(675383),p=e.i(621586),g=e.i(857482);function m(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function v(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function y(e){return parseFloat((0,g.default)(e).getComputedStyle(e).paddingRight)||0}function b(e,t,n,r,i){let o=[t,n,...r];[].forEach.call(e.children,e=>{let t,n,r=!o.includes(e),s=(t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type"),!t&&!n);r&&s&&v(e,i)})}function w(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}e.s(["default",()=>m],603200);let x=()=>{},S=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n,r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&v(e.modalRef,!1);let i=(n=[],[].forEach.call(t.children,e=>{"true"===e.getAttribute("aria-hidden")&&n.push(e)}),n);b(t,e.mount,e.modalRef,i,!0);let o=w(this.containers,e=>e.container===t);return -1!==o?this.containers[o].modals.push(e):this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:i}),r}mount(e,t){let n=w(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||(r.restore=function(e,t){let n=[],r=e.container;if(!t.disableScrollLock){let e,t;if((t=(0,c.default)(r)).body===r?(0,g.default)(r).innerWidth>t.documentElement.clientWidth:r.scrollHeight>r.clientHeight){let e=m((0,g.default)(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${y(r)+e}px`;let t=(0,c.default)(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${y(t)+e}px`})}if(r.parentNode instanceof DocumentFragment)e=(0,c.default)(r).body;else{let t=r.parentElement,n=(0,g.default)(r);e=t?.nodeName==="HTML"&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}(r,t))}remove(e,t=!0){let n=this.modals.indexOf(e);if(-1===n)return n;let r=w(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&v(e.modalRef,t),b(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&v(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}},k=function(e){let{container:n,disableEscapeKeyDown:r=!1,disableScrollLock:i=!1,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:u,open:g,rootRef:m}=e,y=t.useRef({}),b=t.useRef(null),w=t.useRef(null),k=(0,h.default)(w,m),[_,O]=t.useState(!g),C=!!l&&l.props.hasOwnProperty("in"),E=!0;("false"===e["aria-hidden"]||!1===e["aria-hidden"])&&(E=!1);let T=()=>(y.current.modalRef=w.current,y.current.mount=b.current,y.current),P=()=>{S.mount(T(),{disableScrollLock:i}),w.current&&(w.current.scrollTop=0)},A=(0,d.default)(()=>{let e=("function"==typeof n?n():n)||(0,c.default)(b.current).body;S.add(T(),e),w.current&&P()}),R=()=>S.isTopModal(T()),M=(0,d.default)(e=>{b.current=e,e&&(g&&R()?P():w.current&&v(w.current,E))}),I=t.useCallback(()=>{S.remove(T(),E)},[E]);return t.useEffect(()=>()=>{I()},[I]),t.useEffect(()=>{g?A():C&&o||I()},[g,I,C,o,A]),{getRootProps:(t={})=>{let n=(0,p.default)(e);delete n.onTransitionEnter,delete n.onTransitionExited;let i={...n,...t};return{role:"presentation",...i,onKeyDown:e=>{i.onKeyDown?.(e),"Escape"===e.key&&229!==e.which&&R()&&!r&&(e.stopPropagation(),u&&u(e,"escapeKeyDown"))},ref:k}},getBackdropProps:(e={})=>({"aria-hidden":!0,...e,onClick:t=>{e.onClick?.(t),t.target===t.currentTarget&&u&&u(t,"backdropClick")},open:g}),getTransitionProps:()=>({onEnter:(0,f.default)(()=>{O(!1),s&&s()},l?.props.onEnter??x),onExited:(0,f.default)(()=>{O(!0),a&&a(),o&&I()},l?.props.onExited??x)}),rootRef:k,portalRef:M,isTopModal:R,exited:_,hasTransition:C}};var _=e.i(11507),O=e.i(222942);function C(e){return(0,O.default)("MuiModal",e)}(0,_.default)("MuiModal",["root","hidden","backdrop"]);var E=e.i(707706),T=e.i(991047);let P=(0,s.styled)("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})((0,a.default)(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:"hidden"}}]}))),A=(0,s.styled)(u.default,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),R=t.forwardRef(function(e,s){let a=(0,l.useDefaultProps)({name:"MuiModal",props:e}),{BackdropComponent:u=A,BackdropProps:c,classes:h,className:d,closeAfterTransition:f=!1,children:p,container:g,component:m,components:v={},componentsProps:y={},disableAutoFocus:b=!1,disableEnforceFocus:w=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:_=!1,disableScrollLock:O=!1,hideBackdrop:R=!1,keepMounted:M=!1,onClose:I,onTransitionEnter:D,onTransitionExited:L,open:N,slotProps:B={},slots:F={},theme:j,...U}=a,q={...a,closeAfterTransition:f,disableAutoFocus:b,disableEnforceFocus:w,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:_,disableScrollLock:O,hideBackdrop:R,keepMounted:M},{getRootProps:W,getBackdropProps:z,getTransitionProps:V,portalRef:H,isTopModal:Q,exited:$,hasTransition:K}=k({...q,rootRef:s}),X={...q,exited:$},G=(e=>{let{open:t,exited:n,classes:i}=e;return(0,r.default)({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},C,i)})(X),Z={};if(void 0===p.props.tabIndex&&(Z.tabIndex="-1"),K){let{onEnter:e,onExited:t}=V();Z.onEnter=e,Z.onExited=t}let Y={slots:{root:v.Root,backdrop:v.Backdrop,...F},slotProps:{...y,...B}},[J,ee]=(0,E.default)("root",{ref:s,elementType:P,externalForwardedProps:{...Y,...U,component:m},getSlotProps:W,ownerState:X,className:(0,n.default)(d,G?.root,!X.open&&X.exited&&G?.hidden)}),[et,en]=(0,E.default)("backdrop",{ref:c?.ref,elementType:u,externalForwardedProps:Y,shouldForwardComponentProp:!0,additionalProps:c,getSlotProps:e=>z({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:(0,n.default)(c?.className,G?.backdrop),ownerState:X});return M||N||K&&!$?(0,T.jsx)(o.default,{ref:H,container:g,disablePortal:S,children:(0,T.jsxs)(J,{...ee,children:[!R&&u?(0,T.jsx)(et,{...en}):null,(0,T.jsx)(i.default,{disableEnforceFocus:w,disableAutoFocus:b,disableRestoreFocus:_,isEnabled:Q,open:N,children:t.cloneElement(p,Z)})]})}):null});e.s(["default",0,R],622743);var M=e.i(941647),I=e.i(473287),D=e.i(198116);function L(e){return(0,O.default)("MuiPaper",e)}(0,_.default)("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);let N=(0,s.styled)("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})((0,a.default)(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),B=t.forwardRef(function(e,t){let i=(0,l.useDefaultProps)({props:e,name:"MuiPaper"}),o=(0,I.useTheme)(),{className:s,component:a="div",elevation:u=1,square:c=!1,variant:h="elevation",...d}=i,f={...i,component:a,elevation:u,square:c,variant:h},p=(e=>{let{square:t,elevation:n,variant:i,classes:o}=e,s={root:["root",i,!t&&"rounded","elevation"===i&&`elevation${n}`]};return(0,r.default)(s,L,o)})(f);return(0,T.jsx)(N,{as:a,ownerState:f,className:(0,n.default)(p.root,s),ref:t,...d,style:{..."elevation"===h&&{"--Paper-shadow":(o.vars||o).shadows[u],...o.vars&&{"--Paper-overlay":o.vars.overlays?.[u]},...!o.vars&&"dark"===o.palette.mode&&{"--Paper-overlay":`linear-gradient(${(0,M.alpha)("#fff",(0,D.default)(u))}, ${(0,M.alpha)("#fff",(0,D.default)(u))})`}},...d.style}})});e.s(["default",0,B],718533)},876761,e=>{"use strict";var t=e.i(600943),n={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},r=t.default.createContext&&t.default.createContext(n),i=["attr","size","title"];function o(){return(o=Object.assign.bind()).apply(this,arguments)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){var r,i,o;r=e,i=t,o=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e){return n=>t.default.createElement(u,o({attr:a({},e.attr)},n),function e(n){return n&&n.map((n,r)=>t.default.createElement(n.tag,a({key:r},n.attr),e(n.child)))}(e.child))}function u(e){var s=n=>{var r,{attr:s,size:l,title:u}=e,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,i),h=l||n.size||"1em";return n.className&&(r=n.className),e.className&&(r=(r?r+" ":"")+e.className),t.default.createElement("svg",o({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,c,{className:r,style:a(a({color:e.color||n.color},n.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),u&&t.default.createElement("title",null,u),e.children)};return void 0!==r?t.default.createElement(r.Consumer,null,e=>s(e)):s(n)}e.s(["GenIcon",()=>l],876761)},150639,e=>{"use strict";function t(e){return"query"===e.type}function n(e){return"query_base"===e.type}function r(e){return"query_diff"===e.type}function i(e){return"value_diff"===e.type}function o(e){return"value_diff_detail"===e.type}function s(e){return"profile"===e.type}function a(e){return"profile_diff"===e.type}function l(e){return"row_count"===e.type}function u(e){return"row_count_diff"===e.type}function c(e){return"top_k_diff"===e.type}function h(e){return"histogram_diff"===e.type}let d=["query","query_base","query_diff","row_count","row_count_diff","profile","profile_diff","value_diff","value_diff_detail","top_k_diff","histogram_diff"];function f(e){return d.includes(e)}e.s(["isHistogramDiffRun",()=>h,"isProfileDiffRun",()=>a,"isProfileRun",()=>s,"isQueryBaseRun",()=>n,"isQueryDiffRun",()=>r,"isQueryRun",()=>t,"isRowCountDiffRun",()=>u,"isRowCountRun",()=>l,"isTopKDiffRun",()=>c,"isValueDiffDetailRun",()=>o,"isValueDiffRun",()=>i,"runTypeHasRef",()=>f])},70800,e=>{"use strict";var t=e.i(150639);async function n(e,t,n,r){let i=n?.trackProps?{...n.trackProps}:{};return(await r.post("/api/runs",{type:e,params:t,nowait:n?.nowait,track_props:i})).data}async function r(e,n,r){var i=(await r.get(`/api/runs/${e}/wait`,{params:{timeout:n}})).data;if(null==i.result)return i;if((0,t.isQueryRun)(i)&&i.result){let e=i.result;e.columns&&(e.columns=e.columns.map(e=>e.key?e:{...e,key:e.name}))}return i}async function i(e,t){await t.post(`/api/runs/${e}/cancel`)}async function o(e,t,n){return(await n.post(`/api/checks/${e}/run`,{nowait:t?.nowait})).data}async function s(e,t,n,r){return(await r.post("/api/runs/search",{type:e,params:t,limit:n})).data}async function a(e){return(await e.get("/api/runs")).data}async function l(e){return(await e.post("/api/runs/aggregate",{})).data}e.s(["aggregateRuns",()=>l,"cancelRun",()=>i,"listRuns",()=>a,"searchRuns",()=>s,"submitRun",()=>n,"submitRunFromCheck",()=>o,"waitRun",()=>r])},238153,492421,e=>{"use strict";var t;let n={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function r(e){return (t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}let i={date:r({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:r({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:r({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},o={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function s(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,i=n?.width?String(n.width):t;r=e.formattingValues[i]||e.formattingValues[t]}else{let t=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}let a={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:s({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:s({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:s({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:s({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:s({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function l(e){return(t,n={})=>{let r,i=n.width,o=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;let a=s[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(l,e=>e.test(a)):function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(l,e=>e.test(a));return r=e.valueCallback?e.valueCallback(u):u,{value:r=n.valueCallback?n.valueCallback(r):r,rest:t.slice(a.length)}}}let u={ordinalNumber:(t={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,n={})=>{let r=e.match(t.matchPattern);if(!r)return null;let i=r[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:e.slice(i.length)}}),era:l({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:l({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:l({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:l({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:l({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};e.s(["defaultLocale",0,{code:"en-US",formatDistance:(e,t,r)=>{let i,o=n[e];if(i="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+i;else return i+" ago";return i},formatLong:i,formatRelative:(e,t,n,r)=>o[e],localize:a,match:u,options:{weekStartsOn:0,firstWeekContainsDate:1}}],238153);let c={};function h(){return c}e.s(["getDefaultOptions",()=>h],492421)},487122,511518,e=>{"use strict";let t=Symbol.for("constructDateFrom");function n(e,n){return"function"==typeof e?e(n):e&&"object"==typeof e&&t in e?e[t](n):e instanceof Date?new e.constructor(n):new Date(n)}e.s(["constructFromSymbol",0,t,"millisecondsInDay",0,864e5,"millisecondsInHour",0,36e5,"millisecondsInMinute",0,6e4,"millisecondsInWeek",0,6048e5,"minutesInDay",0,1440,"minutesInMonth",0,43200],511518),e.s(["constructFrom",()=>n],487122)},632713,516467,710,e=>{"use strict";var t=e.i(487122);function n(e,n){return(0,t.constructFrom)(n||e,e)}function r(e){let t=n(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function i(e,...n){let r=t.constructFrom.bind(null,e||n.find(e=>"object"==typeof e));return n.map(r)}e.s(["toDate",()=>n],516467),e.s(["getTimezoneOffsetInMilliseconds",()=>r],632713),e.s(["normalizeDates",()=>i],710)},230902,e=>{"use strict";var t=e.i(238153),n=e.i(492421),r=e.i(632713),i=e.i(710),o=e.i(511518),s=e.i(516467);function a(e,t){let n=(0,s.toDate)(e,t?.in);return n.setHours(0,0,0,0),n}function l(e,t){let r=(0,n.getDefaultOptions)(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=(0,s.toDate)(e,t?.in),a=o.getDay();return o.setDate(o.getDate()-(7*(a<i)+a-i)),o.setHours(0,0,0,0),o}function u(e,t){return l(e,{...t,weekStartsOn:1})}var c=e.i(487122);function h(e,t){let n=(0,s.toDate)(e,t?.in),r=n.getFullYear(),i=(0,c.constructFrom)(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let o=u(i),a=(0,c.constructFrom)(n,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);let l=u(a);return n.getTime()>=o.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function d(e,t){let r=(0,s.toDate)(e,t?.in),i=r.getFullYear(),o=(0,n.getDefaultOptions)(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,u=(0,c.constructFrom)(t?.in||e,0);u.setFullYear(i+1,0,a),u.setHours(0,0,0,0);let h=l(u,t),d=(0,c.constructFrom)(t?.in||e,0);d.setFullYear(i,0,a),d.setHours(0,0,0,0);let f=l(d,t);return+r>=+h?i+1:+r>=+f?i:i-1}function f(e,t){let n=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+n}let p={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return f("yy"===t?r%100:r,t.length)},M(e,t){let n=e.getMonth();return"M"===t?String(n+1):f(n+1,2)},d:(e,t)=>f(e.getDate(),t.length),a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>f(e.getHours()%12||12,t.length),H:(e,t)=>f(e.getHours(),t.length),m:(e,t)=>f(e.getMinutes(),t.length),s:(e,t)=>f(e.getSeconds(),t.length),S(e,t){let n=t.length;return f(Math.trunc(e.getMilliseconds()*Math.pow(10,n-3)),t.length)}},g={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){let t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return p.y(e,t)},Y:function(e,t,n,r){let i=d(e,r),o=i>0?i:1-i;return"YY"===t?f(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):f(o,t.length)},R:function(e,t){return f(h(e),t.length)},u:function(e,t){return f(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return f(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return f(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){let r=e.getMonth();switch(t){case"M":case"MM":return p.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){let r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return f(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,r,i){let a,u,h,p,g,m=Math.round((l(a=(0,s.toDate)(e,i?.in),i)-(u=(0,n.getDefaultOptions)(),h=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??u.firstWeekContainsDate??u.locale?.options?.firstWeekContainsDate??1,p=d(a,i),(g=(0,c.constructFrom)(i?.in||a,0)).setFullYear(p,0,h),g.setHours(0,0,0,0),l(g,i)))/o.millisecondsInWeek)+1;return"wo"===t?r.ordinalNumber(m,{unit:"week"}):f(m,t.length)},I:function(e,t,n){let r,i,a,l=Math.round((u(r=(0,s.toDate)(e,void 0))-(i=h(r,void 0),(a=(0,c.constructFrom)(r,0)).setFullYear(i,0,4),a.setHours(0,0,0,0),u(a)))/o.millisecondsInWeek)+1;return"Io"===t?n.ordinalNumber(l,{unit:"week"}):f(l,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):p.d(e,t)},D:function(e,t,n){let l,u,c=function(e,t,n){let[s,l]=(0,i.normalizeDates)(void 0,e,t),u=a(s),c=a(l);return Math.round((u-(0,r.getTimezoneOffsetInMilliseconds)(u)-(c-(0,r.getTimezoneOffsetInMilliseconds)(c)))/o.millisecondsInDay)}(l=(0,s.toDate)(e,void 0),((u=(0,s.toDate)(l,void 0)).setFullYear(u.getFullYear(),0,1),u.setHours(0,0,0,0),u))+1;return"Do"===t?n.ordinalNumber(c,{unit:"dayOfYear"}):f(c,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){let i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return f(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){let i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return f(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){let r=e.getDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return f(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){let r,i=e.getHours();switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){let r,i=e.getHours();switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return p.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):p.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},k:function(e,t,n){let r=e.getHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):p.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):p.s(e,t)},S:function(e,t){return p.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return v(r);case"XXXX":case"XX":return y(r);default:return y(r,":")}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"x":return v(r);case"xxxx":case"xx":return y(r);default:return y(r,":")}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+m(r,":");default:return"GMT"+y(r,":")}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+m(r,":");default:return"GMT"+y(r,":")}},t:function(e,t,n){return f(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return f(+e,t.length)}};function m(e,t=""){let n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+t+f(o,2)}function v(e,t){return e%60==0?(e>0?"-":"+")+f(Math.abs(e)/60,2):y(e,t)}function y(e,t=""){let n=Math.abs(e);return(e>0?"-":"+")+f(Math.trunc(n/60),2)+t+f(n%60,2)}let b=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},w=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},x={p:w,P:(e,t)=>{let n,r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return b(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",b(i,t)).replace("{{time}}",w(o,t))}},S=/^D+$/,k=/^Y+$/,_=["D","DD","YY","YYYY"],O=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,E=/^'([^]*?)'?$/,T=/''/g,P=/[a-zA-Z]/;function A(e,r,i){let o=(0,n.getDefaultOptions)(),a=i?.locale??o.locale??t.defaultLocale,l=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,u=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,c=(0,s.toDate)(e,i?.in);if(!(c instanceof Date||"object"==typeof c&&"[object Date]"===Object.prototype.toString.call(c))&&"number"!=typeof c||isNaN(+(0,s.toDate)(c)))throw RangeError("Invalid time value");let h=r.match(C).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,x[t])(e,a.formatLong):e}).join("").match(O).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var n;let t;return{isToken:!1,value:(t=(n=e).match(E))?t[1].replace(T,"'"):n}}if(g[t])return{isToken:!0,value:e};if(t.match(P))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(h=a.localize.preprocessor(c,h));let d={firstWeekContainsDate:l,weekStartsOn:u,locale:a};return h.map(t=>{if(!t.isToken)return t.value;let n=t.value;return(!i?.useAdditionalWeekYearTokens&&k.test(n)||!i?.useAdditionalDayOfYearTokens&&S.test(n))&&function(e,t,n){var r,i,o;let s,a=(r=e,i=t,o=n,s="Y"===r[0]?"years":"days of the month",`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${i}\`) for formatting ${s} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(a),_.includes(e))throw RangeError(a)}(n,r,String(e)),(0,g[n[0]])(c,n,a.localize,d)}).join("")}e.s(["format",()=>A],230902)},868422,e=>{"use strict";var t=e.i(238153),n=e.i(492421),r=e.i(632713),i=e.i(710),o=e.i(516467);function s(e,t){let n=(0,o.toDate)(e)-(0,o.toDate)(t);return n<0?-1:n>0?1:n}var a=e.i(511518);function l(e,l,u){var c;let h,d=(0,n.getDefaultOptions)(),f=u?.locale??d.locale??t.defaultLocale,p=s(e,l);if(isNaN(p))throw RangeError("Invalid time value");let g=Object.assign({},u,{addSuffix:u?.addSuffix,comparison:p}),[m,v]=(0,i.normalizeDates)(u?.in,...p>0?[l,e]:[e,l]),y=(c=void 0,e=>{let t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(((0,o.toDate)(v)-(0,o.toDate)(m))/1e3),b=Math.round((y-((0,r.getTimezoneOffsetInMilliseconds)(v)-(0,r.getTimezoneOffsetInMilliseconds)(m))/1e3)/60);if(b<2)if(u?.includeSeconds)if(y<5)return f.formatDistance("lessThanXSeconds",5,g);else if(y<10)return f.formatDistance("lessThanXSeconds",10,g);else if(y<20)return f.formatDistance("lessThanXSeconds",20,g);else if(y<40)return f.formatDistance("halfAMinute",0,g);else if(y<60)return f.formatDistance("lessThanXMinutes",1,g);else return f.formatDistance("xMinutes",1,g);else if(0===b)return f.formatDistance("lessThanXMinutes",1,g);else return f.formatDistance("xMinutes",b,g);if(b<45)return f.formatDistance("xMinutes",b,g);if(b<90)return f.formatDistance("aboutXHours",1,g);if(b<a.minutesInDay){let e=Math.round(b/60);return f.formatDistance("aboutXHours",e,g)}if(b<2520)return f.formatDistance("xDays",1,g);else if(b<a.minutesInMonth){let e=Math.round(b/a.minutesInDay);return f.formatDistance("xDays",e,g)}else if(b<2*a.minutesInMonth)return h=Math.round(b/a.minutesInMonth),f.formatDistance("aboutXMonths",h,g);if((h=function(e,t,n){var r,a;let l,u,c,h,[d,f,p]=(0,i.normalizeDates)(void 0,e,e,t),g=s(f,p),m=Math.abs(function(e,t,n){let[r,o]=(0,i.normalizeDates)(void 0,e,t);return 12*(r.getFullYear()-o.getFullYear())+(r.getMonth()-o.getMonth())}(f,p));if(m<1)return 0;1===f.getMonth()&&f.getDate()>27&&f.setDate(30),f.setMonth(f.getMonth()-g*m);let v=s(f,p)===-g;+(l=(0,o.toDate)(d,void 0),r=void 0,(u=(0,o.toDate)(l,r?.in)).setHours(23,59,59,999),u)==+(a=void 0,h=(c=(0,o.toDate)(l,a?.in)).getMonth(),c.setFullYear(c.getFullYear(),h+1,0),c.setHours(23,59,59,999),c)&&1===m&&1===s(d,p)&&(v=!1);let y=g*(m-v);return 0===y?0:y}(v,m))<12){let e=Math.round(b/a.minutesInMonth);return f.formatDistance("xMonths",e,g)}{let e=h%12,t=Math.trunc(h/12);return e<3?f.formatDistance("aboutXYears",t,g):e<9?f.formatDistance("overXYears",t,g):f.formatDistance("almostXYears",t+1,g)}}e.s(["formatDistance",()=>l],868422)},633921,825822,e=>{"use strict";var t=e.i(230902),n=e.i(868422),r=e.i(511518),i=e.i(487122),o=e.i(516467);function s(e,t){let n,s,v=()=>(0,i.constructFrom)(t?.in,NaN),y=t?.additionalDigits??2,b=function(e){let t,n={},r=e.split(a);if(r.length>2)return n;if(/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],l.test(n.date)&&(n.date=e.split(l)[0],t=e.substr(n.date.length,e.length))),t){let e=u.exec(t);e?(n.time=t.replace(e[1],""),n.timezone=e[1]):n.time=t}return n}(e);if(b.date){let e=function(e,t){let n=RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};let i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:null===o?i:100*o,restDateString:e.slice((r[1]||r[2]).length)}}(b.date,y);n=function(e,t){var n,r,i,o,s,a,l,u,h,d;if(null===t)return new Date(NaN);let p=e.match(c);if(!p)return new Date(NaN);let v=!!p[4],y=f(p[1]),b=f(p[2])-1,w=f(p[3]),x=f(p[4]),S=f(p[5])-1;if(v){let e,a;return(n=x,r=S,n>=1&&n<=53&&r>=0&&r<=6)?(i=t,o=x,s=S,(e=new Date(0)).setUTCFullYear(i,0,4),a=e.getUTCDay()||7,e.setUTCDate(e.getUTCDate()+((o-1)*7+s+1-a)),e):new Date(NaN)}{let e=new Date(0);return(a=t,l=b,u=w,l>=0&&l<=11&&u>=1&&u<=(g[l]||(m(a)?29:28))&&(h=t,(d=y)>=1&&d<=(m(h)?366:365)))?(e.setUTCFullYear(t,b,Math.max(y,w)),e):new Date(NaN)}}(e.restDateString,e.year)}if(!n||isNaN(+n))return v();let w=+n,x=0;if(b.time&&isNaN(x=function(e){var t,n,i;let o=e.match(h);if(!o)return NaN;let s=p(o[1]),a=p(o[2]),l=p(o[3]);return(t=s,n=a,i=l,24===t?0===n&&0===i:i>=0&&i<60&&n>=0&&n<60&&t>=0&&t<25)?s*r.millisecondsInHour+a*r.millisecondsInMinute+1e3*l:NaN}(b.time)))return v();if(b.timezone){if(isNaN(s=function(e){var t;if("Z"===e)return 0;let n=e.match(d);if(!n)return 0;let i="+"===n[1]?-1:1,o=parseInt(n[2]),s=n[3]&&parseInt(n[3])||0;return(t=s)>=0&&t<=59?i*(o*r.millisecondsInHour+s*r.millisecondsInMinute):NaN}(b.timezone)))return v()}else{let e=new Date(w+x),n=(0,o.toDate)(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return(0,o.toDate)(w+x+s,t?.in)}let a=/[T ]/,l=/[Z ]/i,u=/([Z+-].*)$/,c=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,h=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,d=/^([+-])(\d{2})(?::?(\d{2}))?$/;function f(e){return e?parseInt(e):1}function p(e){return e&&parseFloat(e.replace(",","."))||0}let g=[31,null,31,30,31,30,31,31,30,31,30,31];function m(e){return e%400==0||e%4==0&&e%100!=0}function v(e,t="verbose"){let n,r={hours:Math.floor((n=Math.floor(e))/3600),minutes:Math.floor(n%3600/60),seconds:n%60};return"compact"===t?function({hours:e,minutes:t,seconds:n}){return e>0?`${e}:${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${t}:${n.toString().padStart(2,"0")}`}(r):function({hours:e,minutes:t,seconds:n}){let r=[];return e>0&&r.push(`${e} hour${1!==e?"s":""}`),t>0&&r.push(`${t} min${1!==t?"s":""}`),0===e&&(0===r.length||n>0)&&r.push(`${n} second${1!==n?"s":""}`),r.join(" ")}(r)}function y(e){let n=s(e);return(0,t.format)(n,"yyyy-MM-dd'T'HH:mm:ss")}function b(e){let t=s(e);return(0,n.formatDistance)(t,new Date,{addSuffix:!0})}e.s(["parseISO",()=>s],825822),e.s(["formatDuration",()=>v,"formatTimeToNow",()=>b,"formatTimestamp",()=>y],633921)},184390,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(663888),o=e.i(721431),s=e.i(842196),a=e.i(138961),l=e.i(11507),u=e.i(222942);function c(e){return(0,u.default)("MuiSvgIcon",e)}(0,l.default)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var h=e.i(991047);let d=(0,o.styled)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${(0,i.default)(n.color)}`],t[`fontSize${(0,i.default)(n.fontSize)}`]]}})((0,s.default)(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),f=t.forwardRef(function(e,o){let s=(0,a.useDefaultProps)({props:e,name:"MuiSvgIcon"}),{children:l,className:u,color:f="inherit",component:p="svg",fontSize:g="medium",htmlColor:m,inheritViewBox:v=!1,titleAccess:y,viewBox:b="0 0 24 24",...w}=s,x=t.isValidElement(l)&&"svg"===l.type,S={...s,color:f,component:p,fontSize:g,instanceFontSize:e.fontSize,inheritViewBox:v,viewBox:b,hasSvgAsChild:x},k={};v||(k.viewBox=b);let _=(e=>{let{color:t,fontSize:n,classes:o}=e,s={root:["root","inherit"!==t&&`color${(0,i.default)(t)}`,`fontSize${(0,i.default)(n)}`]};return(0,r.default)(s,c,o)})(S);return(0,h.jsxs)(d,{as:p,className:(0,n.default)(_.root,u),focusable:"false",color:m,"aria-hidden":!y||void 0,role:y?"img":void 0,ref:o,...k,...w,...x&&l.props,ownerState:S,children:[x?l.props.children:l,y?(0,h.jsx)("title",{children:y}):null]})});function p(e,n){function r(t,n){return(0,h.jsx)(f,{"data-testid":void 0,ref:n,...t,children:e})}return r.muiName=f.muiName,t.memo(t.forwardRef(r))}f.muiName="SvgIcon",e.s(["default",()=>p],184390)},618378,e=>{"use strict";var t=e.i(600943),n=e.i(447239),r=e.i(60934),i=e.i(596052),o=e.i(473287),s=e.i(577408),a=e.i(987074),l=e.i(991047);function u(e){return`scale(${e}, ${e**2})`}let c={entering:{opacity:1,transform:u(1)},entered:{opacity:1,transform:"none"}},h="u">typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),d=t.forwardRef(function(e,d){let{addEndListener:f,appear:p=!0,children:g,easing:m,in:v,onEnter:y,onEntered:b,onEntering:w,onExit:x,onExited:S,onExiting:k,style:_,timeout:O="auto",TransitionComponent:C=i.Transition,...E}=e,T=(0,n.default)(),P=t.useRef(),A=(0,o.useTheme)(),R=t.useRef(null),M=(0,a.default)(R,(0,r.default)(g),d),I=e=>t=>{if(e){let n=R.current;void 0===t?e(n):e(n,t)}},D=I(w),L=I((e,t)=>{let n;(0,s.reflow)(e);let{duration:r,delay:i,easing:o}=(0,s.getTransitionProps)({style:_,timeout:O,easing:m},{mode:"enter"});"auto"===O?P.current=n=A.transitions.getAutoHeightDuration(e.clientHeight):n=r,e.style.transition=[A.transitions.create("opacity",{duration:n,delay:i}),A.transitions.create("transform",{duration:h?n:.666*n,delay:i,easing:o})].join(","),y&&y(e,t)}),N=I(b),B=I(k),F=I(e=>{let t,{duration:n,delay:r,easing:i}=(0,s.getTransitionProps)({style:_,timeout:O,easing:m},{mode:"exit"});"auto"===O?P.current=t=A.transitions.getAutoHeightDuration(e.clientHeight):t=n,e.style.transition=[A.transitions.create("opacity",{duration:t,delay:r}),A.transitions.create("transform",{duration:h?t:.666*t,delay:h?r:r||.333*t,easing:i})].join(","),e.style.opacity=0,e.style.transform=u(.75),x&&x(e)}),j=I(S);return(0,l.jsx)(C,{appear:p,in:v,nodeRef:R,onEnter:L,onEntered:N,onEntering:D,onExit:F,onExited:j,onExiting:B,addEndListener:e=>{"auto"===O&&T.start(P.current||0,e),f&&f(R.current,e)},timeout:"auto"===O?null:O,...E,children:(e,{ownerState:n,...r})=>t.cloneElement(g,{style:{opacity:0,transform:u(.75),visibility:"exited"!==e||v?void 0:"hidden",...c[e],..._,...g.props.style},ref:M,...r})})});d&&(d.muiSupportAuto=!0),e.s(["default",0,d])},721394,300930,70106,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(79049),i=e.i(222942),o=e.i(295456);let s=(0,e.i(99495).default)();e.s(["default",0,s],300930);var a=e.i(30835),l=e.i(473308);function u({props:e,name:t,defaultTheme:n,themeId:r}){let i=(0,l.default)(n);return r&&(i=i[r]||i),function(e){let{theme:t,name:n,props:r}=e;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,a.default)(t.components[n].defaultProps,r):r}({theme:i,name:t,props:e})}e.s(["default",()=>u],70106);var c=e.i(841565),h=e.i(118621),d=e.i(424956),f=e.i(379823),p=e.i(991047);let g=(0,h.default)(),m=s("div",{name:"MuiStack",slot:"Root"});function v(e){return u({props:e,name:"MuiStack",defaultTheme:g})}let y=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...(0,d.handleBreakpoints)({theme:t},(0,d.resolveBreakpointValues)({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e}))};if(e.spacing){let i=(0,f.createUnarySpacing)(t),o=Object.keys(t.breakpoints.values).reduce((t,n)=>(("object"==typeof e.spacing&&null!=e.spacing[n]||"object"==typeof e.direction&&null!=e.direction[n])&&(t[n]=!0),t),{}),s=(0,d.resolveBreakpointValues)({values:e.direction,base:o}),a=(0,d.resolveBreakpointValues)({values:e.spacing,base:o});"object"==typeof s&&Object.keys(s).forEach((e,t,n)=>{if(!s[e]){let r=t>0?s[n[t-1]]:"column";s[e]=r}}),n=(0,r.default)(n,(0,d.handleBreakpoints)({theme:t},a,(t,n)=>e.useFlexGap?{gap:(0,f.getValue)(i,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[n?s[n]:e.direction]}`]:(0,f.getValue)(i,t)}}))}return(0,d.mergeBreakpointsInOrder)(t.breakpoints,n)};var b=e.i(954683),w=e.i(138961);let x=function(e={}){let{createStyledComponent:r=m,useThemeProps:s=v,componentName:a="MuiStack"}=e,l=r(y);return t.forwardRef(function(e,r){let u,h=s(e),{component:d="div",direction:f="column",spacing:g=0,divider:m,children:v,className:y,useFlexGap:b=!1,...w}=(0,c.extendSxProp)(h),x=(0,o.default)({root:["root"]},e=>(0,i.default)(a,e),{});return(0,p.jsx)(l,{as:d,ownerState:{direction:f,spacing:g,useFlexGap:b},ref:r,className:(0,n.default)(x.root,y),...w,children:m?(u=t.Children.toArray(v).filter(Boolean)).reduce((e,n,r)=>(e.push(n),r<u.length-1&&e.push(t.cloneElement(m,{key:`separator-${r}`})),e),[]):v})})}({createStyledComponent:(0,b.default)("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>(0,w.useDefaultProps)({props:e,name:"MuiStack"})});e.s(["default",0,x],721394)},280490,e=>{"use strict";var t=e.i(991047),n=e.i(600943);let r=(0,n.createContext)({isActionAvailable:()=>!0,isDemoSite:!1,isLoading:!0});function i({children:e,lineageGraph:i,envInfo:o,reviewMode:s,cloudMode:a,fileMode:l,fileName:u,isDemoSite:c=!1,isCodespace:h,isLoading:d,error:f,supportTasks:p,onRefetchLineageGraph:g,runsAggregated:m,onRefetchRunsAggregated:v}){let y=(0,n.useCallback)(e=>!p||(p[e]??!0),[p]),b=(0,n.useMemo)(()=>({lineageGraph:i,envInfo:o,reviewMode:s,cloudMode:a,fileMode:l,fileName:u,isDemoSite:c,isCodespace:h,isLoading:d,error:f,supportTasks:p,retchLineageGraph:g,isActionAvailable:y,runsAggregated:m,refetchRunsAggregated:v}),[i,o,s,a,l,u,c,h,d,f,p,g,y,m,v]);return(0,t.jsx)(r.Provider,{value:b,children:e})}function o(){return(0,n.useContext)(r)}function s(){let{runsAggregated:e,refetchRunsAggregated:t}=o();return[e,t]}r.displayName="RecceLineageGraphContext",e.s(["LineageGraphProvider",()=>i,"useLineageGraphContext",()=>o,"useRunsAggregated",()=>s])},484404,(e,t,n)=>{!function(r,i){"use strict";var o="function",s="undefined",a="object",l="string",u="model",c="name",h="type",d="vendor",f="version",p="architecture",g="console",m="mobile",v="tablet",y="smarttv",b="wearable",w="embedded",x="Amazon",S="Apple",k="ASUS",_="BlackBerry",O="Browser",C="Chrome",E="Firefox",T="Google",P="Huawei",A="Microsoft",R="Motorola",M="Opera",I="Samsung",D="Sharp",L="Sony",N="Xiaomi",B="Zebra",F="Facebook",j=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},U=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},q=function(e,t){return typeof e===l&&-1!==W(t).indexOf(W(e))},W=function(e){return e.toLowerCase()},z=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,350)},V=function(e,t){for(var n,r,i,s,l,u,c=0;c<t.length&&!l;){var h=t[c],d=t[c+1];for(n=r=0;n<h.length&&!l;)if(l=h[n++].exec(e))for(i=0;i<d.length;i++)u=l[++r],typeof(s=d[i])===a&&s.length>0?2===s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):void 0:this[s[0]]=u?s[1].call(this,u,s[2]):void 0:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):void 0):this[s]=u||void 0;c+=2}},H=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(q(t[n][r],e))return"?"===n?void 0:n}else if(q(t[n],e))return"?"===n?void 0:n;return e},Q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,M]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+O]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+O],f],[/\bfocus\/([\w\.]+)/i],[f,[c,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+O]],[/fxios\/([-\w\.]+)/i],[f,[c,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+O]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+O],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,F],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,C+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+O]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,H,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,W]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",W]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,W]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,I],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,I],[h,m]],[/((ipod|iphone)\d+,\d+)/i],[u,[d,S],[h,m]],[/(ipad\d+,\d+)/i],[u,[d,S],[h,v]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[d,S],[h,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,S],[h,v]],[/(macintosh);/i],[u,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,P],[h,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,P],[h,m]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[d,N],[h,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,N],[h,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[h,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[h,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[h,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,R],[h,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,R],[h,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,"LG"],[h,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,"LG"],[h,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[h,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[h,m]],[/(pixel c)\b/i],[u,[d,T],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,T],[h,m]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,L],[h,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,L],[h,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[h,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,x],[h,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,x],[h,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[h,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,_],[h,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[h,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,k],[h,m]],[/(nexus 9)/i],[u,[d,"HTC"],[h,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[h,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[h,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[h,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,D],[h,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[h,m]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[h,v]],[/(surface duo)/i],[u,[d,A],[h,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[h,m]],[/(u304aa)/i],[u,[d,"AT&T"],[h,m]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[h,m]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[h,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[h,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[h,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[h,v]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[h,v]],[/\b(k88) b/i],[u,[d,"ZTE"],[h,v]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[h,m]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[h,m]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[h,v]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[h,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[h,v]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[h,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[h,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[h,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[h,m]],[/\b(ph-1) /i],[u,[d,"Essential"],[h,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[h,v]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[h,v]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[h,v]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[h,v]],[/(sprint) (\w+)/i],[d,u,[h,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,A],[h,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,B],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,B],[h,m]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[h,g]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[h,g]],[/(playstation [345portablevi]+)/i],[u,[d,L],[h,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,A],[h,g]],[/smart-tv.+(samsung)/i],[d,[h,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,I],[h,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[h,y]],[/(apple) ?tv/i],[d,[u,S+" TV"],[h,y]],[/crkey/i],[[u,C+"cast"],[d,T],[h,y]],[/droid.+aft(\w)( bui|\))/i],[u,[d,x],[h,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,D],[h,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,L],[h,y]],[/(mitv-\w{5}) bui/i],[u,[d,N],[h,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,z],[u,z],[h,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,y]],[/((pebble))app/i],[d,u,[h,b]],[/droid.+; (glass) \d/i],[u,[d,T],[h,b]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,B],[h,b]],[/(quest( 2)?)/i],[u,[d,F],[h,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[h,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[h,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[h,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,H,Q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,H,Q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,_]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[c,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[c,"Chromium OS"],f],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[c,f]]},K=function(e,t){if(typeof e===a&&(t=e,e=void 0),!(this instanceof K))return new K(e,t).getResult();var n=e||(typeof r!==s&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),i=t?j($,t):$;return this.getBrowser=function(){var e,t={};return t[c]=void 0,t[f]=void 0,V.call(t,n,i.browser),t.major=typeof(e=t.version)===l?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,t},this.getCPU=function(){var e={};return e[p]=void 0,V.call(e,n,i.cpu),e},this.getDevice=function(){var e={};return e[d]=void 0,e[u]=void 0,e[h]=void 0,V.call(e,n,i.device),e},this.getEngine=function(){var e={};return e[c]=void 0,e[f]=void 0,V.call(e,n,i.engine),e},this.getOS=function(){var e={};return e[c]=void 0,e[f]=void 0,V.call(e,n,i.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===l&&e.length>350?z(e,350):e,this},this.setUA(n),this};if(K.VERSION="0.7.33",K.BROWSER=U([c,f,"major"]),K.CPU=U([p]),K.DEVICE=U([u,d,h,g,m,y,v,b,w]),K.ENGINE=K.OS=U([c,f]),typeof n!==s)t.exports&&(n=t.exports=K),n.UAParser=K;else if(typeof define===o&&define.amd)e.r,void 0!==K&&e.v(K);else typeof r!==s&&(r.UAParser=K);var X=typeof r!==s&&(r.jQuery||r.Zepto);if(X&&!X.ua){var G=new K;X.ua=G.getResult(),X.ua.get=function(){return G.getUA()},X.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var n in t)X.ua[n]=t[n]}}}("object"==typeof window?window:e.e)},211363,e=>{"use strict";let t,n,r,i,o;e.i(139507);var s,a,l,u,c,h,d,f,p,g,m,v,y,b,w,x,S,k,_,O,C,E,T,P,A,R,M,I,D,L,N,B,F,j,U,q,W,z,V,H,Q,$,K,X,G,Z,Y,J,ee,et,en,er,ei,eo,es,ea,el,eu,ec,eh,ed,ef,ep,eg,em,ev=e.i(824627);(s=Q||(Q={})).SET="$set",s.SET_ONCE="$setOnce",s.ADD="$add",s.APPEND="$append",s.PREPEND="$prepend",s.REMOVE="$remove",s.PREINSERT="$preInsert",s.POSTINSERT="$postInsert",s.UNSET="$unset",s.CLEAR_ALL="$clearAll",(a=$||($={})).IDENTIFY="$identify",a.GROUP_IDENTIFY="$groupidentify",a.REVENUE="revenue_amount";var ey="".concat("AMP","_unsent"),eb="$default_instance",ew="https://api2.amplitude.com/2/httpapi",ex="dclid",eS="fbclid",ek="gbraid",e_="gclid",eO="ko_click_id",eC="li_fat_id",eE="msclkid",eT="rdt_cid",eP="ttclid",eA="twclid",eR="wbraid",eM={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},eI=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],eD=["authorization","cookie","set-cookie"],eL=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!eN(t,n))return!1}return!0},eN=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=(0,ev.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&eL(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else if(null==t)return!1;else if("object"==typeof t)return eL(t);else if(!["number","string","boolean"].includes(typeof t))return!1;return!0},eB=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return(0,ev.__assign)({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(K.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(K.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(K.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(K.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(K.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(K.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(K.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(K.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(K.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[K.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return!(void 0!==this._properties[K.CLEAR_ALL]||this._propertySet.has(t))&&(e===K.ADD?"number"==typeof n:e===K.UNSET||e===K.REMOVE||eN(t,n))},e}();(l=K||(K={})).SET="$set",l.SET_ONCE="$setOnce",l.ADD="$add",l.APPEND="$append",l.PREPEND="$prepend",l.REMOVE="$remove",l.PREINSERT="$preInsert",l.POSTINSERT="$postInsert",l.UNSET="$unset",l.CLEAR_ALL="$clearAll";var eF=[K.CLEAR_ALL,K.UNSET,K.SET,K.SET_ONCE,K.ADD,K.APPEND,K.PREPEND,K.PREINSERT,K.POSTINSERT,K.REMOVE];(u=X||(X={})).Unknown="unknown",u.Skipped="skipped",u.Success="success",u.RateLimit="rate_limit",u.PayloadTooLarge="payload_too_large",u.Invalid="invalid",u.Failed="failed",u.Timeout="Timeout",u.SystemError="SystemError";var ej=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=X.Unknown),{event:e,code:t,message:n}},eU=e.i(311994),eq=(0,ev.__spreadArray)([],(0,ev.__read)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),eW=function(e){var t,n=(0,eU.getGlobalScope)();if(!(null==(t=null==n?void 0:n.crypto)?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,eW);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,(0,ev.__spreadArray)([],(0,ev.__read)(r.entries()),!1).map(function(e){var t=(0,ev.__read)(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(eq[r]):eq[r]}).join("")},ez=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if(this.plugins.some(function(t){return t.name===e.name}))return this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2];return void 0===e.name&&(e.name=eW(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!=(n=e.type)?n:"enrichment",[4,null==(r=e.setup)?void 0:r.call(e,t,this.client)];case 1:return i.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){var n;return(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(-1===(r=this.plugins.findIndex(function(t){return t.name===e})))return t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2];return i=this.plugins[r],this.plugins.splice(r,1),[4,null==(n=i.teardown)?void 0:n.call(i)];case 1:return o.sent(),[2]}})})},e.prototype.reset=function(e){this.applying=!1,this.plugins.map(function(e){var t;return null==(t=e.teardown)?void 0:t.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s,a,l,u,c,h,d,f,p,g;return(0,ev.__generator)(this,function(m){switch(m.label){case 0:if(!e)return[2];t=(0,ev.__read)(e,1)[0],n=(0,ev.__read)(e,2)[1],this.loggerProvider.log("Timeline.apply: Initial event",t),r=this.plugins.filter(function(e){return"before"===e.type}),m.label=1;case 1:m.trys.push([1,6,7,8]),o=(i=(0,ev.__values)(r)).next(),m.label=2;case 2:if(o.done)return[3,5];if(!(s=o.value).execute)return[3,4];return[4,s.execute((0,ev.__assign)({},t))];case 3:if(null===(a=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),m.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return d={error:m.sent()},[3,8];case 7:try{o&&!o.done&&(f=i.return)&&f.call(i)}finally{if(d)throw d.error}return[7];case 8:l=this.plugins.filter(function(e){return"enrichment"===e.type||void 0===e.type}),m.label=9;case 9:m.trys.push([9,14,15,16]),c=(u=(0,ev.__values)(l)).next(),m.label=10;case 10:if(c.done)return[3,13];if(!(s=c.value).execute)return[3,12];return[4,s.execute((0,ev.__assign)({},t))];case 11:if(null===(a=m.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),n({event:t,code:0,message:""}),[2];t=a,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(s.name),"', event: ").concat(JSON.stringify(t))),m.label=12;case 12:return c=u.next(),[3,10];case 13:return[3,16];case 14:return p={error:m.sent()},[3,16];case 15:try{c&&!c.done&&(g=u.return)&&g.call(u)}finally{if(p)throw p.error}return[7];case 16:return h=this.plugins.filter(function(e){return"destination"===e.type}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(t))),Promise.all(h.map(function(e){var n=(0,ev.__assign)({},t);return e.execute(n).catch(function(e){return ej(n,0,String(e))})})).then(function(e){var r=(0,ev.__read)(e,1)[0]||ej(t,100,"Event not tracked, no destination plugins on the instance");n(r)}),[2]}})})},e.prototype.flush=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return t.apply(e)}))];case 1:return n.sent(),[4,Promise.all(this.plugins.filter(function(e){return"destination"===e.type}).map(function(e){return e.flush&&e.flush()}))];case 2:return n.sent(),[2]}})})},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onIdentityChanged)||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onSessionIdChanged)||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;null==(n=t.onOptOutChanged)||n.call(t,e)})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;null==(t=e.onReset)||t.call(e)})},e}(),eV=function(e,t){return(0,ev.__assign)((0,ev.__assign)({},t),{event_type:$.IDENTIFY,user_properties:e.getUserProperties()})},eH=function(e,t,n,r){var i;return(0,ev.__assign)((0,ev.__assign)({},r),{event_type:$.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:((i={})[e]=t,i)})},eQ=function(e,t,n){var r,i=new eB;return i.set(e,t),(0,ev.__assign)((0,ev.__assign)({},n),{event_type:$.IDENTIFY,user_properties:i.getUserProperties(),groups:((r={})[e]=t,r)})},e$=function(e){return{promise:e||Promise.resolve()}},eK=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new ez(this),this.name=e}return e.prototype._init=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:t=this[e],this[e]=[],a.label=1;case 1:a.trys.push([1,8,9,10]),r=(n=(0,ev.__values)(t)).next(),a.label=2;case 2:if(r.done)return[3,7];if(!((i=(0,r.value)())&&"promise"in i))return[3,4];return[4,i.promise];case 3:return a.sent(),[3,6];case 4:return[4,i];case 5:a.sent(),a.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 10:if(!this[e].length)return[3,12];return[4,this.runQueuedFunctions(e)];case 11:a.sent(),a.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=(0,ev.__assign)((0,ev.__assign)((0,ev.__assign)({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t});return e$(this.dispatch(r))},e.prototype.identify=function(e,t){var n=eV(e,t);return e$(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=eH(e,t,n,r);return e$(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=eQ(e,t,n);return e$(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=(0,ev.__assign)((0,ev.__assign)({},t),{event_type:$.REVENUE,event_properties:e.getEventProperties()});return e$(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),e$())},e.prototype._addPlugin=function(e){return e$(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),e$())},e.prototype._removePlugin=function(e){return e$(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(ej(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,ev.__generator)(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var n={};return Object.keys(e).forEach(function(t){Object.values(Q).includes(t)||(n[t]=e[t])}),eF.forEach(function(n){if(Object.keys(e).includes(n)){var r=e[n];switch(n){case Q.CLEAR_ALL:Object.keys(t).forEach(function(e){delete t[e]});break;case Q.UNSET:Object.keys(r).forEach(function(e){delete t[e]});break;case Q.SET:Object.assign(t,r)}}}),Object.assign(t,n),t},e.prototype.process=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),this.config.optOut)return[2,ej(e,0,"Event skipped due to optOut config")];return e.event_type===$.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)];case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return r=String(i.sent()),this.config.loggerProvider.error(r),[2,n=ej(e,0,r)];case 3:return[2]}})})},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,!!e))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=!!e)},e.prototype.flush=function(){return e$(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});return void 0===t?void this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e)):t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),eX=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])};(c=G||(G={}))[c.None=0]="None",c[c.Error=1]="Error",c[c.Warn=2]="Warn",c[c.Verbose=3]="Verbose",c[c.Debug=4]="Debug";var eG="Amplitude Logger ",eZ=function(){function e(){this.logLevel=G.None}return e.prototype.disable=function(){this.logLevel=G.None},e.prototype.enable=function(e){void 0===e&&(e=G.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Verbose||console.log("".concat(eG,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Warn||console.warn("".concat(eG,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Error||console.error("".concat(eG,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<G.Debug||console.log("".concat(eG,"[Debug]: ").concat(e.join(" ")))},e}(),eY=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:eb,logLevel:G.Warn,loggerProvider:new eZ,offline:!1,optOut:!1,serverUrl:ew,serverZone:"US",useBatch:!1}},eJ=function(){function e(e){this._optOut=!1;var t,n,r,i,o=eY();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!=(n=e.logLevel)?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!=(r=e.optOut)?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=e0(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),e0=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=eY().serverZone),void 0===n&&(n=eY().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:eY().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":r?"https://api2.amplitude.com/batch":ew)}},e1=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function e2(e){return e>=200&&e<300}var e3=function(e){return void 0===e&&(e=0),(Error().stack||"").split("\n").slice(2+e).map(function(e){return e.trim()})},e4=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),l=a.logger,u=a.logLevel;if(u&&u<G.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:e3(1),time:{start:new Date().toISOString()},states:{}};r&&c.states&&(c.states.before=r());var h=e.apply(i,o);return h&&h.promise?h.promise.then(function(){r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))}):(r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))),h}};function e8(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var e6=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return(0,ev.__awaiter)(this,void 0,void 0,function(){var n,r=this;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(ey,"_").concat(this.config.apiKey.substring(0,10)),[4,null==(t=this.config.storageProvider)?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map(function(e){return r.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=eW()),new Promise(function(n){t.queue.push({event:e,attempts:0,callback:function(e){return n(e)},timeout:0}),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r=this;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if(this.config.offline)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2];if(this.flushId)return this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2];return this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),[4,eX(t,this.config.flushQueueSize).reduce(function(t,n){return(0,ev.__awaiter)(r,void 0,void 0,function(){return(0,ev.__generator)(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())];case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,(0,ev.__rest)(t,["extra"])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new e1,a.label=1;case 1:return a.trys.push([1,3,,4]),i=e0(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:if(null===(o=a.sent()))return this.fulfillRequest(e,0,"Unexpected error occurred"),[2];if(!t)return"body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(e8(o))):this.fulfillRequest(e,o.statusCode,o.status),[2];return this.handleResponse(o,e),[3,4];case 3:var l;return s=(l=a.sent())instanceof Error?l.message:String(l),this.config.loggerProvider.error(s),null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(e){return e.event.event_type}),message:s,stack_trace:e3()}),this.handleResponse({status:X.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){e2(e.statusCode)||null==(n=this.diagnosticsClient)||n.recordEvent("analytics.events.unsuccessful",{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:e8(e),stack_trace:e3()});var n,r=e.status;switch(r){case X.Success:this.handleSuccessResponse(e,t);break;case X.Invalid:this.handleInvalidResponse(e,t);break;case X.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case X.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))return void this.fulfillRequest(t,e.statusCode,e.body.error);var r=new Set((0,ev.__spreadArray)((0,ev.__spreadArray)((0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(Object.values(e.body.eventsWithInvalidFields)),!1),(0,ev.__read)(Object.values(e.body.eventsWithMissingFields)),!1),(0,ev.__read)(Object.values(e.body.eventsWithInvalidIdLengths)),!1),(0,ev.__read)(e.body.silencedEvents),!1).flat()),i=t.filter(function(t,i){return!r.has(i)||void n.fulfillRequest([t],e.statusCode,e.body.error)});i.length>0&&this.config.loggerProvider.warn(e8(e));var o=this.removeEventsExceedFlushMaxRetries(i);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1===t.length)return void this.fulfillRequest(t,e.statusCode,e.body.error);this.config.loggerProvider.warn(e8(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),l=new Set(o),u=t.filter(function(t,r){return t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)?void n.fulfillRequest([t],e.statusCode,e.body.error):(l.has(r)&&(t.timeout=n.throttleTimeout),!0)});u.length>0&&this.config.loggerProvider.warn(e8(e));var c=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(c)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;e2(t)?null==(o=this.diagnosticsClient)||o.increment("analytics.events.sent",e.length):(null==(r=this.diagnosticsClient)||r.increment("analytics.events.dropped",e.length),null==(i=this.diagnosticsClient)||i.recordEvent("analytics.events.dropped",{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:e3()})),this.removeEvents(e),e.forEach(function(e){return e.callback(ej(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),e5=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return eL(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?(0,ev.__assign)({},this.properties):{};return e[Z.REVENUE_PRODUCT_ID]=this.productId,e[Z.REVENUE_QUANTITY]=this.quantity,e[Z.REVENUE_PRICE]=this.price,e[Z.REVENUE_TYPE]=this.revenueType,e[Z.REVENUE_CURRENCY]=this.currency,e[Z.REVENUE]=this.revenue,e[Z.RECEIPT]=this.receipt,e[Z.RECEIPT_SIG]=this.receiptSig,e},e}();(h=Z||(Z={})).REVENUE_PRODUCT_ID="$productId",h.REVENUE_QUANTITY="$quantity",h.REVENUE_PRICE="$price",h.REVENUE_TYPE="$revenueType",h.REVENUE_CURRENCY="$currency",h.REVENUE="$revenue",h.RECEIPT="$receipt",h.RECEIPT_SIG="$receiptSig";var e9=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:e7(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),e7=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},te=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),tt=function(){return(tt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function tn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function tr(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var ti=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=tn(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(a&&l){for(var u=0;u<e.length;u++)if(!ti(e[u],t[u]))return!1}else{if(!ti(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(n){ti(e[n],t[n])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var to=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=tt({},this.identity.userProperties),n=tt(tt({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,l=n.userProperties||{};try{for(var u=tn(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=tr(c.value,2),d=h[0],f=h[1];switch(d){case"$set":try{for(var p=(i=void 0,tn(Object.entries(f))),g=p.next();!g.done;g=p.next()){var m=tr(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,tn(Object.keys(f))),w=b.next();!w.done;w=b.next()){var v=w.value;delete l[v]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return tt({},this.identity)},e.prototype.setIdentity=function(e){var t=tt({},this.identity);this.identity=tt({},e),ti(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),ts="u">typeof globalThis?globalThis:e.g,ta=function(){function e(){this.identityStore=new to,this.eventBridge=new te,this.applicationContextProvider=new e9}return e.getInstance=function(t){return ts.analyticsConnectorInstances||(ts.analyticsConnectorInstances={}),ts.analyticsConnectorInstances[t]||(ts.analyticsConnectorInstances[t]=new e),ts.analyticsConnectorInstances[t]},e}(),tl=function(e){return void 0===e&&(e=eb),ta.getInstance(e)},tu=function(e,t){tl(t).identityStore.editIdentity().setUserId(e).commit()},tc=function(e,t){tl(t).identityStore.editIdentity().setDeviceId(e).commit()},th=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},td=function(){function e(){this.name="identity",this.type="before",this.identityStore=tl().identityStore}return e.prototype.execute=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return e.instanceName&&(this.identityStore=tl(e.instanceName).identityStore),[2]})})},e}(),tf=function(){var e,t=(0,eU.getGlobalScope)();return(null==(e=null==t?void 0:t.location)?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce(function(e,t){var n=t.split("=",2),r=tp(n[0]),i=tp(n[1]);return i&&(e[r]=i),e},{}):{}},tp=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},tg=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),tm=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new tg(e,t)}return e.prototype.subscribe=function(e,t,n){var r=eW(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t=this;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:if(this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5)return this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2];return[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then(function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null})),this.fetchPromise},e.prototype.subscribeAll=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,ev.__awaiter)(this,void 0,void 0,function(){var n,r,i,o,s,a,l=this;return(0,ev.__generator)(this,function(u){switch(u.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,u,c;return(0,ev.__generator)(this,function(h){switch(h.label){case 0:i=new AbortController,s=setTimeout(function(){return i.abort()},t),h.label=1;case 1:return h.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:if((a=h.sent()).ok)return[3,4];return[4,a.text()];case 3:return u=h.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(u)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:h.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(c=h.sent())instanceof Error&&"AbortError"===c.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),c),[3,9];case 8:return clearTimeout(s),[7];case 9:if(!(r<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,l.getJitterDelay(n))})];case 10:h.sent(),h.label=11;case 11:return[2]}})},o=this,s=0,u.label=1;case 1:if(!(s<e))return[3,4];return[5,i(s)];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];u.label=3;case 3:return s++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),tv="tags",ty="counters",tb="histograms",tw="events",tx="internal",tS="last_flush_timestamp",tk=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return(null==(e=(0,eU.getGlobalScope)())?void 0:e.indexedDB)!==void 0},e.prototype.getDB=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var e=this;return new Promise(function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}})},e.prototype.createTables=function(e){e.objectStoreNames.contains(tv)||e.createObjectStore(tv,{keyPath:"key"}),e.objectStoreNames.contains(ty)||e.createObjectStore(ty,{keyPath:"key"}),e.objectStoreNames.contains(tb)||e.createObjectStore(tb,{keyPath:"key"}),e.objectStoreNames.contains(tw)||e.createObjectStore(tw,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1}),e.objectStoreNames.contains(tx)||e.createObjectStore(tx,{keyPath:"key"})},e.prototype.setTags=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tv],"readwrite")).objectStore(tv),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tags",e),r()},o.forEach(function(e){var t=(0,ev.__read)(e,2),r=t[0],o=t[1];n.put({key:r,value:o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set tag",r,o,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",r),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([ty],"readwrite")).objectStore(ty),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to increment counters",e),r()},o.forEach(function(e){var t=(0,ev.__read)(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e=s.result,t=e?e.value:0;n.put({key:r,value:t+o}).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",r),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===Object.entries(e).length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tb],"readwrite")).objectStore(tb),[2,new Promise(function(r){var o=Object.entries(e);t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),r()},o.forEach(function(e){var t=(0,ev.__read)(e,2),r=t[0],o=t[1],s=n.get(r);s.onsuccess=function(){var e,t=s.result;e=t?{key:r,count:t.count+o.count,min:Math.min(t.min,o.min),max:Math.max(t.max,o.max),sum:t.sum+o.sum}:{key:r,count:o.count,min:o.min,max:o.max,sum:o.sum},n.put(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},s.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}})})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(o.trys.push([0,2,,3]),0===e.length)return[2];return[4,this.getDB()];case 1:return n=(t=o.sent().transaction([tw],"readwrite")).objectStore(tw),[2,new Promise(function(r){t.oncomplete=function(){r()},t.onabort=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event records",e),r()};var o=n.count();o.onsuccess=function(){var t=Math.max(0,10-o.result);t<e.length&&i.logger.debug("DiagnosticsStorage: Only added ".concat(t," of ").concat(e.length," events due to storage limit")),e.slice(0,t).forEach(function(e){n.add(e).onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to add event record",e)}})},o.onerror=function(e){i.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}})];case 2:return r=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",r),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n,r,i;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=(n=o.sent().transaction([tx],"readwrite")).objectStore(tx),[2,new Promise(function(i,o){n.onabort=function(){return o(Error("Failed to set internal value"))};var s=r.put({key:e,value:t});s.onsuccess=function(){return i()},s.onerror=function(){return o(Error("Failed to set internal value"))}})];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",i),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=(t=i.sent().transaction([tx],"readonly")).objectStore(tx),[2,new Promise(function(r,i){t.onabort=function(){return i(Error("Failed to get internal value"))};var o=n.get(e);o.onsuccess=function(){return r(o.result)},o.onerror=function(){return i(Error("Failed to get internal value"))}})];case 2:return r=i.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",r),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(tS)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(tS,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(Error("Failed to clear table ".concat(t)))}})},e.prototype.getAllAndClear=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=a.sent().transaction([tv,ty,tb,tw],"readwrite"),[4,Promise.all([this.getAllFromStore(e,tv),this.getAllFromStore(e,ty),this.getAllFromStore(e,tb),this.getAllFromStore(e,tw)])];case 2:return n=(t=ev.__read.apply(void 0,[a.sent(),4]))[0],r=t[1],i=t[2],o=t[3],[4,Promise.all([this.clearTable(e,ty),this.clearTable(e,tb),this.clearTable(e,tw)])];case 3:return a.sent(),[2,{tags:n,counters:r,histogramStats:i,events:o}];case 4:return s=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",s),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(e,t){return new Promise(function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(Error("Failed to get all from ".concat(t)))}})},e}(),t_=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t},tO=function(e,t){return 31*Math.abs(t_(e.toString()))%1e5/1e5<t},tC=function(){var e=(0,eU.getGlobalScope)();return null==e?void 0:e.__AMPLITUDE_SCRIPT_URL__},tE=function(e){var t=(0,eU.getGlobalScope)();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",(0,ev.__assign)({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=tT({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})},!0),t.addEventListener("unhandledrejection",function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=tP(i),s=tT({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!=(t=null==r?void 0:r.message)?t:tA(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})},!0)}},tT=function(e){var t=tC();if(t){if(e.filename&&e.filename.includes(t))return"filename";if(e.stack&&e.stack.includes(t))return"stack"}},tP=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},tA=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},tR=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=(0,ev.__assign)({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=tO(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,tk.isSupported()?this.storage=new tk(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),tE(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryTags).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");this.inMemoryTags[e]=t,this.startTimersIfNeeded()}},e.prototype.increment=function(e,t){if(void 0===t&&(t=1),this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=1e4)return void this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=10)return void this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout(function(){e.saveAllDataToStorage().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)}).finally(function(){e.saveTimer=null})},1e3)),this.flushTimer||(this.flushTimer=setTimeout(function(){e._flush().catch(function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)}).finally(function(){e.flushTimer=null})},3e5))},e.prototype.saveAllDataToStorage=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t,n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];return e=(0,ev.__assign)({},this.inMemoryTags),t=(0,ev.__assign)({},this.inMemoryCounters),n=(0,ev.__assign)({},this.inMemoryHistograms),r=(0,ev.__spreadArray)([],(0,ev.__read)(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])];case 1:return i.sent(),[2]}})})},e.prototype._flush=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t,n,r,i,o,s,a,l,u;return(0,ev.__generator)(this,function(c){switch(c.label){case 0:if(!this.storage)return[2];return[4,this.saveAllDataToStorage()];case 1:return c.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:if(t=(e=c.sent()).tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach(function(e){o[e.key]=e.value}),s={},n.forEach(function(e){s[e.key]=e.value}),a={},r.forEach(function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}}),l=i.map(function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}}),0===Object.keys(s).length&&0===Object.keys(a).length&&0===l.length)return[2];return u={tags:o,histogram:a,counters:s,events:l},this.fetch(u),[2]}})})},e.prototype.fetch=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!(0,eU.getGlobalScope)())throw Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:if(!n.sent().ok)return this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2];return this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t,n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:if(!this.storage)return[2];return e=Date.now(),[4,this.storage.getLastFlushTimestamp()];case 1:if(-1===(t=r.sent()||-1))return this.storage.setLastFlushTimestamp(e),this._setFlushTimer(3e5),[2];return(n=e-t)>=3e5?this._flush():this._setFlushTimer(3e5-n),[2]}})})},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout(function(){t._flush().catch(function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)}).finally(function(){t.flushTimer=null})},e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=tO(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),tM=function(e,t){return"boolean"==typeof e?e:(null==e?void 0:e[t])!==!1},tI=function(e){return tM(e,"attribution")},tD=function(e){return tM(e,"pageViews")},tL=function(e){return tM(e,"sessions")},tN=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},tB=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},tF=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},tj=function(e){if(tB(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},tU=function(e){if(tF(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},tq=function(e){var t;if(tN(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),(0,ev.__assign)((0,ev.__assign)({},n),{captureRules:null==(t=null==n?void 0:n.captureRules)?void 0:t.map(function(t){var n,r,i;if((null==(n=t.urls)?void 0:n.length)&&(null==(r=t.hosts)?void 0:r.length)){var o=JSON.stringify(t.hosts),s=JSON.stringify(t.urls);return null==(i=e.loggerProvider)||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),(0,ev.__assign)((0,ev.__assign)({},t),{hosts:void 0})}return t})})}},tW=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return tD(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},tz=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var l=a.apply(e,o);"function"==typeof s&&s(null==l?void 0:l.promise)}}return e},tV=function(e){return e&&void 0!==e._q},tH=function(){if("u"<typeof navigator)return"";var e,t,n,r,i=navigator.userLanguage;return null!=(r=null!=(n=null!=(t=null==(e=navigator.languages)?void 0:e[0])?t:navigator.language)?n:i)?r:""},tQ="2.33.5",t$="amplitude-ts",tK=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(t$,"/").concat(tQ),"u">typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i,o;return(0,ev.__generator)(this,function(s){return r=new Date().getTime(),i=null!=(t=this.config.lastEventId)?t:-1,o=null!=(n=e.event_id)?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,(0,ev.__assign)((0,ev.__assign)((0,ev.__assign)((0,ev.__assign)((0,ev.__assign)((0,ev.__assign)((0,ev.__assign)((0,ev.__assign)({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:tH()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:eW(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]})})},e}(),tX=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),tG=function(){function e(e,t){void 0===t&&(t={}),this.options=(0,ev.__assign)({},e),this.config=t}return e.prototype.isEnabled=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:if(!(0,eU.getGlobalScope)())return[2,!1];e.testValue=String(Date.now()),t=new e((0,ev.__assign)((0,ev.__assign)({},this.options),{expirationDays:.003})),n="AMP_TEST_".concat(eW().substring(0,8)),r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=r.sent()))return[2,void 0];try{if(n=tJ(t),void 0===n)return console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0];return[2,JSON.parse(n)]}catch(n){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]}}})})},e.prototype.getRaw=function(e){var t,n,r,i;return(0,ev.__awaiter)(this,void 0,void 0,function(){var o,s,a,l,u,c,h,d,f,p,g,m,v=this;return(0,ev.__generator)(this,function(y){switch(y.label){case 0:s=o=(0,eU.getGlobalScope)(),y.label=1;case 1:if(y.trys.push([1,4,,5]),!(a=null==s?void 0:s.cookieStore))return[3,3];return[4,a.getAll(e)];case 2:if(l=y.sent()){l.length>1&&(null==(t=this.config.diagnosticsClient)||t.recordEvent("cookies.duplicate",{cookies:l.map(function(e){return e.domain})}),null==(n=this.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=(u=(0,ev.__values)(l)).next();!c.done;c=u.next())if(h=c.value,t0(h.domain,this.options.domain))return[2,h.value]}catch(e){g={error:e}}finally{try{c&&!c.done&&(m=u.return)&&m.call(u)}finally{if(g)throw g.error}}}y.label=3;case 3:return[3,5];case 4:return y.sent(),[3,5];case 5:if(d=(null!=(i=null==(r=null==o?void 0:o.document)?void 0:r.cookie.split("; "))?i:[]).filter(function(t){return 0===t.indexOf(e+"=")}),f=void 0,"function"==typeof(p=this.config.duplicateResolverFn)&&d.length>1&&(f=d.find(function(t){var n;try{var r=p(t.substring(e.length+1));return r||null==(n=v.config.diagnosticsClient)||n.increment("cookies.duplicate.occurrence.document.cookie"),r}catch(e){return!1}})),f||(f=d[0]),!f)return[2,void 0];return[2,f.substring(e.length+1)]}})})},e.prototype.set=function(e,t){var n;return(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,l,u;return(0,ev.__generator)(this,function(c){try{r=null!=(n=this.options.expirationDays)?n:0,i=null!==t?r:-1,o=void 0,i&&((s=new Date).setTime(s.getTime()+24*i*36e5),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(l=(0,eU.getGlobalScope)())&&(l.document.cookie=a)}catch(t){u=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}return[2]})})},e.prototype.remove=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return[2]})})},e}(),tZ=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},tY=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},tJ=function(e){var t;return null!=(t=tZ(e))?t:tY(e)},t0=function(e,t){if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},t1=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},t2=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,o,s,a,l,u,c,h,d,f,p,g,m,v,y,b,w,x,S,k=e.code||0,_=this.buildStatus(k);switch(_){case X.Success:return{status:_,statusCode:k,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(n=e.payload_size_bytes)?n:0,serverUploadTime:null!=(r=e.server_upload_time)?r:0}};case X.Invalid:return{status:_,statusCode:k,body:{error:null!=(i=e.error)?i:"",missingField:null!=(o=e.missing_field)?o:"",eventsWithInvalidFields:null!=(s=e.events_with_invalid_fields)?s:{},eventsWithMissingFields:null!=(a=e.events_with_missing_fields)?a:{},eventsWithInvalidIdLengths:null!=(l=e.events_with_invalid_id_lengths)?l:{},epsThreshold:null!=(u=e.eps_threshold)?u:0,exceededDailyQuotaDevices:null!=(c=e.exceeded_daily_quota_devices)?c:{},silencedDevices:null!=(h=e.silenced_devices)?h:[],silencedEvents:null!=(d=e.silenced_events)?d:[],throttledDevices:null!=(f=e.throttled_devices)?f:{},throttledEvents:null!=(p=e.throttled_events)?p:[]}};case X.PayloadTooLarge:return{status:_,statusCode:k,body:{error:null!=(g=e.error)?g:""}};case X.RateLimit:return{status:_,statusCode:k,body:{error:null!=(m=e.error)?m:"",epsThreshold:null!=(v=e.eps_threshold)?v:0,throttledDevices:null!=(y=e.throttled_devices)?y:{},throttledUsers:null!=(b=e.throttled_users)?b:{},exceededDailyQuotaDevices:null!=(w=e.exceeded_daily_quota_devices)?w:{},exceededDailyQuotaUsers:null!=(x=e.exceeded_daily_quota_users)?x:{},throttledEvents:null!=(S=e.throttled_events)?S:[]}};case X.Timeout:default:return{status:_,statusCode:k}}},e.prototype.buildStatus=function(e){return e2(e)?X.Success:429===e?X.RateLimit:413===e?X.PayloadTooLarge:408===e?X.Timeout:e>=400&&e<500?X.Invalid:e>=500?X.Failed:X.Unknown},e}(),t3=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.customHeaders=t,n}return(0,ev.__extends)(t,e),t.prototype.send=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if("u"<typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:(0,ev.__assign)({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"})];case 1:return[4,(n=i.sent()).text()];case 2:r=i.sent();try{return[2,this.buildResponse(JSON.parse(r))]}catch(e){return[2,this.buildResponse({code:n.status})]}}})})},t}(t2),t4=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];return[2,JSON.parse(t)];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){var t;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return[2,(null==(t=this.storage)?void 0:t.getItem(e))||void 0]})})},e.prototype.set=function(e,t){var n;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(r){try{null==(n=this.storage)||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]})})},e.prototype.remove=function(e){var t;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){try{null==(t=this.storage)||t.removeItem(e)}catch(e){}return[2]})})},e.prototype.reset=function(){var e;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){try{null==(e=this.storage)||e.clear()}catch(e){}return[2]})})},e}(),t8=function(e){function t(t){var n,r,i,o=this;try{i=null==(n=(0,eU.getGlobalScope)())?void 0:n.localStorage}catch(e){null==(r=null==t?void 0:t.loggerProvider)||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return(0,ev.__extends)(t,e),t.prototype.set=function(t,n){var r;return(0,ev.__awaiter)(this,void 0,void 0,function(){var i;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(!(Array.isArray(n)&&n.length>1e3))return[3,2];return i=n.length-1e3,[4,e.prototype.set.call(this,t,n.slice(0,1e3))];case 1:return o.sent(),null==(r=this.loggerProvider)||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(1e3,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}})})},t}(t4),t6=function(e){function t(){var t;return e.call(this,null==(t=(0,eU.getGlobalScope)())?void 0:t.sessionStorage)||this}return(0,ev.__extends)(t,e),t}(t4),t5=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return(0,ev.__extends)(t,e),t.prototype.send=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,ev.__generator)(this,function(r){return[2,new Promise(function(r,i){"u"<typeof XMLHttpRequest&&i(Error("XHRTransport is not supported."));var o,s,a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done){var e=a.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:a.status}))}}};var l=(0,ev.__assign)({"Content-Type":"application/json",Accept:"*/*"},n.customHeaders);try{for(var u=(0,ev.__values)(Object.entries(l)),c=u.next();!c.done;c=u.next()){var h=(0,ev.__read)(c.value,2),d=h[0],f=h[1];a.setRequestHeader(d,f)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}a.send(JSON.stringify(t))})]})})},t}(t2),t9=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,ev.__extends)(t,e),t.prototype.send=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n=this;return(0,ev.__generator)(this,function(r){return[2,new Promise(function(r,i){var o=(0,eU.getGlobalScope)();if(!(null==o?void 0:o.navigator.sendBeacon))throw Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);if(o.navigator.sendBeacon(e,JSON.stringify(t)))return r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}));return r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(t2),t7=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},ne=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},nt="[Amplitude]",nn="".concat(nt," Form Started"),nr="".concat(nt," Form Submitted"),ni="".concat(nt," File Downloaded"),no="session_start",ns="session_end",na="".concat(nt," File Extension"),nl="".concat(nt," File Name"),nu="".concat(nt," Link ID"),nc="".concat(nt," Link Text"),nh="".concat(nt," Link URL"),nd="".concat(nt," Form ID"),nf="".concat(nt," Form Name"),np="".concat(nt," Form Destination"),ng="cookie",nm=function(e){function t(t,n,r,i,o,s,a,l,u,c,h,d,f,p,g,m,v,y,b,w,x,S,k,_,O,C,E,T,P,A,R,M,I,D,L,N,B,F,j,U){void 0===r&&(r=new tX),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===u&&(u=5),void 0===c&&(c=30),void 0===h&&(h=ng),void 0===m&&(m=new eZ),void 0===v&&(v=G.Warn),void 0===b&&(b=!1),void 0===w&&(w=!1),void 0===k&&(k=""),void 0===_&&(_="US"),void 0===C&&(C=18e5),void 0===E&&(E=new t8({loggerProvider:m})),void 0===T&&(T={ipAddress:!0,language:!0,platform:!0}),void 0===P&&(P="fetch"),void 0===A&&(A=!1),void 0===R&&(R=!0),void 0===B&&(B=!0),void 0===F&&(F=0);var q,W=this;(W=e.call(this,{apiKey:t,storageProvider:E,transportProvider:nb(P)})||this).apiKey=t,W.appVersion=n,W.cookieOptions=i,W.defaultTracking=o,W.autocapture=s,W.flushIntervalMillis=l,W.flushMaxRetries=u,W.flushQueueSize=c,W.identityStorage=h,W.ingestionMetadata=d,W.instanceName=f,W.loggerProvider=m,W.logLevel=v,W.minIdLength=y,W.offline=b,W.partnerId=x,W.plan=S,W.serverUrl=k,W.serverZone=_,W.sessionTimeout=C,W.storageProvider=E,W.trackingOptions=T,W.transport=P,W.useBatch=A,W.fetchRemoteConfig=R,W.networkTrackingOptions=L,W.identify=N,W.enableDiagnostics=B,W.diagnosticsSampleRate=F,W.diagnosticsClient=j,W.remoteConfig=U,W.version=tQ,W._optOut=!1,W._cookieStorage=r,W.deviceId=a,W.lastEventId=p,W.lastEventTime=g,W.optOut=w,W.sessionId=O,W.pageCounter=I,W.userId=M,W.debugLogsEnabled=D,W.loggerProvider.enable(D?G.Debug:W.logLevel),W.networkTrackingOptions=L,W.identify=N,W.enableDiagnostics=B,W.diagnosticsSampleRate=F,W.diagnosticsClient=j;var z=null!=(q=null==U?void 0:U.fetchRemoteConfig)?q:R;return W.remoteConfig=W.remoteConfig||{},W.remoteConfig.fetchRemoteConfig=z,W.fetchRemoteConfig=z,W}return(0,ev.__extends)(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof tG&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(t1(this.apiKey),e)},t}(eJ),nv=function(e,t,n){switch(void 0===e&&(e=ng),void 0===t&&(t={}),e){case"localStorage":return new t8;case"sessionStorage":return new t6;case"none":return new tX;default:return new tG((0,ev.__assign)((0,ev.__assign)({},t),{expirationDays:t.expiration}),n)}},ny=function(e){var t,n;return void 0===e&&(e={}),(null==(t=e.remoteConfig)?void 0:t.fetchRemoteConfig)===!0||(null==(n=e.remoteConfig)?void 0:n.fetchRemoteConfig)!==!1&&!1!==e.fetchRemoteConfig},nb=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0;return"xhr"===t?new t5(n):"beacon"===t?new t9:new t3(n)},nw="data-amp-mask",nx="*****",nS=/\b(?:\d[ -]*?){13,16}\b/,nk=/(\d{3}-?\d{2}-?\d{4})/g,n_=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,nO=function(e,t){if(void 0===t&&(t=[]),"string"!=typeof e)return"";var n,r,i=e;i=(i=(i=i.replace(nS,nx)).replace(nk,nx)).replace(n_,nx);try{for(var o=(0,ev.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,nx)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},nC=function(e){if("u"<typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(nw)?nx:e?e(document.title):document.title},nE=function(){function e(){}return e.prototype.parse=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return[2,(0,ev.__assign)((0,ev.__assign)((0,ev.__assign)((0,ev.__assign)({},eM),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=tf();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!=(t=null==(e=n.referrer)?void 0:e.split("/")[2])?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=tf();return(e={})[ex]=t[ex],e[eS]=t[eS],e[ek]=t[ek],e[e_]=t[e_],e[eO]=t[eO],e[eC]=t[eC],e[eE]=t[eE],e[eT]=t[eT],e[eP]=t[eP],e[eA]=t[eA],e[eR]=t[eR],e},e}(),nT=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},nP=function(e){void 0===e&&(e={});var t,n,r=(0,eU.getGlobalScope)(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,l=e.eventType,u=void 0===l?"[Amplitude] Page Viewed":l,c=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},h=function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:return e=c("u">typeof location&&location.href||""),n={event_type:u},t=[{}],[4,nA()];case 1:return[2,(n.event_properties=ev.__assign.apply(void 0,[ev.__assign.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"u">typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"u">typeof location&&c(location.pathname)||"","[Amplitude] Page Title":nC(nO),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}})})},d=function(){return void 0===s||"function"==typeof s&&s()},f="u">typeof location?location.href:null,p=function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,n,r,o;return(0,ev.__generator)(this,function(s){switch(s.label){case 0:if(n=nM(a,e=location.href,f||"")&&d(),f=e,!n)return[3,4];if(null==i||i.log("Tracking page view event"),null!=t)return[3,1];return[3,3];case 1:return o=(r=t).track,[4,h()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}})})},g=function(){p()};return{name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var a,l;return(0,ev.__generator)(this,function(u){switch(u.label){case 0:if(t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",g),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,ev.__read)(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&p()}})),!d())return[3,2];return i.log("Tracking page view event"),l=(a=t).track,[4,h()];case 1:l.apply(a,[u.sent()]),u.label=2;case 2:return[2]}})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:if(!("attribution"===s&&nR(e)))return[3,2];return null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,h()];case 1:e.event_type=(t=r.sent()).event_type,e.event_properties=(0,ev.__assign)((0,ev.__assign)({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===u&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=(0,ev.__assign)((0,ev.__assign)({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return r&&(r.removeEventListener("popstate",g),o=!1),[2]})})}}},nA=function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ev.__generator)(this,function(t){switch(t.label){case 0:return e=nT,[4,new nE().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},nR=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[Q.SET]||{},r=t[Q.UNSET]||{},i=(0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(Object.keys(n)),!1),(0,ev.__read)(Object.keys(r)),!1);return Object.keys(eM).every(function(e){return i.includes(e)})}return!1},nM=function(e,t,n){if("pathOnly"!==e)return t!==n;if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname},nI=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,ev.__generator)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");if("u">typeof document){var i=function(e){var t=!1;n(e,"change",function(){var n,i=nL(e);t||r.track(nn,((n={})[nd]=nD(e.id),n[nf]=nD(e.name),n[np]=i,n)),t=!0}),n(e,"submit",function(){var n,i,o=nL(e);t||r.track(nn,((n={})[nd]=nD(e.id),n[nf]=nD(e.name),n[np]=o,n)),r.track(nr,((i={})[nd]=nD(e.id),i[nf]=nD(e.name),i[np]=o,i)),t=!1})};Array.from(document.getElementsByTagName("form")).forEach(i),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=(0,eU.getGlobalScope)())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nD=function(e){if("string"==typeof e)return e},nL=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},nN=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(t,r){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var i,o;return(0,ev.__generator)(this,function(s){return i=function(){if(!r)return void t.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");if("u">typeof document){var i=function(e){try{t=new URL(e.href,window.location.href)}catch(e){return}var t,i=o.exec(t.href),s=null==i?void 0:i[1];s&&n(e,"click",function(){var n;s&&r.track(ni,((n={})[na]=s,n[nl]=t.pathname,n[nu]=e.id,n[nc]=e.text,n[nh]=e.href,n))})},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"u">typeof MutationObserver&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)})})})).observe(document.body,{subtree:!0,childList:!0})}},"complete"===document.readyState?i():(o=(0,eU.getGlobalScope)())?o.addEventListener("load",i):t.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return null==e||e.disconnect(),r(),[2]})})}}},nB=!1,nF=function(e){nB||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),nB=!0)},nj=function(){var e=(0,eU.getGlobalScope)(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))},r=function(){t.forEach(function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)}),t=[]};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(r){return"u"<typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1):(e.offline=!navigator.onLine,n("online",function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout(function(){t.flush()},e.flushIntervalMillis)}),n("offline",function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return r(),[2]})})}}};function nU(e,t,n){var r,i,o=[];try{for(var s=(0,ev.__values)(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var l=a.value;try{o.push(new RegExp(l))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}var nq=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],nW="data-amp-track-",nz=["div","span","h1","h2","h3","h4","h5","h6"];function nV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nH(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nQ(e,t,n){return t&&nH(e.prototype,t),n&&nH(e,n),e}var n$=function(){return"function"==typeof Symbol},nK=function(e){return n$()&&!!Symbol[e]},nX=function(e){return nK(e)?Symbol[e]:"@@"+e};n$()&&!nK("observable")&&(Symbol.observable=Symbol("observable"));var nG=nX("iterator"),nZ=nX("observable"),nY=nX("species");function nJ(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw TypeError(n+" is not a function");return n}}function n0(e){var t=e.constructor;return void 0!==t&&null===(t=t[nY])&&(t=void 0),void 0!==t?t:n7}function n1(e){n1.log?n1.log(e):setTimeout(function(){throw e})}function n2(e){Promise.resolve().then(function(){try{e()}catch(e){n1(e)}})}function n3(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=nJ(t,"unsubscribe");n&&n.call(t)}}catch(e){n1(e)}}function n4(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function n8(e,t,n){e._state="running";var r=e._observer;try{var i=nJ(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(n4(e),i)i.call(r,n);else throw n;break;case"complete":n4(e),i&&i.call(r)}}catch(e){n1(e)}"closed"===e._state?n3(e):"running"===e._state&&(e._state="ready")}function n6(e,t,n){if("closed"!==e._state){if("buffering"===e._state)return void e._queue.push({type:t,value:n});if("ready"!==e._state){e._state="buffering",e._queue=[{type:t,value:n}],n2(function(){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(n8(e,t[n].type,t[n].value),"closed"!==e._state);++n);}});return}n8(e,t,n)}}var n5=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new n9(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(n4(this),n3(this))},nQ(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),n9=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){n6(this._subscription,"next",e)},t.error=function(e){n6(this._subscription,"error",e)},t.complete=function(){n6(this._subscription,"complete")},nQ(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),n7=function(){function e(t){if(!(this instanceof e))throw TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return("object"!=typeof e||null===e)&&(e={next:e,error:arguments[1],complete:arguments[2]}),new n5(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise(function(n,r){if("function"!=typeof e)return void r(TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n})})},t.map=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");return new(n0(this))(function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})},t.filter=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");return new(n0(this))(function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})})},t.reduce=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");var n=n0(this),r=arguments.length>1,i=!1,o=arguments[1],s=o;return new n(function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{s=e(s,t)}catch(e){return n.error(e)}else s=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(TypeError("Cannot reduce an empty sequence"));n.next(s),n.complete()}})})},t.concat=function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n0(this);return new i(function(t){var r,o=0;return!function e(s){r=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}})},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw TypeError(e+" is not a function");var n=n0(this);return new n(function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),o.unsubscribe()}})},t[nZ]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw TypeError(t+" is not an object");var r=nJ(t,nZ);if(r){var i=r.call(t);if(Object(i)!==i)throw TypeError(i+" is not an object");return i instanceof n7&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(nK("iterator")&&(r=nJ(t,nG)))return new n(function(e){n2(function(){if(!e.closed){for(var n,i=function(e,t){var n="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return nV(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nV(e,void 0)}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}})});if(Array.isArray(t))return new n(function(e){n2(function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}})});throw TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)(function(e){n2(function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}})})},nQ(e,null,[{key:nY,get:function(){return this}}]),e}();function re(e,t){return new n7(function(n){e.subscribe({next:function(e){t(e).then(function(e){return n.next(e)}).catch(function(e){return n.error(e)})},error:function(e){n.error(e)},complete:function(){n.complete()}})})}function rt(e,t){return new n7(function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=(0,ev.__values)(i),o=n.next();!o.done;o=n.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return s(e),s(t),o})}function rn(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new n7(function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){try{for(var n,r,i,o=(0,ev.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;null==(i=a.next)||i.call(a,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){try{for(var n,i,o,s=(0,ev.__values)(t),a=s.next();!a.done;a=s.next()){var l=a.value;null==(o=l.error)||o.call(l,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r()},complete:function(){try{for(var e,n,i,o=(0,ev.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;null==(i=a.complete)||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}})}n$()&&Object.defineProperty(n7,Symbol("extensions"),{value:{symbol:nZ,hostReportError:n1},configurable:!0});var rr="1.18.7",ri="[Amplitude] Element Clicked",ro="[Amplitude] Element Tag",rs="[Amplitude] Element Text",ra="[Amplitude] Page URL",rl="https://app.amplitude.com",ru={US:rl,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},rc="data-amp-mask-attributes",rh=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},rd=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},rf=["input","select","textarea"],rp=function(e,t){var n,r=null==(n=null==window?void 0:window.getComputedStyle)?void 0:n.call(window,e);return(null==r?void 0:r.getPropertyValue("cursor"))==="pointer"&&"click"===t},rg=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.pageUrlAllowlist,l=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,c=null==(s=null==(o=null==i?void 0:i.tagName)?void 0:o.toLowerCase)?void 0:s.call(o);if(!c)return!1;if(u)return u(r,i);if(!rh(window.location.href,a)||l&&l.length>0&&rh(window.location.href,l))return!1;var h=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof h)switch(h.toLowerCase()){case"hidden":case"password":return!1}var d=rp(i,r);if(n&&d)return!0;if(t&&!t.some(function(e){var t;return!!(null==(t=null==i?void 0:i.matches)?void 0:t.call(i,e))}))return!1;switch(c){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:if(d)return!0;return"click"===r}}},rm=function(e){var t,n,r,i=null==(n=null==(t=null==e?void 0:e.tagName)?void 0:t.toLowerCase)?void 0:n.call(t),o=e instanceof HTMLElement&&(null==(r=e.getAttribute("contenteditable"))?void 0:r.toLowerCase())==="true";return!rf.includes(i)&&!o},rv=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return null!=r&&("object"!=typeof r||0!==Object.keys(r).length)&&("string"!=typeof r||0!==r.trim().length)&&(t[n]=r),t},{})},ry=function(e,t){return e?t.some(function(t){var n;return null==(n=null==e?void 0:e.matches)?void 0:n.call(e,t)})?e:ry(null==e?void 0:e.parentElement,t):null},rb=function(e){return null!==e.event.target&&!!e.closestTrackedAncestor};(d=Y||(Y={}))[d.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",d[d.MIDDLE=1]="MIDDLE",d[d.RIGHT=2]="RIGHT";var rw=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",rc,nw]),rx=["type"],rS=["svg","path","g"],rk=["password","hidden"],r_=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;if(e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector)return n.querySelector(e.selector);return n}}catch(e){}},rO=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},rC=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return nO(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,s=performance.now(),a=[];if(!e)return[];for(var l=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),u=new Map,c=l.length-1;c>=0;c--){var h=l[c];if(h){var d,f=(d=h.getAttribute(rc))?d.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[],p=c===l.length-1?[]:null!=(r=u.get(l[c+1]))?r:new Set,g=new Set((0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(p),!1),(0,ev.__read)(f),!1));u.set(h,g)}}a=l.map(function(e){var t;return function(e,t){if(null===e)return null;var n,r,i,o,s,a,l=String(e.tagName).toLowerCase(),u={tag:l},c=Array.from(null!=(o=null==(i=e.parentElement)?void 0:i.children)?o:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var h=null==(a=null==(s=e.previousElementSibling)?void 0:s.tagName)?void 0:a.toLowerCase();h&&(u.prevSib=String(h));var d=e.getAttribute("id");d&&(u.id=String(d));var f=Array.from(e.classList);f.length&&(u.classes=f);var p={},g=Array.from(e.attributes).filter(function(e){return!rw.has(e.name)}),m=!rm(e);if(!rk.includes(String(e.getAttribute("type")))&&!rS.includes(l))try{for(var v=(0,ev.__values)(g),y=v.next();!y.done;y=v.next()){var b=y.value;if(!m||rx.includes(b.name)){if(t.has(b.name)){p[b.name]=nx;continue}p[b.name]=String(b.value).substring(0,128)}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=v.return)&&r.call(v)}finally{if(n)throw n.error}}return Object.keys(p).length&&(u.attrs=p),u}(e,null!=(t=u.get(e))?t:new Set)});var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=(0,ev.__read)(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))})};try{for(var v=(0,ev.__values)(a),y=v.next();!y.done;y=v.next()){var b=y.value;m(b)}}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}var w=performance.now();return null==(i=o.diagnosticsClient)||i.recordHistogram("autocapturePlugin.getHierarchy",w-s),a},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,s,a,l=null==(s=null==(i=null==t?void 0:t.tagName)?void 0:i.toLowerCase)?void 0:s.call(i),u="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},c=o.getHierarchy(t),h=null==(a=c[0])?void 0:a.attrs,d=o.getNearestLabel(t),f=Object.entries(null!=h?h:{}).reduce(function(e,t){var r=(0,ev.__read)(t,2),i=r[0],o=r[1];if(i.startsWith(n)){var s=i.replace(n,"");s&&(e[s]=o||"")}return e},{}),p=((r={})["[Amplitude] Element Hierarchy"]=c,r[ro]=l,r[rs]=o.getText(t),r["[Amplitude] Element Position Left"]=null==u.left?null:Math.round(u.left),r["[Amplitude] Element Position Top"]=null==u.top?null:Math.round(u.top),r["[Amplitude] Element Attributes"]=f,r["[Amplitude] Element Parent Label"]=d,r[ra]=rd(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=nC(o.replaceSensitiveString),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);if(p["[Amplitude] Element ID"]=t.getAttribute("id")||"",p["[Amplitude] Element Class"]=t.getAttribute("class"),p["[Amplitude] Element Aria Label"]=null==h?void 0:h["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var g=t.href.substring(0,128);p["[Amplitude] Element Href"]=o.replaceSensitiveString(g)}return rv(p)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(("click"===s.type||"change"===s.type)&&null!==s.event.target){if(i&&rp(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=ry(s.event.target,n);a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r))}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=r_(e,t);if(n){if("TEXT"===e.elementExtractType)return o.getText(n);if("ATTRIBUTE"===e.elementExtractType&&e.attribute)return n.getAttribute(e.attribute)}}},this.getText=function(e){if(null!==e.closest("[".concat(nw,"]")))return nx;var t="";if(e.querySelector("[".concat(nw,"], [contenteditable]"))){var n=e.cloneNode(!0);n.querySelectorAll("[".concat(nw,"], [contenteditable]")).forEach(function(e){e.innerText=nx}),t=n.innerText||""}else t=e.innerText||"";return o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){if(!e)return{};var t,n,r,i=null==(r=null==(n=null==e?void 0:e.tagName)?void 0:n.toLowerCase)?void 0:r.call(n);return rv(((t={})[ro]=i,t[rs]=o.getText(e),t[ra]=window.location.href.split("?")[0],t))},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!=(i=e.maskTextRegex)?i:[],a=[];try{for(var l=(0,ev.__values)(s),u=l.next();!u.done;u=l.next()){var c=u.value;if(a.length>=25)break;if(c instanceof RegExp)a.push(c);else if("pattern"in c&&"string"==typeof c.pattern)try{a.push(RegExp(c.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a},rE=function(){function e(e){var t=(void 0===e?{}:e).origin,n=this;this.endpoint=rl,this.requestCallbacks={},this.onSelect=function(e){n.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?n.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&n.notify({action:"track-selector-moved",data:t})},this.endpoint=void 0===t?rl:t}return e.prototype.notify=function(e){var t,n,r,i;null==(n=null==(t=this.logger)?void 0:t.debug)||n.call(t,"Message sent: ",JSON.stringify(e)),null==(i=null==(r=window.opener)?void 0:r.postMessage)||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout(function(){s(Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){null==(t=this.logger)||t.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.setup=function(e){var t=this,n=void 0===e?{dataExtractor:new rC({})}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,s=n.cssSelectorAllowlist,a=n.actionClickAllowlist,l=n.dataExtractor;this.logger=r,i&&this.endpoint===rl&&(this.endpoint=i);var u=null;window.addEventListener("message",function(e){if(null==(r=null==(n=t.logger)?void 0:n.debug)||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var n,r,i,c,h,d=null==e?void 0:e.data,f=null==d?void 0:d.action;if(f)if("id"in d)null==(c=null==(i=t.logger)?void 0:i.debug)||c.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(d);else if("ping"===f)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===f){var p,g=null==d?void 0:d.data;(p="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise(function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=p,r.addEventListener("load",function(){e({status:!0})},{once:!0}),r.addEventListener("error",function(){t({status:!1,message:"Failed to load the script ".concat(p)})}),null==(n=document.head)||n.appendChild(r)}catch(e){t(e)}})).then(function(){var e;u=null==(e=null==window?void 0:window.amplitudeVisualTaggingSelector)?void 0:e.call(window,{getEventTagProps:l.getEventTagProps,isElementSelectable:function(e){return!o||o((null==g?void 0:g.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:s,actionClickAllowlist:a,extractDataFromDataSource:l.extractDataFromDataSource,dataExtractor:l,diagnostics:{autocapture:{version:rr}}}),t.notify({action:"selector-loaded"})}).catch(function(){var e;null==(e=t.logger)||e.warn("Failed to initialize visual tagging selector")})}else"close-visual-tagging-selector"===f&&(null==(h=null==u?void 0:u.close)||h.call(u))}}),this.notify({action:"page-loaded"})},e}(),rT=(0,eU.getGlobalScope)();null==rT||rT.console;var rP=(0,eU.getGlobalScope)(),rA=function(){return new n7(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},rR=function(e){return void 0===e&&(e="click"),new n7(function(t){var n=function(e){t.next(e)};return rP.document.addEventListener(e,n,{capture:!0}),function(){rP.document.removeEventListener(e,n,{capture:!0})}})},rM=function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){console.error("Error matching event to filter",e)}return!1},rI={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},rD=function(e){var t,n,r,i,o=Object.values(rI).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return o;try{for(var s=(0,ev.__values)(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{try{for(var u=(r=void 0,(0,ev.__values)(l.definition)),c=u.next();!c.done;c=u.next()){var h=rI[c.value.event_type];h&&o[h].add(l.id)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},rL=function(e){var t,n,r,i,o=new Map;try{for(var s=(0,ev.__values)(e),a=s.next();!a.done;a=s.next()){var l=a.value;try{for(var u=(r=void 0,(0,ev.__values)(l.conditions)),c=u.next();!c.done;c=u.next()){var h=c.value;if("LABELED_EVENT"===h.type){var d=h.match.eventId,f=o.get(d);f||(f=[],o.set(d,f)),f.push(l)}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},rN=function(e,t){var n,r,i,o,s=new Set;try{for(var a=(0,ev.__values)(e),l=a.next();!l.done;l=a.next()){var u=l.value,c=t.get(u.id);if(c)try{for(var h=(i=void 0,(0,ev.__values)(c)),d=h.next();!d.done;d=h.next()){var f=d.value;s.add(f)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)},rB=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=rN(Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]}).filter(function(t){return t.definition.some(function(t){return rI[t.event_type]===e.type&&t.filters.every(function(t){return rM(e,t)})})}),this.labeledEventToTriggerMap);try{for(var o=(0,ev.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value;rO(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}();(f=J||(J={})).ClickObservable="clickObservable",f.ChangeObservable="changeObservable",f.NavigateObservable="navigateObservable",f.MutationObservable="mutationObservable",f.BrowserErrorObservable="browserErrorObservable",f.SelectionObservable="selectionObservable";var rF=function(e,t){void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",rr);var n,r,i,o,s,a,l,u,c=e.dataAttributePrefix,h=void 0===c?nW:c,d=e.visualTaggingOptions,f=void 0===d?{enabled:!0,messenger:new rE}:d;e.cssSelectorAllowlist=null!=(n=e.cssSelectorAllowlist)?n:nq,e.actionClickAllowlist=null!=(r=e.actionClickAllowlist)?r:nz,e.debounceTime=null!=(i=e.debounceTime)?i:0,e.pageUrlExcludelist=null==(o=e.pageUrlExcludelist)?void 0:o.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(e){console.warn("Invalid regex pattern: ".concat(t.pattern),e)}return e},[]);var p="@amplitude/plugin-autocapture-browser",g=[],m=new rC(e,t),v=function(){var t,n,r=rn(rR().map(function(t){return m.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,h)})),i=rn(new n7(function(t){var n,r=function(n){var r=m.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,h);t.next(r)};return null==(n=(0,eU.getGlobalScope)())||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null==(e=(0,eU.getGlobalScope)())?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(n=rn(new n7(function(t){var n=function(n){var r=m.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,h);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var o=rn(rA().map(function(t){return m.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,h)}));return(t={})[J.ChangeObservable]=i,t[J.ClickObservable]=r,t[J.MutationObservable]=o,t[J.NavigateObservable]=n,t},y=rD(Object.values(null!=(a=null==(s=e.pageActions)?void 0:s.labeledEvents)?a:{})),b=rL(null!=(u=null==(l=e.pageActions)?void 0:l.triggers)?u:[]),w=new rB(y,b,m,e),x=function(t){var n,r;t&&(e.pageActions=(0,ev.__assign)((0,ev.__assign)({},e.pageActions),t),y=rD(Object.values(null!=(n=e.pageActions.labeledEvents)?n:{})),b=rL(null!=(r=e.pageActions.triggers)?r:[]),w.update(y,b,e))};return{name:p,type:"enrichment",setup:function(t,n){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var r,i,o,s,a,l,u,c,d,y;return(0,ev.__generator)(this,function(b){var S,k,_,O,C,E,T,P,A,R,M,I,D,L,N,B,F,j,U,q,W,z,V,H,Q,$;return"u"<typeof document?[2]:(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(e){x(e)}):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=rg(e,e.cssSelectorAllowlist),i=rg(e,e.actionClickAllowlist),k=(S={allObservables:o=v(),amplitude:n,shouldTrackEvent:r,evaluateTriggers:w.evaluate.bind(w)}).amplitude,_=S.allObservables,O=S.shouldTrackEvent,C=S.evaluateTriggers,s=_.clickObservable.filter(rb).filter(function(e){return O("click",e.closestTrackedAncestor)}).map(function(e){return C(e)}).subscribe(function(e){null==k||k.track(ri,e.targetElementProperties)}),g.push(s),T=(E={allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m.getEventProperties.apply(m,(0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(e),!1),[h],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:w.evaluate.bind(w)}).amplitude,P=E.allObservables,A=E.getEventProperties,R=E.shouldTrackEvent,M=E.evaluateTriggers,a=P.changeObservable.filter(rb).filter(function(e){return R("change",e.closestTrackedAncestor)}).map(function(e){return M(e)}).subscribe(function(e){null==T||T.track("[Amplitude] Element Changed",A("change",e.closestTrackedAncestor))}),g.push(a),D=(I={allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return m.getEventProperties.apply(m,(0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(e),!1),[h],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}).amplitude,L=I.allObservables,N=I.options,B=I.getEventProperties,F=I.shouldTrackEvent,j=I.shouldTrackActionClick,U=L.clickObservable,q=L.mutationObservable,W=L.navigateObservable,z=U.filter(function(e){return!F("click",e.closestTrackedAncestor)}).map(function(e){var t=ry(e.event.target,N.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=B(e.type,e.closestTrackedAncestor)),e}).filter(rb).filter(function(e){return j("click",e.closestTrackedAncestor)}),V=W?rt(q,W):q,H=rt(z,V),Q=null,$=null,(l=re(H,function(e){if(Q&&(clearTimeout(Q),Q=null),"click"===e.type)$=e,Q=setTimeout(function(){Q=null,$=null},500);else if($){var t=$;return $=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==D||D.track(ri,B("click",e.closestTrackedAncestor)))}))&&g.push(l),null==(d=null==t?void 0:t.loggerProvider)||d.log("".concat(p," has been successfully added.")),window.opener&&f.enabled&&(u=e.cssSelectorAllowlist,c=e.actionClickAllowlist,null==(y=f.messenger)||y.setup((0,ev.__assign)((0,ev.__assign)({dataExtractor:m,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:ru[t.serverZone]}),{isElementSelectable:rg(e,(0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(u),!1),(0,ev.__read)(c),!1)),cssSelectorAllowlist:u,actionClickAllowlist:c}))),[2])})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,ev.__generator)(this,function(i){try{for(t=(e=(0,ev.__values)(g)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]})})}}},rj=(0,ev.__spreadArray)(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],(0,ev.__read)(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),rU=["*"],rq=["mutation","navigate"];function rW(e,t){var n,r,i,o,s=t.event,a=s.pageX,l=s.pageY;e.yMin=Math.min(null!=(n=e.yMin)?n:l,l),e.yMax=Math.max(null!=(r=e.yMax)?r:l,l),e.xMin=Math.min(null!=(i=e.xMin)?i:a,a),e.xMax=Math.max(null!=(o=e.xMax)?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function rz(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:(0,ev.__assign)({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function rV(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var rH=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.deadClicks&&null!==e.deadClicks,o=!1!==e.rageClicks&&null!==e.rageClicks,s=rV(e,"rageClicks",rU,o),a=rV(e,"deadClicks",rj,i),l=null!=(t=e.dataAttributePrefix)?t:nW,u=new rC(e),c=(0,ev.__spreadArray)([],(0,ev.__read)(new Set((0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(s),!1),(0,ev.__read)(a),!1))),!1),h=function(){var e,t,n=rn(rR("pointerdown").map(function(e){return u.addAdditionalEventProperties(e,"click",c,l,!0)})),r=rn(rA().map(function(e){return u.addAdditionalEventProperties(e,"mutation",c,l)}));window.navigation&&(t=rn(new n7(function(e){var t=function(t){e.next((0,ev.__assign)((0,ev.__assign)({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}}).map(function(e){return u.addAdditionalEventProperties(e,"navigate",c,l)})));var i=rn(new n7(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){var n=void 0,r=void 0;try{if(n=t.selectionStart,r=t.selectionEnd,n===r)return}catch(e){return}return e.next()}var i=window.getSelection();if(i&&!i.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}));return(e={})[J.ClickObservable]=n,e[J.MutationObservable]=r,e[J.NavigateObservable]=t,e[J.SelectionObservable]=i,e};return{name:n,type:"enrichment",setup:function(t,c){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var d,f,p,g;return(0,ev.__generator)(this,function(m){if("u"<typeof document)return[2];if(d=h(),o&&(f=function(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=r.selectionObservable,a=[],l={},u=null;function c(e){a=[],l={},e&&(rW(l,e),a.push(e))}var h=re(o.filter(function(e){return i("click",e.closestTrackedAncestor)}),function(e){return(0,ev.__awaiter)(t,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){var r,i,o,s;return(rW(l,e),t=null,0===a.length||(r=a).length>0&&r[r.length-1].closestTrackedAncestor!==e.closestTrackedAncestor||(o=Math.max(0,(i=a).length-4+1),s=i[o],e.timestamp-s.timestamp>=1e3)||l.isOutOfBounds)?(u&&(t=rz(a)),c(e)):a.push(e),(u&&(clearTimeout(u.timerId),u.resolve(t),u=null),a.length>=4)?[2,new Promise(function(e){u={resolve:e,timerId:setTimeout(function(){e(rz(a))},1e3)}})]:[2,null]})})}),d=null==s?void 0:s.subscribe(function(){c()}),f=h.subscribe(function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){f.unsubscribe(),null==d||d.unsubscribe()}}}({allObservables:d,amplitude:c,shouldTrackRageClick:rg(e,s)}),r.push(f)),i){var v,y,b,w,x,S,k,_,O,C,E,T;y=(v={amplitude:c,allObservables:d,getEventProperties:function(e,t){return u.getEventProperties(e,t,l)},shouldTrackDeadClick:rg(e,a)}).amplitude,b=v.allObservables,w=v.getEventProperties,x=v.shouldTrackDeadClick,S=b.clickObservable,k=b.mutationObservable,_=b.navigateObservable,O=S.filter(function(e){return rb(e)&&x("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Y.LEFT_OR_TOUCH_CONTACT}),C=_?rt(k,_):k,E=rt(O,C),T=null,p=re(E,function(e){if(T&&rq.includes(e.type))clearTimeout(T),T=null;else if("click"===e.type)return T?Promise.resolve(null):new Promise(function(t){T=setTimeout(function(){t(e),T=null},3e3)});return Promise.resolve(null)}).subscribe(function(e){if(e){var t={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};y.track("[Amplitude] Dead Click",(0,ev.__assign)((0,ev.__assign)({},w("click",e.closestTrackedAncestor)),t),{time:e.timestamp})}}),r.push(p)}return null==(g=null==t?void 0:t.loggerProvider)||g.log("".concat(n," has been successfully added.")),[2]})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,i;return(0,ev.__generator)(this,function(o){try{for(t=(e=(0,ev.__values)(r)).next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]})})}}};function rQ(e,t,n){e&&function e(t){var n,r,i=t.json,o=t.targetObject,s=t.allowlist,a=t.excludelist,l=t.ancestors,u=t.parentObject,c=t.targetKey;o||(o=i);var h=Object.keys(o);try{for(var d=(0,ev.__values)(h),f=d.next();!f.done;f=d.next()){var p,g=f.value,m=(0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(l),!1),[g],!1);(p=o[g],"string"==typeof p||"number"==typeof p||"boolean"==typeof p||null==p)?(!rK(m,s)||rK(m,a))&&delete o[g]:e({json:i,targetObject:o[g],allowlist:s,excludelist:a,ancestors:m,parentObject:o,targetKey:g})}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}0===Object.keys(o).length&&u&&c&&delete u[c]}({json:e,allowlist:t.map(r$),excludelist:n.map(r$),ancestors:[]})}function r$(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")})}function rK(e,t){return t.some(function(t){return function e(t,n,r,i){if(void 0===r&&(r=0),void 0===i&&(i=0),i===n.length)return r===t.length;if(r===t.length){for(;i<n.length&&"**"===n[i];)i++;return i===n.length}var o=n[i];if("**"===o){if(i+1===n.length)return!0;for(var s=r;s<=t.length;s++)if(e(t,n,s,i+1))return!0;return!1}return("*"===o||o===t[r])&&e(t,n,r+1,i+1)}(e,t)})}var rX=function(){function e(e){this.request=e}return e.prototype.headers=function(e){void 0===e&&(e=[]);var t,n,r=this.request.headers,i={};if(Array.isArray(r))r.forEach(function(e){var t=(0,ev.__read)(e,2),n=t[0],r=t[1];i[n]=r});else if(r instanceof Headers)r.forEach(function(e,t){i[t]=e});else if("object"==typeof r&&null!==r)try{for(var o=(0,ev.__values)(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=(0,ev.__read)(s.value,2),l=a[0],u=a[1];i[l]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r2(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=(0,eU.getGlobalScope)();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=rZ(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return 0===e.length?[2,null]:[2,r0(this.body,e,t)]})})},e}(),rG=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),r2(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return rZ(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return 0===e.length?[2,null]:[2,r0(this.body,e,t)]})})},e}();function rZ(e,t){var n,r,i,o,s=(0,eU.getGlobalScope)(),a=null==s?void 0:s.TextEncoder;if(a){if("string"==typeof e)o=e,i=new a().encode(o).length;else if(e instanceof Blob)i=(o=e).size;else if(e instanceof URLSearchParams)o=e,i=new a().encode(o.toString()).length;else if(ArrayBuffer.isView(e))i=(o=e).byteLength;else if(e instanceof ArrayBuffer)i=(o=e).byteLength;else if(e instanceof FormData){var l=0,u=0;try{for(var c=(0,ev.__values)(e.entries()),h=c.next();!h.done;h=c.next()){var d=(0,ev.__read)(h.value,2),f=d[0],p=d[1];if(l+=f.length,"string"==typeof p)l+=new a().encode(p).length;else{if(!(p instanceof Blob))return;l+=p.size}if(++u>=t)return}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}i=l}else if(e instanceof ReadableStream){o=e;return}return i}}var rY=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null==(t=null==n?void 0:n.forEach)||t.call(n,function(e,t){r[t]=e}),r2(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(void 0!==this._bodySize)return this._bodySize;var e,t,n=null==(t=null==(e=this.response.headers)?void 0:e.get)?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){switch(e.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Promise.race([this.clonedResponse.text(),new Promise(function(e){return setTimeout(function(){return e(null)},500)})])];case 2:return[2,e.sent()];case 3:return e.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){switch(n.label){case 0:if(0===e.length)return[2,null];return[4,this.text()];case 1:return[2,r0(n.sent(),e,t)]}})})},e}(),rJ=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){if(void 0===e&&(e=[]),!this.headersString)return{};var t,n,r={},i=this.headersString.split("\r\n");try{for(var o=(0,ev.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value,l=(0,ev.__read)(a.split(": "),2),u=l[0],c=l[1];u&&c&&(r[u]=c)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r2(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),(0,ev.__awaiter)(this,void 0,void 0,function(){var n;return(0,ev.__generator)(this,function(r){return 0===e.length?[2,null]:(n=this.getJson())?(rQ(n,e,t),[2,n]):[2,null]})})},e}();function r0(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return rQ(r,t,n),r}catch(e){return null}}(p=ee||(ee={})).REDACT="redact",p.REMOVE="remove";var r1="[REDACTED]",r2=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?ee.REMOVE:s,l=(0,ev.__spreadArray)([],(0,ev.__read)(eD),!1),u={};try{for(var c=(0,ev.__values)(Object.keys(e)),h=c.next();!h.done;h=c.next()){var d=h.value;!function(t){var n=t.toLowerCase();l.find(function(e){return e.toLowerCase()===n})?a===ee.REDACT&&(u[t]=r1):o.find(function(e){return e.toLowerCase()===n})?u[t]=e[t]:a===ee.REDACT&&(u[t]=r1)}(d)}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return u},r3=function(){function e(e,t,n,r,i,o,s,a,l,u,c){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=l,this.error=u,this.endTime=c}return e.prototype.toSerializable=function(){var e,t,n,r;return Object.fromEntries(Object.entries({type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null==(e=this.requestWrapper)?void 0:e.headers((0,ev.__spreadArray)([],(0,ev.__read)(eI),!1)),requestBodySize:null==(t=this.requestWrapper)?void 0:t.bodySize,responseHeaders:null==(n=this.responseWrapper)?void 0:n.headers((0,ev.__spreadArray)([],(0,ev.__read)(eI),!1)),responseBodySize:null==(r=this.responseWrapper)?void 0:r.bodySize}).filter(function(e){var t=(0,ev.__read)(e,2);return void 0!==(t[0],t[1])}))},e}(),r4=function(e,t){void 0===t&&(t=eW()),this.callback=e,this.id=t},r8=new(function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=(0,eU.getGlobalScope)();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=(0,eU.getGlobalScope)();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,l,u,c,h;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var d=null==(i=null==(r=null==(n=this.globalScope)?void 0:n.XMLHttpRequest)?void 0:r.prototype)?void 0:i.open,f=null==(a=null==(s=null==(o=this.globalScope)?void 0:o.XMLHttpRequest)?void 0:s.prototype)?void 0:a.send,p=null==(c=null==(u=null==(l=this.globalScope)?void 0:l.XMLHttpRequest)?void 0:u.prototype)?void 0:c.setRequestHeader;d&&f&&p&&this.observeXhr(d,f,p);var g=null==(h=this.globalScope)?void 0:h.fetch;g&&this.observeFetch(g),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach(function(n){var r;try{n.callback(e)}catch(e){null==(r=t.logger)||r.debug("an unexpected error occurred while triggering event callbacks",e)}})},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){if(void 0!==o&&void 0!==s){var a,l,u,c,h="GET";if("object"==typeof t&&null!==t&&"url"in t&&"method"in t?(l=t.url,h=t.method):l=null==(a=null==t?void 0:t.toString)?void 0:a.call(t),l)try{var d=new URL(l);l="".concat(d.protocol,"//").concat(d.host).concat(d.pathname).concat(d.search).concat(d.hash)}catch(e){}h=(null==n?void 0:n.method)||h,r&&(u=r.status),i&&(c={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var f=Math.floor(performance.now()-s),p=Math.floor(o+f),g=new r3(e,h,o,o,l,n,u,f,r,c,p);this.triggerEventCallbacks(g)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null==(e=Date.now)?void 0:e.call(Date),durationStart:null==(t=null==performance?void 0:performance.now)?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return(0,ev.__awaiter)(t,void 0,void 0,function(){var t,i,o,s,a;return(0,ev.__generator)(this,function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){null==(s=this.logger)||s.debug("an unexpected error occurred while retrieving timestamps",e)}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=l.sent(),[3,4];case 3:return o=l.sent(),[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new rX(r):void 0,i?new rY(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null==(a=this.logger)||a.debug("an unexpected error occurred while handling fetch",e)}if(i)return[2,i];throw o}})})})},e.createXhrJsonParser=function(e,t){return function(){var n,r;try{if("json"===e.responseType){if(null==(n=t.globalScope)?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){n instanceof Error&&"InvalidStateError"===n.name&&(null==(r=t.logger)||r.error("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'")))}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=(0,ev.__read)(r,2),a=s[0],l=s[1];try{this.$$AmplitudeAnalyticsEvent=(0,ev.__assign)({method:a,url:null==(e=null==l?void 0:l.toString)?void 0:e.call(l),headers:{}},o.getTimestamps())}catch(e){null==(n=o.logger)||n.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,r)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",function(){var e;try{var t=i.getAllResponseHeaders(),n=i.getResponseHeader("content-length"),r=new rJ(i.status,t,n?parseInt(n,10):void 0,s),u=i.$$AmplitudeAnalyticsEvent.headers,c=new rG(a,u);l.status=i.status,o.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,r,void 0,l.startTime,l.durationStart)}catch(t){null==(e=o.logger)||e.error("an unexpected error occurred while handling xhr send",t)}}),n.apply(i,t)},i.setRequestHeader=function(e,t){var n;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null==(n=o.logger)||n.error("an unexpected error occurred while calling xhr setRequestHeader",e)}r.apply(this,[e,t])}}},e}()),r6="[Amplitude] Network Request",r5="500-599";function r9(e,t){return RegExp("^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$").test(e)}function r7(e,t){var n,r,i=t.split(",");try{for(var o=(0,ev.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value,l=(0,ev.__read)(a.split("-").map(Number),2),u=l[0],c=l[1];if(e===u&&void 0===c||e>=u&&e<=c)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function ie(e){var t;if(e)try{var n=null==(t=(0,eU.getGlobalScope)())?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;r.hash="",r.search="";var l=r.href;return{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:l,host:a}}catch(e){return}}function it(e){return"object"!=typeof e||null===e?e?(0,ev.__spreadArray)([],(0,ev.__read)(eI),!1):void 0:0!==e.length?e:void 0}function ir(e){var t,n;return!(null==(t=null==e?void 0:e.allowlist)?void 0:t.length)&&!(null==(n=null==e?void 0:e.blocklist)?void 0:n.length)}(et||(et={})).NetworkObservable="networkObservable";var ii=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new n7(function(e){var n=new r4(function(t){var n={event:t,timestamp:Date.now(),type:"network"};e.next(n)});return r8.subscribe(n,t),function(){r8.unsubscribe(n)}});return(e={})[et.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var s;return(0,ev.__generator)(this,function(a){var l,u,c,h,d;return"u"<typeof document?[2]:(s=r(),t=null==i?void 0:i.loggerProvider,u=(l={allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}).allObservables,c=l.networkTrackingOptions,h=l.amplitude,d=l.loggerProvider,en=u.networkObservable.filter(function(e){return function(e,t){void 0===t&&(t={});var n,r,i=ie(e.url);if(!i)return!1;var o=i.host;return!(!1!==t.ignoreAmplitudeRequests&&(r9(o,"*.amplitude.com")||r9(o,"amplitude.com"))||(null==(n=t.ignoreHosts)?void 0:n.find(function(e){return r9(o,e)})))&&(!!t.captureRules||void 0===e.status||!!r7(e.status,r5))&&(!t.captureRules||((0,ev.__spreadArray)([],(0,ev.__read)(t.captureRules),!1).reverse().find(function(t){if(r=function(e,t,n,r,i){if((!e.hosts||e.hosts.find(function(e){return r9(t,e)}))&&(!r||!e.urls||rh(r,e.urls))&&(!i||!e.methods||e.methods.find(function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))return(!n&&0!==n||!!r7(n,e.statusCodeRange||r5))&&!0}(t,o,e.status,e.url,e.method)){var n=it(t.responseHeaders);if(e.responseWrapper&&n){var i=e.responseWrapper.headers(n);i&&(e.responseHeaders=i)}var s=it(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!ir(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!ir(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==r}),!!r))&&!(e.requestWrapper&&function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find(function(e){return e.event_type===r6}))return!0}catch(e){}return!1}(o,e.requestWrapper))}(e.event,c)}).subscribe(function(e){var t,n,r,i=e.event,o=ie(i.url);if(o){var s=null==(n=i.responseWrapper)?void 0:n.bodySize,a=null==(r=i.requestWrapper)?void 0:r.bodySize;!function(e,t,n,r){(0,ev.__awaiter)(this,void 0,void 0,function(){var i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(!(t.requestBodyJson||t.responseBodyJson))return[3,2];return[4,Promise.all([t.requestBodyJson,t.responseBodyJson])];case 1:if(o=(i=ev.__read.apply(void 0,[a.sent(),2]))[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(r6,e),[2]}})})}(((t={})["[Amplitude] URL"]=o.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=o.query,t["[Amplitude] URL Fragment"]=o.fragment,t["[Amplitude] Request Method"]=i.method,t["[Amplitude] Status Code"]=i.status,t["[Amplitude] Start Time"]=i.startTime,t["[Amplitude] Completion Time"]=i.endTime,t["[Amplitude] Duration"]=i.duration,t["[Amplitude] Request Body Size"]=a,t["[Amplitude] Response Body Size"]=s,t["[Amplitude] Request Type"]=i.type,t["[Amplitude] Request Headers"]=i.requestHeaders,t["[Amplitude] Response Headers"]=i.responseHeaders,t),i,h,d)}}),null==t||t.log("".concat(n," has been successfully added.")),[2])})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return en.unsubscribe(),[2]})})}}};let io=-1,is=e=>{addEventListener("pageshow",t=>{t.persisted&&(io=t.timeStamp,e(t))},!0)},ia=(e,t,n,r)=>{let i,o;return s=>{let a;t.value>=0&&(s||r)&&((o=t.value-(i??0))||void 0===i)&&(i=t.value,t.delta=o,a=t.value,t.rating=a>n[1]?"poor":a>n[0]?"needs-improvement":"good",e(t))}},il=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},iu=()=>{let e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ic=()=>{let e=iu();return e?.activationStart??0},ih=(e,t=-1)=>{let n=iu(),r="navigate";return io>=0?r="back-forward-cache":n&&(document.prerendering||ic()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(0x82f79cd8fff*Math.random())+1e12}`,navigationType:r}},id=new WeakMap;function ip(e,t){return id.get(e)||id.set(e,new t),id.get(e)}class ig{t;i=0;o=[];h(e){if(e.hadRecentInput)return;let t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}let im=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},iv=e=>{let t=!1;return()=>{t||(e(),t=!0)}},iy=-1,ib=new Set,iw=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ix=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(let e of ib)e();isFinite(iy)||(iy="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",ix,!0))}},iS=()=>{if(iy<0){let e=ic();iy=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime)??iw(),addEventListener("visibilitychange",ix,!0),addEventListener("prerenderingchange",ix,!0),is(()=>{setTimeout(()=>{iy=iw()})})}return{get firstHiddenTime(){return iy},onHidden(e){ib.add(e)}}},ik=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},i_=[1800,3e3],iO=(e,t={})=>{ik(()=>{let n=iS(),r,i=ih("FCP"),o=im("paint",e=>{for(let t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-ic(),0),i.entries.push(t),r(!0)))});o&&(r=ia(e,i,i_,t.reportAllChanges),is(n=>{r=ia(e,i=ih("FCP"),i_,t.reportAllChanges),il(()=>{i.value=performance.now()-n.timeStamp,r(!0)})}))})},iC=[.1,.25],iE=0,iT=1/0,iP=0,iA=e=>{for(let t of e)t.interactionId&&(iT=Math.min(iT,t.interactionId),iE=(iP=Math.max(iP,t.interactionId))?(iP-iT)/7+1:0)},iR=()=>t?iE:performance.interactionCount??0,iM=0;class iI{u=[];l=new Map;m;p;v(){iM=iR(),this.u.length=0,this.l.clear()}L(){let e=Math.min(this.u.length-1,Math.floor((iR()-iM)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;let t=this.u.at(-1),n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10)for(let e of this.u.splice(10))this.l.delete(e.id);this.p?.(n)}}}let iD=e=>{let t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(addEventListener("visibilitychange",e=iv(e),{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},iL=[200,500];class iN{m;h(e){this.m?.(e)}}let iB=[2500,4e3],iF=[800,1800],ij=e=>{document.prerendering?ik(()=>ij(e)):"complete"!==document.readyState?addEventListener("load",()=>ij(e),!0):setTimeout(e)};function iU(e){var t,n;return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor((n=(null==(t=e.entries[0])?void 0:t.startTime)||0,performance.timeOrigin+n)),navigationStart:Math.floor(performance.timeOrigin)}}var iq=function(){var e=null,n=(0,eU.getGlobalScope)(),r=null==n?void 0:n.document,i=null==n?void 0:n.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(n,o){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var s,a;return(0,ev.__generator)(this,function(l){return void 0===r||(s=rd((null==i?void 0:i.href)||"",n.loggerProvider),a={"[Amplitude] Page Domain":(null==i?void 0:i.hostname)||"","[Amplitude] Page Location":s,"[Amplitude] Page Path":rd((null==i?void 0:i.pathname)||"",n.loggerProvider),"[Amplitude] Page Title":"u">typeof document&&document.title||"","[Amplitude] Page URL":rd(s.split("?")[0],n.loggerProvider)},((e,t={})=>{ik(()=>{let n=iS(),r,i=ih("LCP"),o=ip(t,iN),s=e=>{for(let s of(t.reportAllChanges||(e=e.slice(-1)),e))o.h(s),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-ic(),0),i.entries=[s],r())},a=im("largest-contentful-paint",s);if(a){r=ia(e,i,iB,t.reportAllChanges);let n=iv(()=>{s(a.takeRecords()),a.disconnect(),r(!0)}),o=e=>{e.isTrusted&&(iD(n),removeEventListener(e.type,o,{capture:!0}))};for(let e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});is(n=>{r=ia(e,i=ih("LCP"),iB,t.reportAllChanges),il(()=>{i.value=performance.now()-n.timeStamp,r(!0)})})}})})(function(e){a["[Amplitude] LCP"]=iU(e)}),iO(function(e){a["[Amplitude] FCP"]=iU(e)}),((e,n={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;let r=iS();ik(()=>{"interactionCount"in performance||t||(t=im("event",iA,{type:"event",buffered:!0,durationThreshold:0}));let i,o=ih("INP"),s=ip(n,iI),a=e=>{iD(()=>{for(let t of e)s.h(t);let t=s.L();t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,i())})},l=im("event",a,{durationThreshold:n.durationThreshold??40});i=ia(e,o,iL,n.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(l.takeRecords()),i(!0)}),is(()=>{s.v(),i=ia(e,o=ih("INP"),iL,n.reportAllChanges)}))})})(function(e){a["[Amplitude] INP"]=iU(e)}),((e,t={})=>{let n=iS();iO(iv(()=>{let r,i=ih("CLS",0),o=ip(t,ig),s=e=>{for(let t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=im("layout-shift",s);a&&(r=ia(e,i,iC,t.reportAllChanges),n.onHidden(()=>{s(a.takeRecords()),r(!0)}),is(()=>{o.i=0,r=ia(e,i=ih("CLS",0),iC,t.reportAllChanges),il(()=>r())}),setTimeout(r))}))})(function(e){a["[Amplitude] CLS"]=iU(e)}),((e,t={})=>{let n=ih("TTFB"),r=ia(e,n,iF,t.reportAllChanges);ij(()=>{let i=iu();i&&(n.value=Math.max(i.responseStart-ic(),0),n.entries=[i],r(!0),is(()=>{(r=ia(e,n=ih("TTFB",0),iF,t.reportAllChanges))(!0)}))})})(function(e){a["[Amplitude] TTFB"]=iU(e)}),e=function(){"hidden"===r.visibilityState&&e&&(o.track("[Amplitude] Web Vitals",a),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return[2,e]})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]})})}}},iW=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),["AMP",t,e.substring(0,n)].filter(Boolean).join("_")},iz=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},iV=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=(0,ev.__rest)(e,["referrer","referring_domain"]),a=t||{},l=(a.referrer,a.referring_domain),u=(0,ev.__rest)(a,["referrer","referring_domain"]);if(iH(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Object.values(e).every(function(e){return!e})&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var c=JSON.stringify(s)!==JSON.stringify(u),h=iz(o||"")!==iz(l||""),d=!t||c||h;return d?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),d},iH=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},iQ=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},i$=function(){function e(e,t){var n;this.shouldTrackNewCampaign=!1,this.options=(0,ev.__assign)({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:iQ(null==(n=t.cookieOptions)?void 0:n.domain)},e),this.storage=t.cookieStorage,this.storageKey=iW(t.apiKey,"MKTG"),this.webExpStorageKey=iW(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=eM,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:if(t=ev.__read.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||th(this.sessionTimeout,this.lastEventTime),!iV(this.currentCampaign,this.previousCampaign,this.options,this.logger,e))return[3,3];return this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var e;return(0,ev.__generator)(this,function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:if(!(e=t.sent()))return[3,3];return[4,this.storage.remove(this.webExpStorageKey)];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||new nE().parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r=(t=this.currentCampaign,n=this.options,eV(Object.entries((0,ev.__assign)((0,ev.__assign)({},eM),t)).reduce(function(e,t){var r,i=(0,ev.__read)(t,2),o=i[0],s=i[1];return(e.setOnce("initial_".concat(o),null!=(r=null!=s?s:n.initialEmptyValue)?r:"EMPTY"),s)?e.set(o,s):e.unset(o)},new eB)));return e&&(r.event_id=e),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),iK="AMP_CURRENT_PAGE",iX="AMP_PREVIOUS_PAGE",iG="AMP_URL_INFO";(g=er||(er={})).Direct="direct",g.Internal="internal",g.External="external";var iZ=new Set([$.IDENTIFY,$.GROUP_IDENTIFY,$.REVENUE]),iY=function(e){var t=(void 0===e?{}:e).internalDomains,n=void 0===t?[]:t,r=(0,eU.getGlobalScope)(),i=void 0,o=!1,s=void 0,a=!1,l=!1,u=function(e){var t;try{var n=rd(e,s);t=new URL(n).hostname}catch(e){null==s||s.error("Could not parse URL: ",e)}return t},c=function(e){var t="u">typeof location&&location.hostname||"",r=e?u(e):void 0;if(!r)return er.Direct;var i=n.some(function(e){return -1!==t.indexOf(e)}),o=n.some(function(e){return -1!==r.indexOf(e)});return t===r||o&&i?er.Internal:er.External},h=function(){(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(!(i&&o))return[3,3];return[4,i.get(iG)];case 1:return e=a.sent(),t=rd("u">typeof location&&location.href||""),n=(null==e?void 0:e[iK])||"",r=void 0,r=t===n?(null==e?void 0:e[iX])||"":n||document.referrer||"",[4,i.set(iG,((s={})[iK]=t,s[iX]=r,s))];case 2:a.sent(),a.label=3;case 3:return[2]}})})};return{name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){switch(t.label){case 0:if((s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),l=!0,!r)return[3,2];return[4,(i=new t4(r.sessionStorage)).isEnabled()];case 1:o=t.sent(),r.addEventListener("popstate",h),a||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=(0,ev.__read)(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),l&&h()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=(0,ev.__read)(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),l&&h()}}),a=!0),t.label=2;case 2:return[2]}})})},execute:function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var t,n,r,s,a;return(0,ev.__generator)(this,function(l){switch(l.label){case 0:if(t=rd("u">typeof location&&location.href||""),!(i&&o))return[3,5];return[4,i.get(iG)];case 1:if(null==(n=l.sent())?void 0:n[iK])return[3,3];return[4,i.set(iG,((a={})[iK]=t,a[iX]=document.referrer||"",a))];case 2:l.sent(),l.label=3;case 3:return[4,i.get(iG)];case 4:if(r=l.sent(),s="",r&&(s=r[iX]||""),iZ.has(e.event_type))return[2,e];e.event_properties=(0,ev.__assign)((0,ev.__assign)({},e.event_properties||{}),{"[Amplitude] Page Domain":iJ(e,"[Amplitude] Page Domain","u">typeof location&&location.hostname||""),"[Amplitude] Page Location":iJ(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":iJ(e,"[Amplitude] Page Path","u">typeof location&&rd(location.pathname)||""),"[Amplitude] Page Title":iJ(e,"[Amplitude] Page Title",nC(nO)),"[Amplitude] Page URL":iJ(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":c(s)}),l.label=5;case 5:return[2,e]}})})},teardown:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){switch(e.label){case 0:if(r&&(r.removeEventListener("popstate",h),l=!1),!(i&&o))return[3,2];return[4,i.set(iG,{})];case 1:e.sent(),e.label=2;case 2:return[2]}})})}}};function iJ(e,t,n){return(e.event_properties||(e.event_properties={}),void 0===e.event_properties[t])?n:e.event_properties[t]}var i0=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return(0,ev.__extends)(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),e$(this._init((0,ev.__assign)((0,ev.__assign)({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s,a,l;return(0,ev.__awaiter)(this,void 0,void 0,function(){var u,c,h,d,f,p,g,m,v,y,b,w,x,S=this;return(0,ev.__generator)(this,function(k){var _,O,C,E,T,P,A;switch(k.label){case 0:if(this.initializing)return[2];if(this.initializing=!0,u=ny(t),c=null!=(n=t.loggerProvider)?n:new eZ,h=null!=(r=t.serverZone)?r:"US",f=this._diagnosticsSampleRate,p=null==(i=t.enableDiagnostics)||i,!u)return[3,2];return d=new tm(t.apiKey,c,h,null==(o=t.remoteConfig)?void 0:o.serverUrl),[4,new Promise(function(e){null==d||d.subscribe("configs.diagnostics.browserSDK","all",function(t,n,r){if(c.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(f=i);var o=t.enabled;"boolean"==typeof o&&(p=o)}e()})})];case 1:k.sent(),k.label=2;case 2:return(g=new tR(t.apiKey,c,h,{enabled:p,sampleRate:f})).setTag("library","".concat(t$,"/").concat(tQ)),"u">typeof navigator&&g.setTag("user_agent",navigator.userAgent),[4,(_=t.apiKey,O=t,C=this,E=g,T={loggerProvider:c,serverZone:h,enableDiagnostics:p,diagnosticsSampleRate:f},void 0===O&&(O={}),(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,l,u,c,h,d,f,p,g,m,v,y,b,w,x,S,k,P,A,R,M,I,D,L,N,B,F,j,U,q,W,z,V,H,Q,$,K,X,G,Z,Y,J,ee;return(0,ev.__generator)(this,function(et){switch(et.label){case 0:if(e=O.identityStorage||ng,x={},e===ng)return[3,1];return n="",[3,5];case 1:if(null==(k=null==(S=O.cookieOptions)?void 0:S.domain))return[3,2];return r=k,[3,4];case 2:return[4,(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:return[4,new tG().isEnabled()];case 1:if(!a.sent()||"u"<typeof location||!location.hostname)return[2,""];for(e=(0,location.hostname).split("."),t=[],n=eW(),r="AMP_TLDTEST_".concat(n.substring(0,8)),i=e.length-2;i>=0;--i)t.push(e.slice(i).join("."));i=0,a.label=2;case 2:if(!(i<t.length))return[3,7];return[4,(s=new tG({domain:"."+(o=t[i]),expirationDays:.003})).set(r,1)];case 3:return a.sent(),[4,s.get(r)];case 4:if(!a.sent())return[3,6];return[4,s.remove(r)];case 5:return a.sent(),[2,"."+o];case 6:return i++,[3,2];case 7:return[2,""]}})})];case 3:r=et.sent(),et.label=4;case 4:n=r,et.label=5;case 5:var en,er;return t=ev.__assign.apply(void 0,[(x.domain=n,x.expiration=365,x.sameSite="Lax",x.secure=!1,x.upgrade=!0,x),O.cookieOptions]),i={duplicateResolverFn:function(e){var n=tJ(e);return!!n&&t0(JSON.parse(n).cookieDomain,t.domain)},diagnosticsClient:E},[4,(en=o=nv(O.identityStorage,t,i),void 0===(er=null==(A=null==(P=O.cookieOptions)?void 0:P.upgrade)||A)&&(er=!0),(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r,i,o,s,a,l;return(0,ev.__generator)(this,function(u){switch(u.label){case 0:return e="".concat("amp","_").concat(_.substring(0,6)),[4,en.getRaw(e)];case 1:if(!(t=u.sent()))return[2,{optOut:!1}];if(!er)return[3,3];return[4,en.remove(e)];case 2:u.sent(),u.label=3;case 3:return r=(n=(0,ev.__read)(t.split("."),6))[0],i=n[1],o=n[2],s=n[3],a=n[4],l=n[5],[2,{deviceId:r,userId:ne(i),sessionId:t7(s),lastEventId:t7(l),lastEventTime:t7(a),optOut:!!o}]}})}))];case 6:return s=et.sent(),[4,o.get(t1(_))];case 7:return a=et.sent(),c=!(u=(l=tf()).ampTimestamp?Number(l.ampTimestamp):void 0)||Date.now()<u,h=null!=(L=null!=(D=null!=(I=null!=(R=O.deviceId)?R:c?null!=(M=l.ampDeviceId)?M:l.deviceId:void 0)?I:null==a?void 0:a.deviceId)?D:s.deviceId)?L:eW(),d=null!=(N=null==a?void 0:a.lastEventId)?N:s.lastEventId,f=null!=(B=null==a?void 0:a.lastEventTime)?B:s.lastEventTime,p=null!=(j=null!=(F=O.optOut)?F:null==a?void 0:a.optOut)?j:s.optOut,g=null!=(U=null==a?void 0:a.sessionId)?U:s.sessionId,m=null!=(W=null!=(q=O.userId)?q:null==a?void 0:a.userId)?W:s.userId,C.previousSessionDeviceId=null!=(z=null==a?void 0:a.deviceId)?z:s.deviceId,C.previousSessionUserId=null!=(V=null==a?void 0:a.userId)?V:s.userId,v={ipAddress:null==(Q=null==(H=O.trackingOptions)?void 0:H.ipAddress)||Q,language:null==(K=null==($=O.trackingOptions)?void 0:$.language)||K,platform:null==(G=null==(X=O.trackingOptions)?void 0:X.platform)||G},y=null==a?void 0:a.pageCounter,b=null==a?void 0:a.debugLogsEnabled,void 0!==O.autocapture&&(O.defaultTracking=O.autocapture),[4,(w=new nm(_,O.appVersion,o,t,O.defaultTracking,O.autocapture,h,O.flushIntervalMillis,O.flushMaxRetries,O.flushQueueSize,e,O.ingestionMetadata,O.instanceName,d,f,null!=(Z=null==T?void 0:T.loggerProvider)?Z:O.loggerProvider,O.logLevel,O.minIdLength,O.offline,p,O.partnerId,O.plan,O.serverUrl,null!=(Y=null==T?void 0:T.serverZone)?Y:O.serverZone,g,O.sessionTimeout,O.storageProvider,v,O.transport,O.useBatch,O.fetchRemoteConfig,m,y,b,O.networkTrackingOptions,O.identify,null!=(J=null==T?void 0:T.enableDiagnostics)?J:O.enableDiagnostics,null!=(ee=null==T?void 0:T.diagnosticsSampleRate)?ee:C._diagnosticsSampleRate,E,O.remoteConfig)).storageProvider.isEnabled()];case 8:return et.sent()||(w.loggerProvider.warn("Storage provider ".concat(w.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),w.storageProvider=new tX),[2,w]}})}))];case 3:if(m=k.sent(),!(u&&d))return[3,5];return[4,new Promise(function(e){null==d||d.subscribe("configs.analyticsSDK.browserSDK","all",function(t,n,r){m.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&function(e,t){if(e){!function e(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var n,r,i,o,s,a,l,u,c,h,d,f=Object.keys(t);try{for(var p=(0,ev.__values)(f),g=p.next();!g.done;g=p.next()){var m=g.value;try{var v=t[m];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(t[m]=!0)):t[m]=!1),e(v)}catch(e){}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{if(null==(c=null==(u=null==(l=t.autocapture)?void 0:l.networkTracking)?void 0:u.captureRules)?void 0:c.length)try{for(var y=(0,ev.__values)(t.autocapture.networkTracking.captureRules),b=y.next();!b.done;b=y.next()){var w=b.value;try{for(var x=(s=void 0,(0,ev.__values)(["responseHeaders","requestHeaders"])),S=x.next();!S.done;S=x.next()){var k=S.value,_=null!=(h=w[k])?h:{},O=_.captureSafeHeaders,C=_.allowlist;if(O||C){if(void 0!==C&&!Array.isArray(C)){delete w[k];continue}w[k]=(0,ev.__spreadArray)((0,ev.__spreadArray)([],(0,ev.__read)(O?eI:[]),!1),(0,ev.__read)(null!=C?C:[]),!1)}}}catch(e){s={error:e}}finally{try{S&&!S.done&&(a=x.return)&&a.call(x)}finally{if(s)throw s.error}}}}catch(e){i={error:e}}finally{try{b&&!b.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}catch(e){}var E=null==(d=t.autocapture)?void 0:d.frustrationInteractions;E&&(E.rageClick&&(E.rageClicks=E.rageClick,delete E.rageClick),E.deadClick&&(E.deadClicks=E.deadClick,delete E.deadClick))}}(e);try{var n,r,i,o,s,a,l;if(t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e)),e&&"autocapture"in e){if("boolean"==typeof e.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture&&null!==e.autocapture){var u=(0,ev.__assign)({},e.autocapture);if(void 0===t.autocapture&&(t.autocapture=e.autocapture),"object"==typeof e.autocapture.elementInteractions&&null!==e.autocapture.elementInteractions&&(null==(i=e.autocapture.elementInteractions.pageUrlAllowlistRegex)?void 0:i.length)){u.elementInteractions=(0,ev.__assign)({},e.autocapture.elementInteractions);var c=u.elementInteractions,h=null!=(o=c.pageUrlAllowlist)?o:[],d=e.autocapture.elementInteractions.pageUrlAllowlistRegex;c.pageUrlAllowlist=nU(h,d,t),delete c.pageUrlAllowlistRegex}if("object"==typeof e.autocapture.networkTracking&&null!==e.autocapture.networkTracking&&(null==(s=e.autocapture.networkTracking.captureRules)?void 0:s.length)){u.networkTracking=(0,ev.__assign)({},e.autocapture.networkTracking);var f=null!=(a=u.networkTracking.captureRules)?a:[];try{for(var p=(0,ev.__values)(f),g=p.next();!g.done;g=p.next()){var m=g.value;m.urls=nU(null!=(l=m.urls)?l:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=(0,ev.__assign)({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},u)),"object"==typeof t.autocapture&&(t.autocapture=(0,ev.__assign)((0,ev.__assign)({},t.autocapture),u))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}(t,m),e()})})];case 4:k.sent(),k.label=5;case 5:return[4,e.prototype._init.call(this,m)];case 6:if(k.sent(),this.logBrowserOptions(m),this.config.remoteConfigClient=d,!tI(this.config.defaultTracking))return[3,8];return v=tI((P=this.config).defaultTracking)&&P.defaultTracking&&"object"==typeof P.defaultTracking&&P.defaultTracking.attribution&&"object"==typeof P.defaultTracking.attribution?(0,ev.__assign)({},P.defaultTracking.attribution):{},this.webAttribution=new i$(v,this.config),[4,this.webAttribution.init()];case 7:k.sent(),k.label=8;case 8:if(w=!(!(b=(y=tf()).ampTimestamp?Number(y.ampTimestamp):void 0)||Date.now()<b)||Number.isNaN(Number(y.ampSessionId))?void 0:Number(y.ampSessionId),this.setSessionId(null!=(l=null!=(a=null!=(s=t.sessionId)?s:w)?a:this.config.sessionId)?l:Date.now()),(x=tl(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline)return[3,10];return[4,this.add(nj()).promise];case 9:k.sent(),k.label=10;case 10:return[4,this.add(new e6({diagnosticsClient:g})).promise];case 11:return k.sent(),[4,this.add(new tK).promise];case 12:return k.sent(),[4,this.add(new td).promise];case 13:if(k.sent(),nF(this.config),!tM(this.config.defaultTracking,"fileDownloads"))return[3,15];return this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(nN()).promise];case 14:k.sent(),k.label=15;case 15:if(!tM(this.config.defaultTracking,"formInteractions"))return[3,17];return this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(nI()).promise];case 16:k.sent(),k.label=17;case 17:if(!tD(this.config.defaultTracking))return[3,19];return this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(nP(tW(this.config))).promise];case 18:k.sent(),k.label=19;case 19:if(!tB(this.config.autocapture))return[3,21];return this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(rF(tj(this.config),{diagnosticsClient:g})).promise];case 20:k.sent(),k.label=21;case 21:if(!tF(this.config.autocapture))return[3,23];return this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(rH(tU(this.config))).promise];case 22:k.sent(),k.label=23;case 23:if(!tN(this.config.autocapture))return[3,25];return this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(ii(tq(this.config))).promise];case 24:k.sent(),k.label=25;case 25:if(!("boolean"==typeof(A=this.config.autocapture)?A:"object"==typeof A&&!0===A.webVitals))return[3,27];return this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(iq()).promise];case 26:k.sent(),k.label=27;case 27:if(!tM(this.config.autocapture,"pageUrlEnrichment"))return[3,29];return this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(iY()).promise];case 28:k.sent(),k.label=29;case 29:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 30:return k.sent(),x.eventBridge.setEventReceiver(function(e){var t=e.eventProperties||{},n=t.time,r=(0,ev.__rest)(t,["time"]);S.track(e.eventType,r,"number"==typeof n?{time:n}:void 0)}),[2]}})})},t.prototype.getUserId=function(){var e;return null==(e=this.config)?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),(e!==this.config.userId||void 0===e)&&(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),tu(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null==(e=this.config)?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),tc(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(eW()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null==(e=this.config)?void 0:e.deviceId,userId:null==(t=this.config)?void 0:t.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){var e;return null==(e=this.config)?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null==(e=this.config)?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),e$(Promise.resolve());if(e===this.config.sessionId)return e$(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!=(t=this.config.lastEventId)?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,tL(this.config.defaultTracking)&&(r&&i&&n.push(this.track(ns,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(eV(this.config.identify)).promise),tL(this.config.defaultTracking)&&n.push(this.track(no,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,e$(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=nb(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(tV(t)){var r=t._q;t._q=[],t=tz(new eB,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(tV(r)){var o=r._q;r._q=[],r=tz(new eB,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(tV(t)){var r=t._q;t._q=[],t=tz(new e5,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n,r,i;return(0,ev.__generator)(this,function(o){return n=Date.now(),r=th(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type!==no&&t.event_type!==ns&&(!t.session_id||t.session_id===this.getSessionId())&&(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),t.event_type===$.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[2,e.prototype.process.call(this,t)]})})},t.prototype.logBrowserOptions=function(e){try{var t=(0,ev.__assign)((0,ev.__assign)({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){if(!(e>1)&&!(e<0)&&!this.config){this._diagnosticsSampleRate=e;return}},t}(eK);(m=ei||(ei={})).US="US",m.EU="EU",m.STAGING="STAGING";var i1="[Amplitude]",i2="".concat(i1," Session Replay ID"),i3=ei.US,i4={enabled:!0},i8="".concat(i1," Session Replay Debug"),i6="amp-mask";(v=eo||(eo={})).GET_SR_PROPS="get-sr-props",v.DEBUG_INFO="debug-info",v.FETCH_REQUEST="fetch-request",v.METADATA="metadata",v.TARGETING_DECISION="targeting-decision";var i5=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){if(!this.logger)return function(){};var t,n=this.logger[e];return"function"==typeof n?(null!=(t=n.__rrweb_original__)?t:n).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),i9="medium",i7=function(e,t,n){switch(t){case"light":if("input"!==e)return!0;var r,i,o=n?(i=(r=n).type,r.hasAttribute("data-rr-is-password")?"password":i?i.toLowerCase():null):"";if(!o)return!1;if(["password","hidden","email","tel"].includes(o)||n.autocomplete.startsWith("cc-"))return!0;return!1;case"medium":case"conservative":return!0;default:return i7(e,i9,n)}},oe=function(e,t,n){var r,i,o;if(void 0===t&&(t={defaultMaskLevel:i9}),n){if(n.closest("."+i6)||(null!=(r=t.maskSelector)?r:[]).some(function(e){return n.closest(e)}))return!0;if(n.closest(".amp-unmask")||(null!=(i=t.unmaskSelector)?i:[]).some(function(e){return n.closest(e)}))return!1}return i7(e,null!=(o=t.defaultMaskLevel)?o:i9,n)},ot=function(e,t){return function(n,r){return oe(e,t,r)?n.replace(/[^\s]/g,"*"):n}},on=function(){var e=(0,eU.getGlobalScope)();return(null==e?void 0:e.location)?e.location.href:""},or=function(e,t){return t||(e===ei.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===ei.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},oi=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},oo=function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){var t;return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t)}))throw Error("ugcFilterRules must be an array of objects with valid globs")},os=function(e,t){var n,r;try{for(var i=(0,ev.__values)(t),o=i.next();!o.done;o=i.next()){var s=o.value,a=oi(s.selector);if(a.test(e))return e.replace(a,s.replacement)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},oa=function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,3,,4]),!(e=(0,eU.getGlobalScope)()))return[3,2];return[4,e.navigator.storage.estimate()];case 1:return n=(t=i.sent()).usage,r=t.quota,[2,{totalStorageSize:n?Math.round(n/1024):0,percentOfQuota:n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,usageDetails:JSON.stringify(t.usageDetails)}];case 2:return[3,4];case 3:return i.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},ol=function(e){var t=(0,ev.__assign)({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},ou=function(){return{flushMaxRetries:2,logLevel:G.Warn,loggerProvider:new eZ,transportProvider:new t3}},oc=function(e){function t(t,n){var r,i,o,s,a,l,u=this,c=ou();return(u=e.call(this,(0,ev.__assign)((0,ev.__assign)({transportProvider:c.transportProvider,loggerProvider:new i5(n.loggerProvider||c.loggerProvider)},n),{apiKey:t}))||this).flushMaxRetries=void 0!==n.flushMaxRetries&&n.flushMaxRetries<=c.flushMaxRetries?n.flushMaxRetries:c.flushMaxRetries,u.apiKey=t,u.sampleRate=n.sampleRate||0,u.serverZone=n.serverZone||i3,u.configServerUrl=n.configServerUrl,u.trackServerUrl=n.trackServerUrl,u.shouldInlineStylesheet=n.shouldInlineStylesheet,u.version=n.version,u.performanceConfig=n.performanceConfig||i4,u.storeType=null!=(r=n.storeType)?r:"idb",u.applyBackgroundColorToBlockedElements=null!=(i=n.applyBackgroundColorToBlockedElements)&&i,u.enableUrlChangePolling=null!=(o=n.enableUrlChangePolling)&&o,u.urlChangePollingInterval=null!=(s=n.urlChangePollingInterval)?s:1e3,u.captureDocumentTitle=null!=(a=n.captureDocumentTitle)&&a,n.privacyConfig&&(u.privacyConfig=n.privacyConfig),n.interactionConfig&&(u.interactionConfig=n.interactionConfig,u.interactionConfig.ugcFilterRules&&oo(u.interactionConfig.ugcFilterRules)),n.debugMode&&(u.debugMode=n.debugMode),void 0!==n.useWebWorker?u.useWebWorker=n.useWebWorker:(null==(l=n.experimental)?void 0:l.useWebWorker)!==void 0&&(u.useWebWorker=n.experimental.useWebWorker),n.omitElementTags&&(u.omitElementTags=n.omitElementTags),u}return(0,ev.__extends)(t,e),t}(eJ),oh=((y=oh||{})[y.DomContentLoaded=0]="DomContentLoaded",y[y.Load=1]="Load",y[y.FullSnapshot=2]="FullSnapshot",y[y.IncrementalSnapshot=3]="IncrementalSnapshot",y[y.Meta=4]="Meta",y[y.Custom=5]="Custom",y[y.Plugin=6]="Plugin",y),od=((b=od||{})[b.Mutation=0]="Mutation",b[b.MouseMove=1]="MouseMove",b[b.MouseInteraction=2]="MouseInteraction",b[b.Scroll=3]="Scroll",b[b.ViewportResize=4]="ViewportResize",b[b.Input=5]="Input",b[b.TouchMove=6]="TouchMove",b[b.MediaInteraction=7]="MediaInteraction",b[b.StyleSheetRule=8]="StyleSheetRule",b[b.CanvasMutation=9]="CanvasMutation",b[b.Font=10]="Font",b[b.Log=11]="Log",b[b.Drag=12]="Drag",b[b.StyleDeclaration=13]="StyleDeclaration",b[b.Selection=14]="Selection",b[b.AdoptedStyleSheet=15]="AdoptedStyleSheet",b[b.CustomElement=16]="CustomElement",b),of=((w=of||{})[w.MouseUp=0]="MouseUp",w[w.MouseDown=1]="MouseDown",w[w.Click=2]="Click",w[w.ContextMenu=3]="ContextMenu",w[w.DblClick=4]="DblClick",w[w.Focus=5]="Focus",w[w.Blur=6]="Blur",w[w.TouchStart=7]="TouchStart",w[w.TouchMove_Departed=8]="TouchMove_Departed",w[w.TouchEnd=9]="TouchEnd",w[w.TouchCancel=10]="TouchCancel",w),op=((x=op||{})[x.Mouse=0]="Mouse",x[x.Pen=1]="Pen",x[x.Touch=2]="Touch",x),og=((S=og||{})[S["2D"]=0]="2D",S[S.WebGL=1]="WebGL",S[S.WebGL2=2]="WebGL2",S),om=((k=om||{})[k.Play=0]="Play",k[k.Pause=1]="Pause",k[k.Seeked=2]="Seeked",k[k.VolumeChange=3]="VolumeChange",k[k.RateChange=4]="RateChange",k),ov=((_=ov||{}).Start="start",_.Pause="pause",_.Resume="resume",_.Resize="resize",_.Finish="finish",_.FullsnapshotRebuilded="fullsnapshot-rebuilded",_.LoadStylesheetStart="load-stylesheet-start",_.LoadStylesheetEnd="load-stylesheet-end",_.SkipStart="skip-start",_.SkipEnd="skip-end",_.MouseInteraction="mouse-interaction",_.EventCast="event-cast",_.CustomEvent="custom-event",_.Flush="flush",_.StateChange="state-change",_.PlayBack="play-back",_.Destroy="destroy",_),oy=((O=oy||{})[O.Document=0]="Document",O[O.DocumentType=1]="DocumentType",O[O.Element=2]="Element",O[O.Text=3]="Text",O[O.CDATA=4]="CDATA",O[O.Comment=5]="Comment",O),ob=function(e,t){var n=document.createDocumentFragment(),r=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{n.querySelector(e)}catch(n){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},ow=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,n;return(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i,o,s,a,l,u,c,h,d,f,p,g,m,v,y,b,w=this;return(0,ev.__generator)(this,function(x){switch(x.label){case 0:(r=(0,ev.__assign)({},this.localConfig)).optOut=this.localConfig.optOut,r.captureEnabled=!0,x.label=1;case 1:return x.trys.push([1,3,,4]),[4,new Promise(function(e,t){w.remoteConfigClient.subscribe("configs.sessionReplay","all",function(n,o){if(w.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(o,":"),JSON.stringify(n,null,2)),!n)return void t(Error("No remote config received"));var s,a=n.sr_sampling_config,l=n.sr_privacy_config,u=n.sr_targeting_config,c=null==(s=r.interactionConfig)?void 0:s.ugcFilterRules;r.interactionConfig=n.sr_interaction_config,r.interactionConfig&&c&&(r.interactionConfig.ugcFilterRules=c),r.loggingConfig=n.sr_logging_config,(a||l||u)&&(i={},a&&(i.sr_sampling_config=a),l&&(i.sr_privacy_config=l),u&&(i.sr_targeting_config=u)),e()})})];case 2:return x.sent(),[3,4];case 3:return o=x.sent(),this.localConfig.loggerProvider.error("Failed to generate joined config: ",o),r.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:void 0}];case 4:if(!i)return[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:i}];if(s=i.sr_sampling_config,a=i.sr_privacy_config,l=i.sr_targeting_config,s&&Object.keys(s).length>0?(Object.prototype.hasOwnProperty.call(s,"capture_enabled")?r.captureEnabled=s.capture_enabled:r.captureEnabled=!1,Object.prototype.hasOwnProperty.call(s,"sample_rate")&&(r.sampleRate=s.sample_rate)):(r.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),a){u=null!=(e=r.privacyConfig)?e:{},c={defaultMaskLevel:null!=(n=null!=(t=a.defaultMaskLevel)?t:u.defaultMaskLevel)?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},h=function(e){var t,n,r,i,o,s,a,l,u,c={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var h=(0,ev.__values)(null!=(a=e.blockSelector)?a:[]),d=h.next();!d.done;d=h.next()){var f=d.value;c[f]="block"}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}try{for(var p=(0,ev.__values)(null!=(l=e.maskSelector)?l:[]),g=p.next();!g.done;g=p.next()){var f=g.value;c[f]="mask"}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var m=(0,ev.__values)(null!=(u=e.unmaskSelector)?u:[]),v=m.next();!v.done;v=m.next()){var f=v.value;c[f]="unmask"}}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}return c},d=(0,ev.__assign)((0,ev.__assign)({},h(u)),h(a));try{for(p=(f=(0,ev.__values)(Object.entries(d))).next();!p.done;p=f.next())m=(g=(0,ev.__read)(p.value,2))[0],v=g[1],"mask"===v?c.maskSelector.push(m):"block"===v?c.blockSelector.push(m):"unmask"===v&&c.unmaskSelector.push(m)}catch(e){y={error:e}}finally{try{p&&!p.done&&(b=f.return)&&b.call(f)}finally{if(y)throw y.error}}r.privacyConfig=ob(c,this.localConfig.loggerProvider)}return l&&Object.keys(l).length>0&&(r.targetingConfig=l),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:ol(r)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:i}]}})})},e}(),ox=Uint8Array,oS=Uint16Array,ok=Uint32Array,o_=new ox([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oO=new ox([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),oC=new ox([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oE=function(e,t){for(var n=new oS(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new ok(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},oT=oE(o_,2),oP=oT[0],oA=oT[1];oP[28]=258,oA[258]=28;for(var oR=oE(oO,0),oM=(oR[0],oR[1]),oI=new oS(32768),oD=0;oD<32768;++oD){var oL=(43690&oD)>>>1|(21845&oD)<<1;oL=(61680&(oL=(52428&oL)>>>2|(13107&oL)<<2))>>>4|(3855&oL)<<4,oI[oD]=((65280&oL)>>>8|(255&oL)<<8)>>>1}for(var oN=function(e,t,n){for(var r,i=e.length,o=0,s=new oS(t);o<i;++o)++s[e[o]-1];var a=new oS(t);for(o=0;o<t;++o)a[o]=a[o-1]+s[o-1]<<1;if(n){r=new oS(1<<t);var l=15-t;for(o=0;o<i;++o)if(e[o])for(var u=o<<4|e[o],c=t-e[o],h=a[e[o]-1]++<<c,d=h|(1<<c)-1;h<=d;++h)r[oI[h]>>>l]=u}else for(o=0,r=new oS(i);o<i;++o)r[o]=oI[a[e[o]-1]++]>>>15-e[o];return r},oB=new ox(288),oD=0;oD<144;++oD)oB[oD]=8;for(var oD=144;oD<256;++oD)oB[oD]=9;for(var oD=256;oD<280;++oD)oB[oD]=7;for(var oD=280;oD<288;++oD)oB[oD]=8;for(var oF=new ox(32),oD=0;oD<32;++oD)oF[oD]=5;var oj=oN(oB,9,0),oU=oN(oF,5,0),oq=function(e){return(e/8|0)+(7&e&&1)},oW=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof oS?oS:e instanceof ok?ok:ox)(n-t);return r.set(e.subarray(t,n)),r},oz=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},oV=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},oH=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new ox(0),0];if(1==i){var s=new ox(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[h].f?u++:h++],l=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var f=new oS(d+1),p=oQ(n[c-1],f,0);if(p>t){var r=0,g=0,m=p-t,v=1<<m;for(o.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<i;++r){var y=o[r].s;if(f[y]>t)g+=v-(1<<p-f[y]),f[y]=t;else break}for(g>>>=m;g>0;){var b=o[r].s;f[b]<t?g-=1<<t-f[b]++-1:++r}for(;r>=0&&g;--r){var w=o[r].s;f[w]==t&&(--f[w],++g)}p=t}return[new ox(f),p]},oQ=function(e,t,n){return -1==e.s?Math.max(oQ(e.l,t,n+1),oQ(e.r,t,n+1)):t[e.s]=n},o$=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new oS(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},oK=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},oX=function(e,t,n){var r=n.length,i=oq(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},oG=function(e,t,n,r,i,o,s,a,l,u,c){oz(t,c++,n),++i[256];for(var h,d,f,p,g=oH(i,15),m=g[0],v=g[1],y=oH(o,15),b=y[0],w=y[1],x=o$(m),S=x[0],k=x[1],_=o$(b),O=_[0],C=_[1],E=new oS(19),T=0;T<S.length;++T)E[31&S[T]]++;for(var T=0;T<O.length;++T)E[31&O[T]]++;for(var P=oH(E,7),A=P[0],R=P[1],M=19;M>4&&!A[oC[M-1]];--M);var I=u+5<<3,D=oK(i,oB)+oK(o,oF)+s,L=oK(i,m)+oK(o,b)+s+14+3*M+oK(E,A)+(2*E[16]+3*E[17]+7*E[18]);if(I<=D&&I<=L)return oX(t,c,e.subarray(l,l+u));if(oz(t,c,1+(L<D)),c+=2,L<D){h=oN(m,v,0),d=m,f=oN(b,w,0),p=b;var N=oN(A,R,0);oz(t,c,k-257),oz(t,c+5,C-1),oz(t,c+10,M-4),c+=14;for(var T=0;T<M;++T)oz(t,c+3*T,A[oC[T]]);c+=3*M;for(var B=[S,O],F=0;F<2;++F)for(var j=B[F],T=0;T<j.length;++T){var U=31&j[T];oz(t,c,N[U]),c+=A[U],U>15&&(oz(t,c,j[T]>>>5&127),c+=j[T]>>>12)}}else h=oj,d=oB,f=oU,p=oF;for(var T=0;T<a;++T)if(r[T]>255){var U=r[T]>>>18&31;oV(t,c,h[U+257]),c+=d[U+257],U>7&&(oz(t,c,r[T]>>>23&31),c+=o_[U]);var q=31&r[T];oV(t,c,f[q]),c+=p[q],q>3&&(oV(t,c,r[T]>>>5&8191),c+=oO[q])}else oV(t,c,h[r[T]]),c+=d[r[T]];return oV(t,c,h[256]),c+d[256]},oZ=new ok([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oY=function(e,t,n,r,i,o){var s=e.length,a=new ox(r+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var h=c+65535;h<s?u=oX(l,u,e.subarray(c,h)):(l[c]=o,u=oX(l,u,e.subarray(c,s)))}else{for(var d=oZ[t-1],f=d>>>13,p=8191&d,g=(1<<n)-1,m=new oS(32768),v=new oS(g+1),y=Math.ceil(n/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&g},x=new ok(25e3),S=new oS(288),k=new oS(32),_=0,O=0,c=0,C=0,E=0,T=0;c<s;++c){var P=w(c),A=32767&c,R=v[P];if(m[A]=R,v[P]=A,E<=c){var M=s-c;if((_>7e3||C>24576)&&M>423){u=oG(e,l,0,x,S,k,O,C,T,c-T,u),C=_=O=0,T=c;for(var I=0;I<286;++I)S[I]=0;for(var I=0;I<30;++I)k[I]=0}var D=2,L=0,N=p,B=A-R&32767;if(M>2&&P==w(c-B))for(var F=Math.min(f,M)-1,j=Math.min(32767,c),U=Math.min(258,M);B<=j&&--N&&A!=R;){if(e[c+D]==e[c+D-B]){for(var q=0;q<U&&e[c+q]==e[c+q-B];++q);if(q>D){if(D=q,L=B,q>F)break;for(var W=Math.min(B,q-2),z=0,I=0;I<W;++I){var V=c-B+I+32768&32767,H=m[V],Q=V-H+32768&32767;Q>z&&(z=Q,R=V)}}}R=m[A=R],B+=A-R+32768&32767}if(L){x[C++]=0x10000000|oA[D]<<18|oM[L];var $=31&oA[D],K=31&oM[L];O+=o_[$]+oO[K],++S[257+$],++k[K],E=c+D,++_}else x[C++]=e[c],++S[e[c]]}}u=oG(e,l,o,x,S,k,O,C,T,c-T,u)}return oW(a,0,r+oq(u)+i)},oJ=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length,s=0;s!=o;){for(var a=Math.min(s+5552,o);s<a;++s)r+=n[s],i+=r;r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+((255&e)<<23)*2}}},o0=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},o1=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},o2=function(){function e(e,t,n,r){var i,o=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t,n,r,i,o;return JSON.stringify(function(e,t){var n="";if(!t&&"u">typeof TextDecoder)return new TextDecoder().decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):n+=String.fromCharCode(55296|(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&i)}return n}((t=function(e,t){var n=e.length;if("u">typeof TextEncoder)return new TextEncoder().encode(e);for(var r=new ox(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new ox(i+8+(n-s<<1));a.set(r),r=a}var l=e.charCodeAt(s);l<128?o(l):(l<2048?o(192|l>>>6):(l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63)):o(224|l>>>12),o(128|l>>>6&63)),o(128|63&l))}return oW(r,0,i)}(JSON.stringify({...e,v:"v1"})),void 0===n&&(n={}),(r=oJ()).p(t),o1(o=oY(t,null==(i=n).level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,2,4,!0),n),o0(o,o.length-4,r.d()),o),!0))},this.addCompressedEventToManager=function(e,t){o.eventsManager&&o.deviceId&&o.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:o.deviceId})},this.addCompressedEvent=function(e,t){if(o.worker)try{o.worker.postMessage({event:e,sessionId:t})}catch(n){"DataCloneError"===n.name?o.worker.postMessage(JSON.stringify({event:e,sessionId:t})):o.config.loggerProvider.warn("Unexpected error while posting message to worker:",n)}else{var n=o.compressEvent(e);o.addCompressedEventToManager(n,t)}},this.terminate=function(){var e;null==(e=o.worker)||e.terminate()};var s=(0,eU.getGlobalScope)();if(this.canUseIdleCallback=s&&"requestIdleCallback"in s,this.eventsManager=e,this.config=t,this.deviceId=n,this.timeout=(null==(i=t.performanceConfig)?void 0:i.timeout)||2e3,r){t.loggerProvider.log("Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([r],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,n=t.compressedEvent,r=t.sessionId;o.addCompressedEventToManager(n,r)},this.worker=a}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var n;this.canUseIdleCallback&&(null==(n=this.config.performanceConfig)?void 0:n.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var r=n.event,i=n.sessionId;this.addCompressedEvent(r,i)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),o3="Failed to store session replay events in IndexedDB",o4="1.30.8",o8=function(){function e(e){var t=e.trackServerUrl,n=e.loggerProvider,r=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=n,this.payloadBatcher=r||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue((0,ev.__assign)((0,ev.__assign)({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}).forEach(function(t){(e.queue=e.queue.concat(t),0===t.timeout)?e.schedule(0):setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r=this;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:return t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return r.send(t,e)}))];case 1:return i.sent(),[2]}})})},e.prototype.send=function(e,t){var n,r;return void 0===t&&(t=!0),(0,ev.__awaiter)(this,void 0,void 0,function(){var i,o,s,a,l,u,c,h,d,f,p,g;return(0,ev.__generator)(this,function(m){switch(m.label){case 0:if(!(i=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(o=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(s=on(),a=o4,l=e.sampleRate,u=new URLSearchParams({device_id:o,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),c="".concat((null==(n=e.version)?void 0:n.type)||"standalone","/").concat((null==(r=e.version)?void 0:r.version)||a),0===(h=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];m.label=1;case 1:return m.trys.push([1,3,,4]),d={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(i),"X-Client-Version":a,"X-Client-Library":c,"X-Client-Url":s.substring(0,1e3),"X-Client-Sample-Rate":"".concat(l)},body:JSON.stringify(h),method:"POST"},[4,fetch("".concat(or(e.serverZone,this.trackServerUrl),"?").concat(u.toString()),d)];case 2:if(null===(f=m.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(f.status,e);else{p="";try{p=JSON.stringify(f.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(f.status,": ").concat(p)})}return[3,4];case 3:return g=m.sent(),this.completeRequest({context:e,err:g}),[3,4];case 4:return[2]}})})},e.prototype.handleReponse=function(e,t){switch(new t2().buildStatus(e)){case X.Success:this.handleSuccessResponse(t);break;case X.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue((0,ev.__assign)((0,ev.__assign)({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,n=e.err,r=e.success;t.onComplete(),n?this.loggerProvider.warn(n):r&&this.loggerProvider.log(r)},e}(),o6=e.i(601217),o5=function(){function e(e){var t,n,r,i=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var n=i.getStringSize(t);return i.getEventsArraySize(e)+n>=i.maxPersistedEventsSize||Date.now()-i.timeAtLastSplit>i.interval&&!!e.length&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!=(t=e.minInterval)?t:this.minInterval,this.maxInterval=null!=(n=e.maxInterval)?n:this.maxInterval,this.maxPersistedEventsSize=null!=(r=e.maxPersistedEventsSize)?r:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,n,r=0;try{for(var i=(0,ev.__values)(e),o=i.next();!o.done;o=i.next()){var s=o.value;r+=this.getStringSize(s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r+(2+Math.max(0,e.length-1)+2*e.length)},e}();(C=es||(es={})).RECORDING="recording",C.SENT="sent";var o9="sessionCurrentSequence",o7="sequencesToSend",se=function(){var e=(0,eU.getGlobalScope)();return new Promise(function(t,n){if(!e)return n(Error("Global scope not found"));if(!e.indexedDB)return n(Error("Session Replay: cannot find indexedDB"));try{var r=e.indexedDB.open("keyval-store"),i=!1;r.onupgradeneeded=function(){1===r.result.version&&(i=!0)},r.onsuccess=function(){if(i){try{r.result.close()}catch(e){}try{e.indexedDB.deleteDatabase("keyval-store")}catch(e){}t();return}t(r.result)},r.onerror=function(e){var i;if((null==(i=r.error)?void 0:i.name)==="AbortError"){e.preventDefault(),t();return}n(r.error)}}catch(e){n(e)}})},st=function(e){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){switch(t.label){case 0:if(!(e.length>0))return[3,2];return[4,Promise.all(e.splice(0,10))];case 1:return t.sent(),[3,0];case 2:return[2]}})})},sn=function(e){var t,n;return e.objectStoreNames.contains(o9)||(n=e.createObjectStore(o9,{keyPath:"sessionId"})),e.objectStoreNames.contains(o7)||(t=e.createObjectStore(o7,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:n}},sr=function(e){function t(t){var n=e.call(this,t)||this;return n.getSequencesToSend=function(){return(0,ev.__awaiter)(n,void 0,void 0,function(){var e,t,n,r,i,o;return(0,ev.__generator)(this,function(s){switch(s.label){case 0:return s.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=s.sent(),s.label=2;case 2:if(!t)return[3,4];return r=(n=t.value).sessionId,i=n.events,e.push({events:i,sequenceId:t.key,sessionId:r}),[4,t.continue()];case 3:return t=s.sent(),[3,2];case 4:return[2,e];case 5:return o=s.sent(),this.loggerProvider.warn("".concat(o3,": ").concat(o)),[3,6];case 6:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return(0,ev.__awaiter)(n,void 0,void 0,function(){var t,n,r;return(0,ev.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.db.get(o9,e)];case 1:if(!(t=i.sent()))return[2,void 0];return[4,this.db.put(o7,{sessionId:e,events:t.events})];case 2:return n=i.sent(),[4,this.db.put(o9,{sessionId:e,events:[]})];case 3:return i.sent(),[2,(0,ev.__assign)((0,ev.__assign)({},t),{sessionId:e,sequenceId:n})];case 4:return r=i.sent(),this.loggerProvider.warn("".concat(o3,": ").concat(r)),[3,5];case 5:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return(0,ev.__awaiter)(n,void 0,void 0,function(){var n,r,i,o,s,a;return(0,ev.__generator)(this,function(l){switch(l.label){case 0:return l.trys.push([0,10,,11]),[4,(n=this.db.transaction(o9,"readwrite")).store.get(e)];case 1:if(r=l.sent())return[3,3];return[4,n.store.put({sessionId:e,events:[t]})];case 2:return l.sent(),[2];case 3:if(i=void 0,!this.shouldSplitEventsList(r.events,t))return[3,5];return i=r.events,[4,n.store.put({sessionId:e,events:[t]})];case 4:return l.sent(),[3,7];case 5:return o=r.events.concat(t),[4,n.store.put({sessionId:e,events:o})];case 6:l.sent(),l.label=7;case 7:return[4,n.done];case 8:if(l.sent(),!i)return[2,void 0];return[4,this.storeSendingEvents(e,i)];case 9:if(!(s=l.sent()))return[2,void 0];return[2,{events:i,sessionId:e,sequenceId:s}];case 10:return a=l.sent(),this.loggerProvider.warn("".concat(o3,": ").concat(a)),[3,11];case 11:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return(0,ev.__awaiter)(n,void 0,void 0,function(){var n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.db.put(o7,{sessionId:e,events:t})];case 1:return[2,r.sent()];case 2:return n=r.sent(),this.loggerProvider.warn("".concat(o3,": ").concat(n)),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return(0,ev.__awaiter)(n,void 0,void 0,function(){var e;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:if(!t)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.db.delete(o7,t)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),this.loggerProvider.warn("".concat(o3,": ").concat(e)),[3,4];case 4:return[2]}})})},n.transitionFromKeyValStore=function(e){return(0,ev.__awaiter)(n,void 0,void 0,function(){var t,n,r,i,o,s,a,l=this;return(0,ev.__generator)(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,se()];case 1:if(!(t=u.sent()))return[2];n=function(e,t){return(0,ev.__awaiter)(l,void 0,void 0,function(){var n,r,i=this;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:return n=t.sessionSequences,r=[],Object.keys(n).forEach(function(o){var s=parseInt(o,10),a=n[s];if(s===t.currentSequenceId){var l=a.events.map(function(t){return(0,ev.__awaiter)(i,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return[2,this.addEventToCurrentSequence(e,t)]})})});r.push.apply(r,(0,ev.__spreadArray)([],(0,ev.__read)(l),!1))}else a.status!==es.SENT&&r.push(i.storeSendingEvents(e,a.events))}),[4,st(r)];case 1:return o.sent(),[2]}})})},r="".concat(ey,"_").concat(this.apiKey.substring(0,10)),u.label=2;case 2:return u.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(r),[4,new Promise(function(t){i.onsuccess=function(r){return(0,ev.__awaiter)(l,void 0,void 0,function(){var i,o,s,a=this;return(0,ev.__generator)(this,function(l){switch(l.label){case 0:if(!(o=(i=r&&r.target.result)&&i[0]))return[3,2];return s=[],Object.keys(o).forEach(function(t){var r=parseInt(t,10),i=o[r];if(e===r)s.push(n(r,i));else{var l=i.sessionSequences;Object.keys(l).forEach(function(e){var t=parseInt(e,10);l[t].status!==es.SENT&&s.push(a.storeSendingEvents(r,l[t].events))})}}),[4,st(s)];case 1:l.sent(),l.label=2;case 2:return t(),[2]}})})}})];case 3:return u.sent(),(o=(0,eU.getGlobalScope)())&&o.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return s=u.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(s)),[3,5];case 5:return[3,7];case 6:return a=u.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(a,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},n.apiKey=t.apiKey,n.db=t.db,n}return(0,ev.__extends)(t,e),t.new=function(e,n,r){return(0,ev.__awaiter)(this,void 0,void 0,function(){var i,o,s,a;return(0,ev.__generator)(this,function(l){switch(l.label){case 0:var u;return l.trys.push([0,3,,4]),i="replay"===e?"":"_".concat(e),[4,(u="".concat(n.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){switch(e.label){case 0:return[4,(0,o6.openDB)(u,1,{upgrade:sn})];case 1:return[2,e.sent()]}})}))];case 1:return o=l.sent(),[4,(s=new t((0,ev.__assign)((0,ev.__assign)({},n),{db:o}))).transitionFromKeyValStore(r)];case 2:return l.sent(),[2,s];case 3:return a=l.sent(),n.loggerProvider.warn("".concat(o3,": ").concat(a)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(!e)return[3,2];return[4,this.db.get("sessionCurrentSequence",e)];case 1:if(!(t=a.sent()))return[2,void 0];return[2,[t]];case 2:n=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:i=(r=ev.__values.apply(void 0,[a.sent()])).next(),a.label=5;case 5:if(i.done)return[3,7];t=i.value,n.push(t),a.label=6;case 6:return i=r.next(),[3,5];case 7:return[3,10];case 8:return o={error:a.sent()},[3,10];case 9:try{i&&!i.done&&(s=r.return)&&s.call(r)}finally{if(o)throw o.error}return[7];case 10:return[2,n]}})})},t}(o5),si=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return(0,ev.__extends)(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,n=(0,ev.__spreadArray)([],(0,ev.__read)(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:n},this.resetCurrentSequence(e),{sequenceId:t,events:n,sessionId:e}},t.prototype.getSequencesToSend=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=(0,ev.__read)(e,2),n=t[0],r=t[1],i=r.sessionId,o=r.events;return{sequenceId:Number(n),sessionId:i,events:o}})]})})},t.prototype.storeCurrentSequence=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){var n;return(0,ev.__generator)(this,function(r){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(n=this.addSequence(e)),this.sequences[e].push(t),[2,n]})})},t.prototype.storeSendingEvents=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(o5),so=function(e){var t=e.config,n=e.sessionId,r=e.minInterval,i=e.maxInterval,o=e.type,s=e.payloadBatcher,a=e.storeType;return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e,l,u,c,h;function d(t){return void 0===t&&(t=!1),(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return[2,e.flush(t)]})})}return(0,ev.__generator)(this,function(f){switch(f.label){case 0:if(e=new o8((0,ev.__assign)((0,ev.__assign)({},t),{loggerProvider:t.loggerProvider,payloadBatcher:s})),l=function(){return new si({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:r})},"idb"!==a)return[3,2];return[4,(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ev.__generator)(this,function(s){switch(s.label){case 0:return[4,sr.new(o,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:i,apiKey:t.apiKey},n)];case 1:return e=s.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:l()]}})})];case 1:return c=f.sent(),[3,3];case 2:c=l(),f.label=3;case 3:return u=c,h=function(n){var r=n.events,i=n.sessionId,s=n.deviceId,a=n.sequenceId;t.debugMode&&oa().then(function(e){var n=e.totalStorageSize,r=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(n," KB, percentage of quota: ").concat(r,"%, usage details: ").concat(i))}).catch(function(){}),e.sendEventsList({events:r,sessionId:i,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:s,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:o,onComplete:function(){return(0,ev.__awaiter)(void 0,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){switch(e.label){case 0:return[4,u.cleanUpSessionEventsStore(i,a)];case 1:return e.sent(),[2]}})})}})},[2,{sendCurrentSequenceEvents:function(e){var n=e.sessionId,r=e.deviceId;u.storeCurrentSequence(n).then(function(e){e&&h({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},addEvent:function(e){var n=e.event,r=e.sessionId,i=e.deviceId;u.addEventToCurrentSequence(r,n.data).then(function(e){return e&&h({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},sendStoredEvents:function(e){var t=e.deviceId;return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return[4,u.getSequencesToSend()];case 1:return(e=n.sent())&&e.forEach(function(e){h({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},flush:d}]}})})},ss=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new Map;e.forEach(function(e){n.set(e.name,e.manager)}),this.managers=n}return e.prototype.sendStoredEvents=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,n=e.sessionId,r=e.event,i=e.deviceId;null==(t=this.managers.get(r.type))||t.addEvent({sessionId:n,event:r,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,n=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:n})})},e.prototype.flush=function(e){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t;return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.flush(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e}();function sa(e,t,n){for(var r=null,i=[],o=e,s=0;o&&"break"!==function(){var e,a,l,u,c=new Date().getTime()-eu.getTime();if(void 0!==ea.timeoutMs&&c>ea.timeoutMs)throw Error("Timeout: Can't find a unique selector after ".concat(c,"ms"));var h=sg((e=o.getAttribute("id"))&&ea.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null)||sg.apply(void 0,(0,ev.__spreadArray)([],(0,ev.__read)(Array.from(o.attributes).filter(function(e){return ea.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})),!1))||sg.apply(void 0,(0,ev.__spreadArray)([],(0,ev.__read)(Array.from(o.classList).filter(ea.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})),!1))||sg((a=o.tagName.toLowerCase(),ea.tagName(a)?{name:a,penalty:2}:null))||[sd()],d=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(o);if("all"==t)d&&(h=h.concat(h.filter(sp).map(function(e){return sf(e,d)})));else if("two"==t)h=h.slice(0,1),d&&(h=h.concat(h.filter(sp).map(function(e){return sf(e,d)})));else if("one"==t){var f=(0,ev.__read)(h=h.slice(0,1),1)[0];d&&sp(f)&&(h=[sf(f,d)])}else"none"==t&&(h=[sd()],d&&(h=[sf(h[0],d)]));try{for(var p=(l=void 0,(0,ev.__values)(h)),g=p.next();!g.done;g=p.next()){var f=g.value;f.level=s}}catch(e){l={error:e}}finally{try{g&&!g.done&&(u=p.return)&&u.call(p)}finally{if(l)throw l.error}}if(i.push(h),i.length>=ea.seedMinLength&&(r=sl(i,n)))return"break";o=o.parentElement,s++}(););return(r||(r=sl(i,n)),!r&&n)?n():r}function sl(e,t){var n,r,i=sv(function e(t,n){var r,i,o,s,a;return void 0===n&&(n=[]),(0,ev.__generator)(this,function(l){switch(l.label){case 0:if(!(t.length>0))return[3,9];l.label=1;case 1:l.trys.push([1,6,7,8]),i=(r=(0,ev.__values)(t[0])).next(),l.label=2;case 2:if(i.done)return[3,5];return o=i.value,[5,(0,ev.__values)(e(t.slice(1,t.length),n.concat(o)))];case 3:l.sent(),l.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return s={error:l.sent()},[3,8];case 7:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(s)throw s.error}return[7];case 8:return[3,11];case 9:return[4,n];case 10:l.sent(),l.label=11;case 11:return[2]}})}(e));if(i.length>ea.threshold)return t?t():null;try{for(var o=(0,ev.__values)(i),s=o.next();!s.done;s=o.next()){var a=s.value;if(sh(a))return a}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function su(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function sc(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function sh(e){var t=su(e);switch(el.querySelectorAll(t).length){case 0:throw Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function sd(){return{name:"*",penalty:3}}function sf(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function sp(e){return"html"!==e.name&&!e.name.startsWith("#")}function sg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(sm);return n.length>0?n:null}function sm(e){return null!=e}function sv(e){return(0,ev.__spreadArray)([],(0,ev.__read)(e),!1).sort(function(e,t){return sc(e)-sc(t)})}var sy=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&r.push(t)}),{version:t,events:r}},sb=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&r.push(t)}),{version:t,events:Object.values(r.reduce(function(e,t){var n=t.x,r=t.y,i=t.selector,o=t.timestamp,s=o-o%36e5,a="".concat(n,":").concat(r,":").concat(null!=i?i:"",":").concat(s);return e[a]?e[a].count+=1:e[a]=(0,ev.__assign)((0,ev.__assign)({},t),{timestamp:s,count:1}),e},{}))}},sw=function(e,t){var n=this;this.createHook=function(e){var t=e.eventsManager,r=e.sessionId,i=e.deviceIdFn,o=e.mirror,s=e.ugcFilterRules,a=e.performanceOptions;return function(e){if(e.type!==of.Click)return;var l,u=(0,eU.getGlobalScope)();if(u){var c=u.location,h=u.innerHeight,d=u.innerWidth;if(c){var f=e.x,p=e.y;if(void 0!==f&&void 0!==p){var g=o.getNode(e.id);if(g)try{l=function(e,t){if(eu=new Date,e.nodeType!==Node.ELEMENT_NODE)throw Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n,r,i={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};n=(ea=(0,ev.__assign)((0,ev.__assign)({},i),t)).root,r=i,el=n.nodeType===Node.DOCUMENT_NODE?n:n===r.root?n.ownerDocument:n;var o=sa(e,"all",function(){return sa(e,"two",function(){return sa(e,"one",function(){return sa(e,"none")})})});if(o){var s=sv(function e(t,n,r){var i,o,s;return void 0===r&&(r={counter:0,visited:new Map}),(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(!(t.length>2&&t.length>ea.optimizedMinLength))return[3,5];i=1,a.label=1;case 1:var l,u;if(!(i<t.length-1))return[3,5];if(r.counter>ea.maxNumberOfTries||(r.counter+=1,(o=(0,ev.__spreadArray)([],(0,ev.__read)(t),!1)).splice(i,1),s=su(o),r.visited.has(s)))return[2];if(!(sh(o)&&(l=o,u=n,el.querySelector(su(l))===u)))return[3,4];return[4,o];case 2:return a.sent(),r.visited.set(s,!0),[5,(0,ev.__values)(e(o,n,r))];case 3:a.sent(),a.label=4;case 4:return i++,[3,1];case 5:return[2]}})}(o,e));return s.length>0&&(o=s[0]),su(o)}throw Error("Selector was not found.")}(g,a)}catch(e){n.logger.debug("error resolving selector from finder")}var m=os(c.href,s),v={x:f+n.scrollWatcher.currentScrollX,y:p+n.scrollWatcher.currentScrollY,selector:l,viewportHeight:h,viewportWidth:d,pageUrl:m,timestamp:Date.now(),type:"click"},y=i();y&&t.addEvent({sessionId:r,event:{type:"interaction",data:JSON.stringify(v)},deviceId:y})}}}}},this.logger=e,this.scrollWatcher=t};function sx(){var e=(0,eU.getGlobalScope)();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function sS(){var e=(0,eU.getGlobalScope)();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}var sk=function(){function e(e,t){var n=(0,eU.getGlobalScope)();n&&n.navigator&&"function"==typeof n.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(n.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var n=new XMLHttpRequest;return n.open("POST",e,!0),n.setRequestHeader("Accept","*/*"),n.send(JSON.stringify(t)),!0},this.basePageUrl=or(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var n=this.context,r=n.sessionId,i=n.type,o=new URLSearchParams({device_id:e,session_id:String(r),type:String(i),api_key:this.apiKey}),s="".concat(this.basePageUrl,"?").concat(o.toString());this.sendBeacon(s,t)||this.sendXhr(s,t)},e}(),s_=function(){function e(e,t){var n=this;this.timestamp=Date.now(),this.hook=function(e){n.update(e)},this.send=function(e){return function(t){var r,i,o=e(),s=(0,eU.getGlobalScope)();s&&o&&n.transport.send(o,{version:1,events:[{maxScrollX:n._maxScrollX,maxScrollY:n._maxScrollY,maxScrollWidth:n._maxScrollWidth,maxScrollHeight:n._maxScrollHeight,viewportHeight:sx(),viewportWidth:sS(),pageUrl:os(s.location.href,null!=(i=null==(r=n.config.interactionConfig)?void 0:r.ugcFilterRules)?i:[]),timestamp:n.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=sS(),this._maxScrollHeight=sx(),this.config=t,this.transport=e}return e.default=function(t,n){return new e(new sk(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var n=sS();this._maxScrollX=e.x;var r=e.x+n;r>this._maxScrollWidth&&(this._maxScrollWidth=r),this.timestamp=t}if(e.y>this._maxScrollY){var i=sx();this._maxScrollY=e.y;var o=e.y+i;o>this._maxScrollHeight&&(this._maxScrollHeight=o),this.timestamp=t}},e}(),sO=function(e){var t=e.sessionId,n=e.deviceId;this.deviceId=n,this.sessionId=t,t&&n&&(this.sessionReplayId="".concat(n,"/").concat(t))},sC=new function(){var e=this;this.dbs={},this.createStore=function(t){return(0,ev.__awaiter)(e,void 0,void 0,function(){return(0,ev.__generator)(this,function(e){switch(e.label){case 0:return[4,(0,o6.openDB)(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return(0,ev.__awaiter)(e,void 0,void 0,function(){var e,n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:if(this.dbs&&this.dbs[t])return[2,this.dbs[t]];return e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)];case 1:return n=r.sent(),this.dbs[t]=n,[2,n]}})})},this.getTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId;return(0,ev.__awaiter)(e,void 0,void 0,function(){var e,t,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(o=a.sent())?void 0:o.targetingMatch];case 3:return s=a.sent(),n.warn("Failed to get targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId,o=t.targetingMatch;return(0,ev.__awaiter)(e,void 0,void 0,function(){var e,t,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:o,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return s=a.sent(),n.warn("Failed to store targeting match for session id ".concat(i,": ").concat(s)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.currentSessionId;return(0,ev.__awaiter)(e,void 0,void 0,function(){var e,t,o,s,a,l,u,c;return(0,ev.__generator)(this,function(h){switch(h.label){case 0:return h.trys.push([0,8,,9]),[4,this.openOrCreateDB(r)];case 1:return e=h.sent(),t=String(i),[4,(o=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:s=h.sent(),a=0,h.label=3;case 3:if(!(a<s.length))return[3,6];if(l=s[a],u=Date.now()-l.lastUpdated,!(l.sessionId!==t&&u>1728e5))return[3,5];return[4,o.store.delete(l.sessionId)];case 4:h.sent(),h.label=5;case 5:return a++,[3,3];case 6:return[4,o.done];case 7:return h.sent(),[3,9];case 8:return c=h.sent(),n.warn("Failed to clear old targeting matches for sessions: ".concat(c)),[3,9];case 9:return[2]}})})}},sE=function(t){var n=t.sessionId,r=t.targetingConfig,i=t.loggerProvider,o=t.apiKey,s=t.targetingParams;return(0,ev.__awaiter)(void 0,void 0,void 0,function(){var t,a,l;return(0,ev.__generator)(this,function(u){switch(u.label){case 0:return[4,sC.clearStoreOfOldSessions({loggerProvider:i,apiKey:o,currentSessionId:n})];case 1:return u.sent(),[4,sC.getTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:n})];case 2:if(!0===u.sent())return[2,!0];t=!0,u.label=3;case 3:return u.trys.push([3,6,,7]),[4,e.A(18737)];case 4:return[4,(0,u.sent().evaluateTargeting)((0,ev.__assign)((0,ev.__assign)({},s),{flag:r,sessionId:"string"==typeof n?parseInt(n,10):n,apiKey:o,loggerProvider:i}))];case 5:return(a=u.sent())&&a.sr_targeting_config&&(t="on"===a.sr_targeting_config.key),sC.storeTargetingMatchForSession({loggerProvider:i,apiKey:o,sessionId:n,targetingMatch:t}),[3,7];case 6:return l=u.sent(),i.warn(l.message),[3,7];case 7:return[2,t]}})})};function sT(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var i,o,s,a=(0,ev.__assign)((0,ev.__assign)({},e),r),l=a.ugcFilterRules||[],u=null!=(i=a.enablePolling)&&i,c=null!=(o=a.pollingInterval)?o:1e3,h=null!=(s=a.captureDocumentTitle)&&s;if(!n)return function(){};var d=void 0,f="__amplitude_url_tracking_patched__",p="__amplitude_url_tracking_reset__",g=function(){return n.location&&n.location.href||""},m=function(){var e=n.innerHeight,t=n.innerWidth,r=n.document,i=g(),o="";return h&&(o=(null==r?void 0:r.title)||""),{href:l.length>0?os(i,l):i,title:o,viewportHeight:e,viewportWidth:t,type:"url-change-event"}},v=function(){var e=g();(void 0===d||e!==d)&&(d=e,t(m()))},y=function(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(this,t);return n[p]||v(),i};return t[f]=!0,t},b=function(){v()};if(u){var w=n.setInterval(function(){v()},c);return v(),function(){w&&n.clearInterval(w)}}if(n.history){var x=n.history.pushState.bind(n.history),S=n.history.replaceState.bind(n.history);return n.history.pushState[f]||(n.history.pushState=y(x),n.history.replaceState=y(S)),n.addEventListener("popstate",v),n.addEventListener("hashchange",b),v(),function(){n[p]=!0,n.removeEventListener("popstate",v),n.removeEventListener("hashchange",b)}}return n.addEventListener("hashchange",b),v(),function(){n.removeEventListener("hashchange",b)}},options:e}}sT();var sP=function(){function t(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var n=(0,eU.getGlobalScope)();n&&(n.removeEventListener("blur",e.blurListener),n.removeEventListener("focus",e.focusListener),t||n.addEventListener("blur",e.blurListener),t||n.addEventListener("focus",e.focusListener),n.self&&"onpagehide"in n.self?(n.removeEventListener("pagehide",e.pageLeaveListener),t||n.addEventListener("pagehide",e.pageLeaveListener)):(n.removeEventListener("beforeunload",e.pageLeaveListener),t||n.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!1),(0,ev.__awaiter)(e,void 0,void 0,function(){var e,i;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(!n)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];else this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");if(this.lastTargetingParams=t,!(this.config.targetingConfig&&!this.sessionTargetingMatch))return[3,2];return(e=t.event)&&Object.values($).includes(e.event_type)&&(e=void 0),i=this,[4,sE({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})];case 1:i.sessionTargetingMatch=o.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),o.label=2;case 2:if(!n)return[3,3];return this.initialize(!0),[3,5];case 3:if(!(r||!this.recordCancelCallback))return[3,5];return this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()];case 4:o.sent(),o.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r=!0),(0,ev.__awaiter)(e,void 0,void 0,function(){var e,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,3,,4]),e=void 0,!((i=this.config)&&t!==eo.METADATA)||(e={config:ol(i),version:o4},!r))return[3,2];return[4,oa()];case 1:o=a.sent(),e=(0,ev.__assign)((0,ev.__assign)({},o),e),a.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,(0,ev.__assign)((0,ev.__assign)({},n),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return s=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",s),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null==(t=e.networkObservers)||t.stop()}catch(t){e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(t.toString()))}},this.loggerProvider=new i5(new eZ)}return t.prototype.init=function(e,t){return e$(this._init(e,t))},t.prototype._init=function(t,n){var r,i,o,s,a,l;return(0,ev.__awaiter)(this,void 0,void 0,function(){var u,c,h,d,f,p,g,m,v,y,b,w,x,S;return(0,ev.__generator)(this,function(k){switch(k.label){case 0:return this.loggerProvider=new i5(n.loggerProvider||new eZ),Object.prototype.hasOwnProperty.call(n,"logLevel")&&this.loggerProvider.enable(n.logLevel),this.identifiers=new sO({sessionId:n.sessionId,deviceId:n.deviceId}),u=this,[4,(0,ev.__awaiter)(void 0,void 0,void 0,function(){var e;return(0,ev.__generator)(this,function(r){return e=new oc(t,n),[2,new ow(new tm(t,e.loggerProvider,e.serverZone,n.configServerUrl),e)]})})];case 1:return u.joinedConfigGenerator=k.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:h=(c=k.sent()).joinedConfig,d=c.localConfig,f=c.remoteConfig,this.config=h,this.setMetadata(n.sessionId,h,d,f,null==(r=n.version)?void 0:r.version,o4,null==(i=n.version)?void 0:i.type),n.sessionId&&(null==(o=this.config.interactionConfig)?void 0:o.enabled)&&(p=s_.default({sessionId:n.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[p.send(this.getDeviceId.bind(this)).bind(p)],this.scrollHook=p.hook.bind(p),this.clickHandler=new sw(this.loggerProvider,p)),g=[],"idb"!==(m=this.config.storeType)||(null==(s=(0,eU.getGlobalScope)())?void 0:s.indexedDB)||(m="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(m," for event storage.")),k.label=3;case 3:return k.trys.push([3,5,,6]),[4,so({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:m})];case 4:return v=k.sent(),g.push({name:"replay",manager:v}),[3,6];case 5:return y=k.sent(),this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(y.toString())),[3,6];case 6:if(!(null==(a=this.config.interactionConfig)?void 0:a.enabled))return[3,10];b=this.config.interactionConfig.batch?sb:sy,k.label=7;case 7:return k.trys.push([7,9,,10]),[4,so({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!=(l=this.config.interactionConfig.trackEveryNms)?l:3e4,maxInterval:6e4,payloadBatcher:b,storeType:m})];case 8:return w=k.sent(),g.push({name:"interaction",manager:w}),[3,10];case 9:return y=k.sent(),this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(y.toString())),[3,10];case 10:if(this.eventsManager=new(ss.bind.apply(ss,(0,ev.__spreadArray)([void 0],(0,ev.__read)(g),!1))),this.eventCompressor&&this.eventCompressor.terminate(),x=void 0,S=(0,eU.getGlobalScope)(),!(this.config.useWebWorker&&S&&S.Worker))return[3,12];return[4,e.A(481156)];case 11:x=k.sent().compressionScript,k.label=12;case 12:return this.eventCompressor=new o2(this.eventsManager,this.config,this.getDeviceId(),x),[4,this.initializeNetworkObservers()];case 13:return k.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:n.userProperties},!0)];case 14:return k.sent(),[2]}})})},t.prototype.setSessionId=function(e,t){return e$(this.asyncSetSessionId(e,t))},t.prototype.asyncSetSessionId=function(e,t,n){var r;return(0,ev.__awaiter)(this,void 0,void 0,function(){var i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(i=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(i),o=t||this.getDeviceId(),this.identifiers=new sO({sessionId:e,deviceId:o}),!(this.joinedConfigGenerator&&i))return[3,2];return[4,this.joinedConfigGenerator.generateJoinedConfig()];case 1:s=a.sent().joinedConfig,this.config=s,a.label=2;case 2:if(!(null==(r=this.config)?void 0:r.targetingConfig))return[3,4];return[4,this.evaluateTargetingAndCapture({userProperties:null==n?void 0:n.userProperties},!1,!0)];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[2]}})})},t.prototype.getSessionReplayProperties=function(){var e,t=this.config,n=this.identifiers;if(!t||!n)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var r=this.getShouldRecord(),i={};return r&&((e={})[i2]=n.sessionReplayId?n.sessionReplayId:null,i=e,t.debugMode&&(i[i8]=JSON.stringify({appHash:t_(t.apiKey).toString()}))),this.addCustomRRWebEvent(eo.GET_SR_PROPS,{shouldRecord:r,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},t.prototype.sendEvents=function(e){var t,n=e||(null==(t=this.identifiers)?void 0:t.sessionId),r=this.getDeviceId();this.eventsManager&&n&&r&&this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:r})},t.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),(0,ev.__awaiter)(this,void 0,void 0,function(){var n;return(0,ev.__generator)(this,function(r){return(null==(t=this.identifiers)?void 0:t.sessionId)?(n=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:n}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},t.prototype.shouldOptOut=function(){if(null==(e=this.config)?void 0:e.instanceName){var e,t,n;n=tl(this.config.instanceName).identityStore.getIdentity().optOut}return void 0!==n?n:null==(t=this.config)?void 0:t.optOut},t.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,n=!1,r="",i=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(r="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(r),n=!0,i=!0):(r="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(r),n=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,31*Math.abs(t_(e.toString()))%1e6/1e6<t)?(n=!0,i=!0):(r="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(r),n=!1,i=!1),this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(eo.TARGETING_DECISION,{message:r,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},t.prototype.getBlockSelectors=function(){var e,t,n,r=null!=(n=null==(t=null==(e=this.config)?void 0:e.privacyConfig)?void 0:t.blockSelector)?n:[];if(0!==r.length)return r},t.prototype.getMaskTextSelectors=function(){if((null==(t=null==(e=this.config)?void 0:e.privacyConfig)?void 0:t.defaultMaskLevel)==="conservative")return"*";var e,t,n,r,i=null==(r=null==(n=this.config)?void 0:n.privacyConfig)?void 0:r.maskSelector;if(i)return i},t.prototype.getRecordingPlugins=function(t){var n,r,i,o,s,a;return(0,ev.__awaiter)(this,void 0,void 0,function(){var l,u,c,h;return(0,ev.__generator)(this,function(d){switch(d.label){case 0:l=[];try{u=sT({ugcFilterRules:(null==(r=null==(n=this.config)?void 0:n.interactionConfig)?void 0:r.ugcFilterRules)||[],enablePolling:(null==(i=this.config)?void 0:i.enableUrlChangePolling)||!1,pollingInterval:null==(o=this.config)?void 0:o.urlChangePollingInterval,captureDocumentTitle:null==(s=this.config)?void 0:s.captureDocumentTitle}),l.push(u)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null==(a=null==t?void 0:t.console)?void 0:a.enabled))return[3,4];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,e.A(580680)];case 2:return c=d.sent().getRecordConsolePlugin,l.push(c({level:t.console.levels})),[3,4];case 3:return h=d.sent(),this.loggerProvider.warn("Failed to load console plugin:",h),[3,4];case 4:return[2,l.length>0?l:void 0]}})})},t.prototype.getRecordFunction=function(){return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,ev.__generator)(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.A(355074)];case 2:return t=r.sent().record,this.recordFunction=t,[2,t];case 3:return n=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",n),[2,null];case 4:return[2]}})})},t.prototype.recordEvents=function(e){var t,n,r,i,o,s,a;return void 0===e&&(e=!0),(0,ev.__awaiter)(this,void 0,void 0,function(){var l,u,c,h,d,f,p,g,m,v,y,b,w,x=this;return(0,ev.__generator)(this,function(S){switch(S.label){case 0:if(l=this.config,u=this.getShouldRecord(),c=null==(t=this.identifiers)?void 0:t.sessionId,!u||!c||!l)return[2];return this.stopRecordingEvents(),[4,this.getRecordFunction()];case 1:if(!(h=S.sent()))return[2];return[4,this.initializeNetworkObservers()];case 2:S.sent(),null==(n=this.networkObservers)||n.start(function(e){x.addCustomRRWebEvent(eo.FETCH_REQUEST,e)}),d=l.privacyConfig,f=l.interactionConfig,p=l.loggingConfig,g=(null==f?void 0:f.enabled)?{mouseInteraction:this.eventsManager&&(null==(r=this.clickHandler)?void 0:r.createHook({eventsManager:this.eventsManager,sessionId:c,deviceIdFn:this.getDeviceId.bind(this),mirror:h.mirror,ugcFilterRules:null!=(i=f.ugcFilterRules)?i:[],performanceOptions:null==(o=l.performanceConfig)?void 0:o.interaction})),scroll:this.scrollHook}:{},m=(null==f?void 0:f.enabled)&&f.ugcFilterRules?f.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(c,".")),S.label=3;case 3:return S.trys.push([3,5,,6]),v=this,y=h,w={emit:function(e){if(x.shouldOptOut()){x.loggerProvider.log("Opting session ".concat(c," out of recording due to optOut config.")),x.stopRecordingEvents(),x.sendEvents();return}e.type===oh.Meta&&(e.data.href=os(e.data.href,m)),x.eventCompressor&&x.eventCompressor.enqueueEvent(e,c)},inlineStylesheet:l.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:i6,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:l.applyBackgroundColorToBlockedElements,maskInputFn:ot("input",d),maskTextFn:ot("text",d),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null==(s=l.omitElementTags)?void 0:s.script,comment:null==(a=l.omitElementTags)?void 0:a.comment},errorHandler:function(e){if(e.message.includes("insertRule")&&e.message.includes("CSSStyleSheet")||e._external_)throw e;return x.loggerProvider.warn("Error while capturing replay: ",e.toString()),!0}},[4,this.getRecordingPlugins(p)];case 4:return v.recordCancelCallback=y.apply(void 0,[(w.plugins=S.sent(),w)]),this.addCustomRRWebEvent(eo.DEBUG_INFO),e&&this.addCustomRRWebEvent(eo.METADATA,this.metadata),[3,6];case 5:return b=S.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[3,6];case 6:return[2]}})})},t.prototype.getDeviceId=function(){var e;return null==(e=this.identifiers)?void 0:e.deviceId},t.prototype.getSessionId=function(){var e;return null==(e=this.identifiers)?void 0:e.sessionId},t.prototype.flush=function(e){var t;return void 0===e&&(e=!1),(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return[2,null==(t=this.eventsManager)?void 0:t.flush(e)]})})},t.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},t.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},t.prototype.setMetadata=function(e,t,n,r,i,o,s){var a=(null==e?void 0:e.toString())?t_(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:n,remoteConfig:r,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(s),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:o}},t.prototype.initializeNetworkObservers=function(){var t,n,r;return(0,ev.__awaiter)(this,void 0,void 0,function(){var i,o;return(0,ev.__generator)(this,function(s){switch(s.label){case 0:if(!((null==(r=null==(n=null==(t=this.config)?void 0:t.loggingConfig)?void 0:n.network)?void 0:r.enabled)&&!this.networkObservers))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,e.A(198050)];case 2:return i=s.sent().NetworkObservers,this.networkObservers=new i,[3,4];case 3:return o=s.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",o),[3,4];case 4:return[2]}})})},t}(),sA=function(e){return function(){var t=e.config||ou();return{logger:t.loggerProvider,logLevel:t.logLevel}}};let sR={init:e4((E=new sP).init.bind(E),"init",sA(E)),evaluateTargetingAndCapture:e4(E.evaluateTargetingAndCapture.bind(E),"evaluateTargetingAndRecord",sA(E)),setSessionId:e4(E.setSessionId.bind(E),"setSessionId",sA(E)),getSessionId:e4(E.getSessionId.bind(E),"getSessionId",sA(E)),getSessionReplayProperties:e4(E.getSessionReplayProperties.bind(E),"getSessionReplayProperties",sA(E)),flush:e4(E.flush.bind(E),"flush",sA(E)),shutdown:e4(E.shutdown.bind(E),"shutdown",sA(E))};var sM=sR.init,sI=sR.setSessionId,sD=sR.getSessionId,sL=sR.getSessionReplayProperties,sN=sR.flush,sB=sR.shutdown,sF=sR.evaluateTargetingAndCapture;(T=ec||(ec={})).SET="$set",T.SET_ONCE="$setOnce",T.ADD="$add",T.APPEND="$append",T.PREPEND="$prepend",T.REMOVE="$remove",T.PREINSERT="$preInsert",T.POSTINSERT="$postInsert",T.UNSET="$unset",T.CLEAR_ALL="$clearAll",(P=eh||(eh={})).REVENUE_PRODUCT_ID="$productId",P.REVENUE_QUANTITY="$quantity",P.REVENUE_PRICE="$price",P.REVENUE_TYPE="$revenueType",P.REVENUE_CURRENCY="$currency",P.REVENUE="$revenue",(A=ed||(ed={})).IDENTIFY="$identify",A.GROUP_IDENTIFY="$groupidentify",A.REVENUE="revenue_amount";var sj=[ec.SET,ec.SET_ONCE,ec.ADD,ec.APPEND,ec.PREPEND,ec.POSTINSERT],sU=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach(function(n){if(sj.includes(n)){var r=e.user_properties&&e.user_properties[n];t=(0,ev.__assign)((0,ev.__assign)({},t),r)}}),t}},sq="1.25.9",sW="".concat("[Amplitude]"," Session Replay ID"),sz=function(){function e(t){this.name=e.pluginName,this.type="enrichment",this.config=null,this.sessionReplay={flush:sN,getSessionId:sD,getSessionReplayProperties:sL,init:sM,setSessionId:sI,shutdown:sB,evaluateTargetingAndCapture:sF},this.options=(0,ev.__assign)({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){var n,r,i,o,s,a,l,u;return(0,ev.__awaiter)(this,void 0,void 0,function(){var t,c;return(0,ev.__generator)(this,function(h){switch(h.label){case 0:var d;return h.trys.push([0,2,,3]),null==e||e.loggerProvider.log("Installing @amplitude/plugin-session-replay, version ".concat(sq,".")),this.config=e,this.options.forceSessionTracking&&("boolean"==typeof e.defaultTracking?!1===e.defaultTracking&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=(0,ev.__assign)((0,ev.__assign)({},e.defaultTracking),{sessions:!0})),t=(void 0===(d=this.config.instanceName)&&(d="$default_instance"),ta.getInstance(d)).identityStore.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:null!=(n=this.options.deviceId)?n:this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||(null==(r=this.config.remoteConfig)?void 0:r.serverUrl),trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:null==(i=this.options.privacyConfig)?void 0:i.blockSelector,maskSelector:null==(o=this.options.privacyConfig)?void 0:o.maskSelector,unmaskSelector:null==(s=this.options.privacyConfig)?void 0:s.unmaskSelector,defaultMaskLevel:null==(a=this.options.privacyConfig)?void 0:a.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:"plugin",version:sq},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:null!=(l=this.options.useWebWorker)?l:null==(u=this.options.experimental)?void 0:u.useWebWorker,userProperties:t,omitElementTags:this.options.omitElementTags,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return h.sent(),[3,3];case 2:return c=h.sent(),null==e||e.loggerProvider.error("Session Replay: Failed to initialize due to ".concat(c.message)),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(e){var t;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){switch(n.label){case 0:return null==(t=this.config)||t.loggerProvider.debug("Analytics session id is changed to ".concat(e,", SR session id is ").concat(String(this.sessionReplay.getSessionId()),".")),[4,this.sessionReplay.setSessionId(e).promise];case 1:return n.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){switch(n.label){case 0:if(null==(t=this.config)||t.loggerProvider.debug("optOut is changed to ".concat(String(e),", calling ").concat(e?"sessionReplay.shutdown()":"sessionReplay.init()",".")),!e)return[3,1];return this.sessionReplay.shutdown(),[3,4];case 1:if(null==this.config)return[3,3];return[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise];case 2:n.sent(),n.label=3;case 3:n.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var t,n;return(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i,o,s;return(0,ev.__generator)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,9,,10]),!this.options.customSessionId)return[3,4];if(!(r=this.options.customSessionId(e)))return[3,3];if(r===this.sessionReplay.getSessionId())return[3,2];return[4,this.sessionReplay.setSessionId(r).promise];case 1:a.sent(),a.label=2;case 2:i=this.sessionReplay.getSessionReplayProperties(),e.event_properties=(0,ev.__assign)((0,ev.__assign)({},e.event_properties),i),a.label=3;case 3:return[3,8];case 4:if(!((r=null==(t=this.config)?void 0:t.sessionId)&&r!==this.sessionReplay.getSessionId()))return[3,6];return[4,this.sessionReplay.setSessionId(r).promise];case 5:a.sent(),a.label=6;case 6:if(!(r&&r===e.session_id))return[3,8];return o=void 0,e.event_type===$.IDENTIFY&&(o=sU(e)),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:o})];case 7:a.sent(),i=this.sessionReplay.getSessionReplayProperties(),e.event_properties=(0,ev.__assign)((0,ev.__assign)({},e.event_properties),i),a.label=8;case 8:return e.event_type===$.IDENTIFY&&e.event_properties&&delete e.event_properties[sW],[2,Promise.resolve(e)];case 9:return s=a.sent(),null==(n=this.config)||n.loggerProvider.error("Session Replay: Failed to enrich event due to ".concat(s.message)),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){null==(e=this.config)||e.loggerProvider.error("Session Replay: teardown failed due to ".concat(t.message))}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName="@amplitude/plugin-session-replay-browser",e}(),sV=e.i(768072),sH=function(e,t){return(sH=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function sQ(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}sH(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s$=function(){return(s$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function sK(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})}function sX(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){var u=[a,l];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function sG(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function sZ(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function sY(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var sJ="is not",s0="contains",s1="does not contain",s2="less",s3="less or equal",s4="greater",s8="greater or equal",s6="version less",s5="version less or equal",s9="version greater",s7="version greater or equal",ae="set is",at="set is not",an="set contains",ar="set does not contain",ai="set contains any",ao="set does not contain any",as=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:((64512&i)==55296&&r+1<e.length&&(64512&e.charCodeAt(r+1))==56320?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128):t[n++]=i>>12|224,t[n++]=i>>6&63|128),t[n++]=63&i|128)}return Uint8Array.from(t)},aa=function(e,t){void 0===t&&(t=0);for(var n=as(e),r=n.length,i=r>>2,o=t,s=0;s<i;s++)o=al(ah(n,s<<2),o);var a=i<<2,l=0;switch(r-a){case 3:l^=n[a+2]<<16,l^=n[a+1]<<8,l^=n[a],o^=l=Math.imul(l=ac(l=Math.imul(l,-0x3361d2af),15),0x1b873593);break;case 2:l^=n[a+1]<<8,l^=n[a],o^=l=Math.imul(l=ac(l=Math.imul(l,-0x3361d2af),15),0x1b873593);break;case 1:l^=n[a],o^=l=Math.imul(l=ac(l=Math.imul(l,-0x3361d2af),15),0x1b873593)}return au(o^=r)>>>0},al=function(e,t){var n=e,r=t;return r^=n=Math.imul(n=ac(n=Math.imul(n,-0x3361d2af),15),0x1b873593),(r=Math.imul(r=ac(r,13),5))+-0x19ab949c|0},au=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-0x7a143595),t^=t>>>13,t=Math.imul(t,-0x3d4d51cb),t^=t>>>16},ac=function(e,t,n){void 0===n&&(n=32),t>n&&(t%=n);var r=(e&0xffffffff<<n-t>>>0)>>>0>>>n-t>>>0;return(e<<t|r)>>>0},ah=function(e,t){return void 0===t&&(t=0),ad(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},ad=function(e){return(-0x1000000&e)>>>24|(0xff0000&e)>>>8|(65280&e)<<8|(255&e)<<24},af=function(e,t){var n,r;if(t&&0!==t.length){try{for(var i=sG(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!s||!e||"object"!=typeof e)return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}if(null==e)return;return e}},ap="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),ag=function(){function e(e,t,n,r){void 0===r&&(r=void 0),this.major=e,this.minor=t,this.patch=n,this.preRelease=r}return e.parse=function(t){if(t){var n=new RegExp(ap).exec(t);if(n){var r=Number(n[1]),i=Number(n[2]);if(!(isNaN(r)||isNaN(i)))return new e(r,i,Number(n[4])||0,n[5]||void 0)}}},e.prototype.compareTo=function(e){if(this.major>e.major)return 1;if(this.major<e.major)return -1;if(this.minor>e.minor)return 1;if(this.minor<e.minor)return -1;if(this.patch>e.patch)return 1;if(this.patch<e.patch||this.preRelease&&!e.preRelease)return -1;if(!this.preRelease&&e.preRelease)return 1;if(this.preRelease&&e.preRelease){if(this.preRelease>e.preRelease)return 1;if(this.preRelease<e.preRelease)return -1}return 0},e}(),am=function(){function e(){}return e.prototype.evaluate=function(e,t){var n,r,i={},o={context:e,result:i};try{for(var s=sG(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},e.prototype.evaluateFlag=function(e,t){try{for(var n,r,i,o=sG(t.segments),s=o.next();!s.done;s=o.next()){var a=s.value;if(i=this.evaluateSegment(e,t,a)){var l=s$(s$(s$({},t.metadata),a.metadata),i.metadata);i=s$(s$({},i),{metadata:l});break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.evaluateSegment=function(e,t,n){if(!n.conditions){var r=this.bucket(e,n);return void 0!==r?t.variants[r]:void 0}if(this.evaluateConditions(e,n.conditions)){var r=this.bucket(e,n);if(void 0!==r)return t.variants[r]}},e.prototype.evaluateConditions=function(e,t){var n,r,i,o;try{for(var s=sG(t),a=s.next();!a.done;a=s.next()){var l=a.value,u=!0;try{for(var c=(i=void 0,sG(l)),h=c.next();!h.done;h=c.next()){var d=h.value;if(!(u=this.matchCondition(e,d)))break}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return!1},e.prototype.matchCondition=function(e,t){var n=af(e,t.selector);if(null==n)return this.matchNull(t.op,t.values);if(this.isSetOperator(t.op)){var r=this.coerceStringArray(n);return!!r&&this.matchSet(r,t.op,t.values)}var i=this.coerceString(n);return void 0!==i&&this.matchString(i,t.op,t.values)},e.prototype.getHash=function(e){return aa(e)},e.prototype.bucket=function(e,t){if(!t.bucket)return t.variant;var n,r,i,o,s=this.coerceString(af(e,t.bucket.selector));if(!s||0===s.length)return t.variant;var a="".concat(t.bucket.salt,"/").concat(s),l=this.getHash(a),u=l%100,c=Math.floor(l/100);try{for(var h=sG(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var f=d.value,p=f.range[0],g=f.range[1];if(u>=p&&u<g)try{for(var m=(i=void 0,sG(f.distributions)),v=m.next();!v.done;v=m.next()){var y=v.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}return t.variant},e.prototype.matchNull=function(e,t){var n=this.containsNone(t);switch(e){case"is":case s0:case s2:case s3:case s4:case s8:case s6:case s5:case s9:case s7:case ae:case an:case ai:return n;case sJ:case s1:case ar:case ao:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case ae:return this.setEquals(e,n);case at:return!this.setEquals(e,n);case an:return this.matchesSetContainsAll(e,n);case ar:return!this.matchesSetContainsAll(e,n);case ai:return this.matchesSetContainsAny(e,n);case ao:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case"is":return this.matchesIs(e,n);case sJ:return!this.matchesIs(e,n);case s0:return this.matchesContains(e,n);case s1:return!this.matchesContains(e,n);case s2:case s3:case s4:case s8:return this.matchesComparable(e,t,n,function(e){return r.parseNumber(e)},this.comparator);case s6:case s5:case s9:case s7:return this.matchesComparable(e,t,n,function(e){return ag.parse(e)},this.versionComparator);case"regex match":return this.matchesRegex(e,n);case"regex does not match":return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var n=e.toLowerCase();if("true"===n||"false"===n)return t.some(function(e){return e.toLowerCase()===n})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var n,r;try{for(var i=sG(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.toLowerCase().includes(s.toLowerCase()))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.matchesComparable=function(e,t,n,r,i){var o=this,s=r(e),a=n.map(function(e){return r(e)}).filter(function(e){return void 0!==e});return void 0===s||0===a.length?n.some(function(n){return o.comparator(e,t,n)}):a.some(function(e){return i(s,t,e)})},e.prototype.comparator=function(e,t,n){switch(t){case s2:case s6:return e<n;case s3:case s5:return e<=n;case s4:case s9:return e>n;case s8:case s7:return e>=n;default:return!1}},e.prototype.versionComparator=function(e,t,n){var r=e.compareTo(n);switch(t){case s2:case s6:return r<0;case s3:case s5:return r<=0;case s4:case s9:return r>0;case s8:case s7:return r>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return!!new RegExp(t).exec(e)})},e.prototype.containsNone=function(e){return e.some(function(e){return"(none)"===e})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}})},e.prototype.parseNumber=function(e){var t;return null!=(t=Number(e))?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e)){var n=e;return n.map(function(e){return t.coerceString(e)}).filter(Boolean)}var r=String(e);try{var i=JSON.parse(r);if(Array.isArray(i)){var n=e;return n.map(function(e){return t.coerceString(e)}).filter(Boolean)}var o=this.coerceString(r);return o?[o]:void 0}catch(e){var o=this.coerceString(r);return o?[o]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case ae:case at:case an:case ar:case ai:case ao:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var n=new Set(e),r=new Set(t);return n.size===r.size&&sY([],sZ(r),!1).every(function(e){return n.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var n,r;if(e.length<t.length)return!1;try{for(var i=sG(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(!this.matchesIs(s,e))return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var n,r;try{for(var i=sG(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(this.matchesIs(s,e))return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e}(),av=function(e,t){var n,r,i=s$({},e),o=[],s=t||Object.keys(i);try{for(var a=sG(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=ay(u,i);c&&o.push.apply(o,sY([],sZ(c),!1))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},ay=function(e,t,n){void 0===n&&(n=[]);var r,i,o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];n.push(o.key);var s=[],a=function(e){if(n.some(function(t){return t===e}))throw Error("Detected a cycle between flags ".concat(n));var r=ay(e,t,n);r&&s.push.apply(s,sY([],sZ(r),!1))};try{for(var l=sG(o.dependencies),u=l.next();!u.done;u=l.next()){var c=u.value;a(c)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s.push(o),n.pop(),delete t[o.key],s}};let ab="function"==typeof sV.Buffer,aw="function"==typeof TextDecoder?new TextDecoder:void 0,ax="function"==typeof TextEncoder?new TextEncoder:void 0,aS=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),ak=(n={},aS.forEach((e,t)=>n[e]=t),n),a_=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,aO=String.fromCharCode.bind(String),aC="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),aE=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),aT="function"==typeof btoa?e=>btoa(e):ab?e=>sV.Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,i,o="",s=e.length%3;for(let s=0;s<e.length;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(i=e.charCodeAt(s++))>255)throw TypeError("invalid character found");o+=aS[(t=n<<16|r<<8|i)>>18&63]+aS[t>>12&63]+aS[t>>6&63]+aS[63&t]}return s?o.slice(0,s-3)+"===".substring(s):o},aP=ab?e=>sV.Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(aO.apply(null,e.subarray(n,n+4096)));return aT(t.join(""))},aA=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?aO(192|t>>>6)+aO(128|63&t):aO(224|t>>>12&15)+aO(128|t>>>6&63)+aO(128|63&t)}var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return aO(240|t>>>18&7)+aO(128|t>>>12&63)+aO(128|t>>>6&63)+aO(128|63&t)},aR=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,aM=ab?e=>sV.Buffer.from(e,"utf8").toString("base64"):ax?e=>aP(ax.encode(e)):e=>aT(e.replace(aR,aA)),aI=(e,t=!1)=>t?aE(aM(e)):aM(e),aD=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,aL=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return aO((t>>>10)+55296)+aO((1023&t)+56320);case 3:return aO((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return aO((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},aN="function"==typeof atob?e=>atob(e.replace(/[^A-Za-z0-9\+\/]/g,"")):ab?e=>sV.Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!a_.test(e))throw TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n="",r,i;for(let o=0;o<e.length;)t=ak[e.charAt(o++)]<<18|ak[e.charAt(o++)]<<12|(r=ak[e.charAt(o++)])<<6|(i=ak[e.charAt(o++)]),n+=64===r?aO(t>>16&255):64===i?aO(t>>16&255,t>>8&255):aO(t>>16&255,t>>8&255,255&t);return n},aB=ab?e=>aC(sV.Buffer.from(e,"base64")):e=>aC(aN(e).split("").map(e=>e.charCodeAt(0))),aF=ab?e=>sV.Buffer.from(e,"base64").toString("utf8"):aw?e=>aw.decode(aB(e)):e=>aN(e).replace(aD,aL);var aj=function(e){function t(n,r){var i=e.call(this,r)||this;return i.statusCode=n,Object.setPrototypeOf(i,t.prototype),i}return sQ(t,e),t}(Error),aU=function(e){function t(n){var r=e.call(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return sQ(t,e),t}(Error),aq=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return sK(this,void 0,void 0,function(){var n,r,i,o;return sX(this,function(s){switch(s.label){case 0:return n=aI(JSON.stringify(e),!0),r={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":n},(null==t?void 0:t.flagKeys)&&(r["X-Amp-Exp-Flag-Keys"]=aI(JSON.stringify(t.flagKeys),!0)),(null==t?void 0:t.trackingOption)&&(r["X-Amp-Exp-Track"]=t.trackingOption),(null==t?void 0:t.exposureTrackingOption)&&(r["X-Amp-Exp-Exposure-Track"]=t.exposureTrackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:r,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=s.sent()).status)throw new aj(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}})})},e}(),aW=function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return sK(this,void 0,void 0,function(){var t,n;return sX(this,function(r){switch(r.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=aI(JSON.stringify(e.user),!0)),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(n=r.sent()).status)throw Error("Flags error response: status=".concat(n.status));return[2,JSON.parse(n.body).reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}(),az="u">typeof globalThis?globalThis:e.g||self,aV=function(){return"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof self?self:e.g},aH=function(){var e=aV();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){}return!1},aQ=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=az.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(az.clearInterval(this.poller),this.poller=void 0)},e}(),a$=e.i(484404);function aK(e){this.amplitudeInstance=e}function aX(e){this.amplitudeInstance=e}aK.prototype.getUser=function(){var e,t,n,r,i,o,s,a,l,u;return{device_id:null==(t=null==(e=this.amplitudeInstance)?void 0:e.options)?void 0:t.deviceId,user_id:null==(r=null==(n=this.amplitudeInstance)?void 0:n.options)?void 0:r.userId,version:null==(o=null==(i=this.amplitudeInstance)?void 0:i.options)?void 0:o.versionName,language:null==(a=null==(s=this.amplitudeInstance)?void 0:s.options)?void 0:a.language,platform:null==(u=null==(l=this.amplitudeInstance)?void 0:l.options)?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},aK.prototype.getOs=function(){var e,t,n,r,i,o;return[null==(n=null==(t=null==(e=this.amplitudeInstance)?void 0:e._ua)?void 0:t.browser)?void 0:n.name,null==(o=null==(i=null==(r=this.amplitudeInstance)?void 0:r._ua)?void 0:i.browser)?void 0:o.major].filter(function(e){return null!=e}).join(" ")},aK.prototype.getDeviceModel=function(){var e,t,n;return null==(n=null==(t=null==(e=this.amplitudeInstance)?void 0:e._ua)?void 0:t.os)?void 0:n.name},aX.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},aX.prototype.setUserProperty=function(e){var t,n;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null==(n=e.variant)?void 0:n.value,t))},aX.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:((t={})[e.userProperty]="-",t)})};var aG=function(){return(aG=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function aZ(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})}function aY(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){var u=[a,l];if(n)throw TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function aJ(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a0(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a1(e,t,n){if(n||2==arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var a2=function(e,t){void 0===t&&(t=!1);var n,r,i=a8(e,t),o=void 0,s=az.document.cookie.split("; ");try{for(var a=aJ(s),l=a.next();!l.done;l=a.next()){var u=l.value,c=a0(u.split("=",2),2),h=c[0],d=c[1];h===i&&(o=decodeURIComponent(d))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}if(o)try{if(t){var f=atob(o);return JSON.parse(decodeURIComponent(f))}var p=o.split("."),g=void 0;return p.length>=2&&p[1]&&(g=atob(p[1])),{deviceId:p[0],userId:g}}catch(e){return}},a3=function(e){var t=a8(e,!0);try{var n=az.localStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}},a4=function(e){var t=a8(e,!0);try{var n=az.sessionStorage.getItem(t);if(!n)return;var r=JSON.parse(n);if("object"!=typeof r)return;return r}catch(e){return}},a8=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},a6=function(){function e(e,t,n){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=n,this.loadPersistedState(),n<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return aZ(this,void 0,void 0,function(){return aY(this,function(n){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener(function(){null==t||t.fetch()}),[2,this.waitForConnectorIdentity(this.timeoutMillis)]})})},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=a2(this.apiKey,!0);return!!(e||(e=a2(this.apiKey,!1))||(e=a3(this.apiKey))||(e=a4(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return aZ(this,void 0,void 0,function(){var t,n=this;return aY(this,function(r){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise(function(e){var t=function(){e(),n.identityStore.removeIdentityListener(t)};n.identityStore.addIdentityListener(t)}),new Promise(function(t,n){az.setTimeout(n,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")})])]})})},e}(),a5=az.fetch||function(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],s=[],a={},l=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),s.push([t,n]),a[t]=a[t]?a[t]+","+n:n}),n(l())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)})},a9=function(){function e(e){this.client=e}return e.prototype.request=function(e){return aZ(this,void 0,void 0,function(){return aY(this,function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}})})},e}(),a7={request:function(e,t,n,r,i){var o;return o=aZ(void 0,void 0,void 0,function(){var i,o;return aY(this,function(s){switch(s.label){case 0:return[4,a5(e,{method:t,headers:n,body:r})];case 1:return o={status:(i=s.sent()).status},[4,i.text()];case 2:return o.body=s.sent(),[2,o]}})}),null==i||i<=0?o:new Promise(function(e,t){az.setTimeout(function(){t(new aU("Request timeout after "+i+" milliseconds"))},i),o.then(e,t)})}};(R=ef||(ef={}))[R.Disable=0]="Disable",R[R.Error=1]="Error",R[R.Warn=2]="Warn",R[R.Info=3]="Info",R[R.Debug=4]="Debug",R[R.Verbose=5]="Verbose",(M=ep||(ep={})).LocalStorage="localStorage",M.InitialVariants="initialVariants",(I=eg||(eg={})).LocalStorage="storage",I.InitialVariants="initial",I.SecondaryLocalStorage="secondary-storage",I.SecondaryInitialVariants="secondary-initial",I.FallbackInline="fallback-inline",I.FallbackConfig="fallback-config",I.LocalEvaluation="local-evaluation";var le=function(e){return!e||e===eg.FallbackInline||e===eg.FallbackConfig||e===eg.SecondaryInitialVariants},lt={debug:!1,logLevel:ef.Error,loggerProvider:null,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:ep.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:a7},ln="1.20.1",lr=function(){function e(e,t){var n,r=this;this.isReady=new Promise(function(e){r.resolve=e}),this.config=e,this.client=t;var i=null!=(n=e.instanceName)?n:lt.instanceName;this.queue=new lo(i),this.cache=new li(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()},function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,n,r,i={eventType:"$exposure",eventProperties:e};return(null==(t=e.metadata)?void 0:t.exposureEvent)?i={eventType:null==(n=e.metadata)?void 0:n.exposureEvent,eventProperties:e}:(null==(r=e.metadata)?void 0:r.deliveryMethod)==="web"&&(i={eventType:"$impression",eventProperties:e}),i},e}(),li=function(){function e(e){this.isSessionStorageAvailable=ls(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&az.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){if((null==(t=e.metadata)?void 0:t.deliveryMethod)==="web")return!0;this.loadCache();var t,n=this.inMemoryCache[e.flag_key],r=!1;return n&&n.variant===e.variant||(r=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),r},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=az.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&az.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),lo=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=aH(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=az.setInterval(function(){t.loadFlushStore()},1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var n=aJ(this.inMemoryQueue),r=n.next();!r.done;r=n.next()){var i=r.value;try{if(!this.tracker(i))return}catch(e){return}}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(az.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=az.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),az.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),ls=function(){var e=aV();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){}return!1},la=function(){function e(e,t){void 0===t&&(t=ef.Error),this.logger=e,this.logLevel=t}return e.prototype.error=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=ef.Error&&(t=this.logger).error.apply(t,a1([e],a0(n),!1))},e.prototype.warn=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=ef.Warn&&(t=this.logger).warn.apply(t,a1([e],a0(n),!1))},e.prototype.info=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=ef.Info&&(t=this.logger).info.apply(t,a1([e],a0(n),!1))},e.prototype.debug=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=ef.Debug&&(t=this.logger).debug.apply(t,a1([e],a0(n),!1))},e.prototype.verbose=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.logLevel>=ef.Verbose&&(t=this.logger).verbose.apply(t,a1([e],a0(n),!1))},e}(),ll=function(){function e(){}return e.prototype.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.error.apply(console,a1([e],a0(t),!1))},e.prototype.warn=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.warn.apply(console,a1([e],a0(t),!1))},e.prototype.info=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.info.apply(console,a1([e],a0(t),!1))},e.prototype.debug=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,a1([e],a0(t),!1))},e.prototype.verbose=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];console.debug.apply(console,a1([e],a0(t),!1))},e}(),lu=function(){function e(){this.globalScope=aV()}return e.prototype.get=function(e){var t;return null==(t=this.globalScope)?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var n;null==(n=this.globalScope)||n.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null==(t=this.globalScope)||t.localStorage.removeItem(e)},e}(),lc=function(e,t,n){var r=e.substring(e.length-6);return new lp("amp-exp-".concat(t,"-").concat(r),n,lg)},lh=function(e,t,n){void 0===n&&(n=new lu);var r=e.substring(e.length-6);return new lp("amp-exp-".concat(t,"-").concat(r,"-flags"),n)},ld=function(e,t,n){void 0===n&&(n=new lu);var r=e.substring(e.length-6);return new lf("amp-exp-".concat(t,"-").concat(r,"-variants-options"),n)},lf=function(){function e(e,t){this.namespace=e,this.storage=t}return e.prototype.get=function(){return this.value},e.prototype.put=function(e){this.value=e},e.prototype.load=function(){var e=this.storage.get(this.namespace);e&&(this.value=JSON.parse(e))},e.prototype.store=function(){void 0===this.value?this.storage.delete(this.namespace):this.storage.put(this.namespace,JSON.stringify(this.value))},e}(),lp=function(){function e(e,t,n){this.cache={},this.namespace=e,this.storage=t,this.transformer=n}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return aG({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,n;try{for(var r=aJ(Object.keys(e)),i=r.next();!i.done;i=r.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,n,r=this.storage.get(this.namespace);try{n=JSON.parse(r)||{}}catch(e){return}var i={};try{for(var o=aJ(Object.keys(n)),s=o.next();!s.done;s=o.next()){var a=s.value;try{var l=void 0;(l=this.transformer?this.transformer(n[a]):n[a])&&(i[a]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),lg=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,n=e.value,r=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var s={};return t?s.key=t:n&&(s.key=n),n&&(s.value=n),i&&(s.metadata=i),r&&(s.payload=r),o&&(s.expKey=o),s}},lm=function(){function e(){this.globalScope=aV()}return e.prototype.get=function(e){var t;return null==(t=this.globalScope)?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var n;null==(n=this.globalScope)||n.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null==(t=this.globalScope)||t.sessionStorage.removeItem(e)},e}(),lv=function(e,t,n,r){var i,o=null==n?void 0:n.value,s="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:n,userProperty:s,properties:{key:t,variant:o,source:r},userProperties:((i={})[s]=o,i)}},ly=function(e){return null==e},lb=function(e){return!!ly(e)||e&&0===Object.keys(e).length},lw=function(e){if(!e||"object"!=typeof e)return{};var t,n,r={};try{for(var i=aJ(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=a0(o.value,2),a=s[0],l=s[1];ly(l)||(r[a]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},lx=function(e){var t;return(null==(t=null==e?void 0:e.metadata)?void 0:t.evaluationMode)==="local"},lS=function(){function e(e,t,n,r){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=n,this.scalar=r}return e.prototype.start=function(e){return aZ(this,void 0,void 0,function(){return aY(this,function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}})})},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,n){return aZ(this,void 0,void 0,function(){var r=this;return aY(this,function(i){return this.done||(this.timeoutHandle=az.setTimeout(function(){return aZ(r,void 0,void 0,function(){var r,i;return aY(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(r=t+1)<this.attempts&&(i=Math.min(n*this.scalar,this.max),this.backoff(e,r,i)),[3,3];case 3:return[2]}})})},n)),[2]})})},e}(),lk=function(e){if(!e)return{};var t,n,r,i,o={user:e},s=aV();s&&(o.page={url:s.location.href});var a={};if(!e.groups)return o;try{for(var l=aJ(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,h=e.groups[c];if(h.length>0&&h[0]){var d=h[0],f={group_name:d},p=null==(i=null==(r=e.group_properties)?void 0:r[c])?void 0:i[d];p&&Object.keys(p).length>0&&(f.group_properties=p),a[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return Object.keys(a).length>0&&(o.groups=a),delete o.user.groups,delete o.user.group_properties,o},l_=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},lO=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var n={};return e.key&&(n.key=e.key),e.value&&(n.value=e.value),e.payload&&(n.payload=e.payload),t&&(n.expKey=t),e.metadata&&(n.metadata=e.metadata),n},lC=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),lE=function(){function e(e){this.tracked={},this.identity={},this.exposureTrackingProvider=e}return e.prototype.track=function(e,t){var n={userId:null==t?void 0:t.user_id,deviceId:null==t?void 0:t.device_id};this.identityEquals(this.identity,n)||(this.tracked={}),this.identity=n;var r=e.flag_key in this.tracked,i=this.tracked[e.flag_key];r&&i===e.variant||(this.tracked[e.flag_key]=e.variant,this.exposureTrackingProvider.track(e))},e.prototype.identityEquals=function(e,t){return e.userId===t.userId&&e.deviceId===t.deviceId},e}(),lT=function(){function e(t,n){var r,i,o,s,a,l=this;this.engine=new am,this.isRunning=!1,this.apiKey=t,n=lw(n),this.config=aG(aG(aG({},lt),n),{serverUrl:(null==n?void 0:n.serverUrl)||((null==(r=null==n?void 0:n.serverZone)?void 0:r.toLowerCase())==="eu"?"https://api.lab.eu.amplitude.com":lt.serverUrl),flagsServerUrl:(null==n?void 0:n.flagsServerUrl)||((null==(i=null==n?void 0:n.serverZone)?void 0:i.toLowerCase())==="eu"?"https://flag.lab.eu.amplitude.com":lt.flagsServerUrl),flagConfigPollingIntervalMillis:n.flagConfigPollingIntervalMillis<6e4?6e4:null!=(o=n.flagConfigPollingIntervalMillis)?o:lt.flagConfigPollingIntervalMillis}),this.logger=new la(this.config.loggerProvider||new ll,e.getLogLevel(n));var u=null==(s=this.config)?void 0:s.internalInstanceNameSuffix;if(this.isWebExperiment="web"===u,this.poller=new aQ(function(){return l.doFlags()},this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var c in this.config.initialVariants)this.config.initialVariants[c]=lg(this.config.initialVariants[c]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new lC(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.userSessionExposureTracker=new lE(this.config.exposureTrackingProvider)),this.integrationManager=new lr(this.config,this);var h=new a9(this.config.httpClient||a7);this.flagApi=new aW(this.apiKey,this.config.flagsServerUrl,h),this.evaluationApi=new aq(this.apiKey,this.config.serverUrl,h);var d=u?"".concat(this.config.instanceName,"-").concat(u):this.config.instanceName;a=this.isWebExperiment?new lm:new lu,this.variants=lc(this.apiKey,d,a),this.flags=lh(this.apiKey,d,a),this.fetchVariantsOptions=ld(this.apiKey,d,a);try{this.flags.load(),this.variants.load(),this.fetchVariantsOptions.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return aZ(this,void 0,void 0,function(){var t,n,r;return aY(this,function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:if(i.trys.push([1,6,,7]),t=this.doFlags(),!(null==(r=this.config.fetchOnStart)||r))return[3,3];return[4,Promise.all([this.fetch(e),t])];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(n=i.sent(),this.config.throwOnError)throw n;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}})})},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return aZ(this,arguments,void 0,function(e,t){var n;return void 0===e&&(e=this.user),aY(this,function(r){switch(r.label){case 0:this.setUser(e||{}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return r.sent(),[3,4];case 3:if(n=r.sent(),this.config.throwOnError)throw n;return n instanceof aU?this.logger.debug(n):this.logger.error(n),[3,4];case 4:return[2,this]}})})},e.prototype.variant=function(e,t){if(!this.apiKey)return{value:void 0};var n,r,i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.logger.debug("[Experiment] variant for ".concat(e," is ").concat((null==(n=i.variant)?void 0:n.key)||(null==(r=i.variant)?void 0:r.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e)lx(this.flags.get(t))||delete e[t];return aG(aG(aG({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){if(!this.user)return this.user;if(null==(e=this.user)||!e.user_properties)return aG({},this.user);var e,t=aG({},this.user.user_properties);return aG(aG({},this.user),{user_properties:t})},e.prototype.setUser=function(e){var t;if(!e){this.user=null;return}if(null==(t=this.user)?void 0:t.user_properties){var n=aG({},e.user_properties);this.user=aG(aG({},e),{user_properties:n})}else this.user=aG({},e)},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach(function(t){e.flags.get(t.key)||e.flags.put(t.key,t)})},e.prototype.evaluate=function(e){var t,n,r=this.addContext(this.user),i=av(this.flags.getAll(),e),o=lk(r),s=this.engine.evaluate(o,i),a={};try{for(var l=aJ(Object.keys(s)),u=l.next();!u.done;u=l.next()){var c=u.value;a[c]=lO(s[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},e.prototype.variantAndSource=function(e,t){var n={};this.config.source===ep.LocalStorage?n=this.localStorageVariantAndSource(e,t):this.config.source===ep.InitialVariants&&(n=this.initialVariantsVariantAndSource(e,t));var r=this.flags.get(e);return(lx(r)||!n.variant&&r)&&(n=this.localEvaluationVariantAndSource(e,r,t)),n},e.prototype.localEvaluationVariantAndSource=function(e,t,n){var r,i={},o=this.evaluate([t.key])[e],s=eg.LocalEvaluation,a=null==(r=null==o?void 0:o.metadata)?void 0:r.default;if(!ly(o)&&!a)return{variant:l_(o),source:s,hasDefaultVariant:!1};if(a&&(i={variant:l_(o),source:s,hasDefaultVariant:!0}),!ly(n))return{variant:l_(n),source:eg.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!ly(l))return{variant:l_(l),source:eg.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=l_(this.config.fallbackVariant),c={variant:u,source:eg.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return lb(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var n,r={},i=this.variants.get(e),o=null==(n=null==i?void 0:i.metadata)?void 0:n.default;if(!ly(i)&&!o)return{variant:l_(i),source:eg.LocalStorage,hasDefaultVariant:!1};if(o&&(r={variant:l_(i),source:eg.LocalStorage,hasDefaultVariant:!0}),!ly(t))return{variant:l_(t),source:eg.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var s=this.config.initialVariants[e];if(!ly(s))return{variant:l_(s),source:eg.SecondaryInitialVariants,hasDefaultVariant:r.hasDefaultVariant};var a=l_(this.config.fallbackVariant),l={variant:a,source:eg.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return lb(a)?r:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var n,r={},i=this.config.initialVariants[e];if(!ly(i))return{variant:l_(i),source:eg.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),s=null==(n=null==o?void 0:o.metadata)?void 0:n.default;if(!ly(o)&&!s)return{variant:l_(o),source:eg.LocalStorage,hasDefaultVariant:!1};if(s&&(r={variant:l_(o),source:eg.LocalStorage,hasDefaultVariant:!0}),!ly(t))return{variant:l_(t),source:eg.FallbackInline,hasDefaultVariant:r.hasDefaultVariant};var a=l_(this.config.fallbackVariant),l={variant:a,source:eg.FallbackConfig,hasDefaultVariant:r.hasDefaultVariant};return lb(a)?r:l},e.prototype.fetchInternal=function(e,t,n,r){return aZ(this,void 0,void 0,function(){var i,o,s;return aY(this,function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.logger.debug("[Experiment] Fetch all: retry=".concat(n)),n&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,aG({trackingOption:null==(s=this.fetchVariantsOptions.get())?void 0:s.trackingOption},r))];case 2:return i=a.sent(),[4,this.storeVariants(i,r)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),n&&this.shouldRetryFetch(o)&&this.startRetries(e,r),o;case 5:return[2]}})})},e.prototype.setTracksAssignment=function(e){return aZ(this,void 0,void 0,function(){return aY(this,function(t){return this.fetchVariantsOptions.put(aG(aG({},this.fetchVariantsOptions.get()||{}),{trackingOption:e?"track":"no-track"})),this.fetchVariantsOptions.store(),[2]})})},e.prototype.cleanUserPropsForFetch=function(e){var t=aG({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,n){return aZ(this,void 0,void 0,function(){var r,i,o,s,a,l,u;return aY(this,function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.logger.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,aG({timeoutMillis:t},n))];case 2:r=c.sent(),i={};try{for(s=(o=aJ(Object.keys(r))).next();!s.done;s=o.next())i[a=s.value]=lO(r[a])}catch(e){l={error:e}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.logger.debug("[Experiment] Received variants: ",i),[2,i]}})})},e.prototype.doFlags=function(){return aZ(this,void 0,void 0,function(){var e,t,n;return aY(this,function(r){switch(r.label){case 0:if(r.trys.push([0,4,,5]),e=void 0,!this.isWebExperiment)return[3,2];return[4,this.addContextOrWait(this.getUser())];case 1:e=r.sent(),r.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:ln,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=r.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if((n=r.sent())instanceof aU){if(this.logger.debug(n),this.config.throwOnError)throw n}else throw n;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}})})},e.prototype.storeVariants=function(e,t){return aZ(this,void 0,void 0,function(){var n,r,i,o;return aY(this,function(s){for(o in 0===(n=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),r=function(t){n=n.filter(function(e){return e!==t}),i.variants.put(t,e[t])},i=this,e)r(o);for(o in n)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.logger.debug("[Experiment] Stored variants: ",e),[2]})})},e.prototype.startRetries=function(e,t){return aZ(this,void 0,void 0,function(){var n=this;return aY(this,function(r){return this.logger.debug("[Experiment] Retry fetch"),this.retriesBackoff=new lS(8,500,1e4,1.5),this.retriesBackoff.start(function(){return aZ(n,void 0,void 0,function(){return aY(this,function(n){switch(n.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return n.sent(),[2]}})})}),[2]})})},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,n=null==(t=this.userProvider)?void 0:t.getUser(),r=this.integrationManager.getUser(),i=aG(aG(aG({},null==n?void 0:n.user_properties),r.user_properties),null==e?void 0:e.user_properties);return aG(aG(aG(aG({library:"experiment-js-client/".concat(ln)},n),r),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return aZ(this,void 0,void 0,function(){return aY(this,function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}})})},e.prototype.sourceVariants=function(){return this.config.source==ep.LocalStorage?this.variants.getAll():this.config.source==ep.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==ep.LocalStorage?this.config.initialVariants:this.config.source==ep.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){if(null==(i=null==(r=null==(n=t.variant)?void 0:n.metadata)?void 0:r.trackExposure)||i){this.legacyExposureInternal(e,t.variant,t.source);var n,r,i,o,s,a,l,u,c,h={flag_key:e},d=le(t.source);if(!d||t.hasDefaultVariant){(null==(o=t.variant)?void 0:o.expKey)&&(h.experiment_key=null==(s=t.variant)?void 0:s.expKey);var f=null==(a=t.variant)?void 0:a.metadata;if(d||(null==f?void 0:f.default)||((null==(l=t.variant)?void 0:l.key)?h.variant=t.variant.key:(null==(u=t.variant)?void 0:u.value)&&(h.variant=t.variant.value)),f&&(h.metadata=f),this.isWebExperiment&&(h.time=Date.now()),this.isWebExperiment){var p=aV();if(null==p?void 0:p.location)try{var g=p.location.href;h.metadata.url=g.split("?")[0]||""}catch(e){}}var m=this.addContext(this.getUser());null==(c=this.userSessionExposureTracker)||c.track(h,m),this.integrationManager.track(h)}}},e.prototype.legacyExposureInternal=function(e,t,n){var r,i,o,s,a;if(this.analyticsProvider){var l=lv(this.addContext(this.getUser()),e,t,n);!le(n)&&(null==t?void 0:t.value)?(null==t?void 0:t.value)&&(null==(s=null==(o=this.analyticsProvider)?void 0:o.setUserProperty)||s.call(o,l),null==(a=this.analyticsProvider)||a.track(l)):null==(i=null==(r=this.analyticsProvider)?void 0:r.unsetUserProperty)||i.call(r,l)}},e.getLogLevel=function(e){var t;return!0===e.debug?ef.Debug:null!=(t=e.logLevel)?t:ef.Error},e.prototype.shouldRetryFetch=function(e){return!(e instanceof aj)||e.statusCode<400||e.statusCode>=500||429===e.statusCode},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),lP=function(){function e(e,t){var n,r,i;this.globalScope=aV(),this.userAgent=void 0!==(null==(n=this.globalScope)?void 0:n.navigator)?null==(r=this.globalScope)?void 0:r.navigator.userAgent:void 0,this.ua=new a$.UAParser(this.userAgent).getResult(),this.localStorage=new lu,this.sessionStorage=new lm,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null==(i=this.apiKey)?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,n,r,i,o=(null==(e=this.userProvider)?void 0:e.getUser())||{};return aG({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!=(n=null==(t=this.ua.device)?void 0:t.type)?n:"desktop",referring_url:null==(i=null==(r=this.globalScope)?void 0:r.document)?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,n;return[null==(t=e.browser)?void 0:t.name,null==(n=e.browser)?void 0:n.major].filter(function(e){return null!=e}).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null==(t=e.os)?void 0:t.name},e.prototype.getBrowser=function(e){var t,n=null==(t=e.browser)?void 0:t.name;return(null==n?void 0:n.includes("Chrom"))&&(n="Chrome"),(null==n?void 0:n.includes("Firefox"))&&(n="Firefox"),(null==n?void 0:n.includes("Safari"))&&(n="Safari"),(null==n?void 0:n.includes("Edge"))&&(n="Edge"),(null==n?void 0:n.includes("Opera"))&&(n="Opera"),n},e.prototype.getCookie=function(){var e,t,n,r,i;if(null==(t=null==(e=this.globalScope)?void 0:e.document)?void 0:t.cookie)return Object.fromEntries(null==(i=null==(r=null==(n=this.globalScope)?void 0:n.document)?void 0:r.cookie)?void 0:i.split("; ").map(function(e){return e.split("=")}))},e.prototype.getLandingUrl=function(){var e,t;try{var n=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return n.landing_url||(n.landing_url=null==(t=null==(e=this.globalScope)?void 0:e.location)?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(n))),n.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){if(this.globalScope){var e,t,n,r={};try{var i=new URL(this.globalScope.location.href);try{for(var o=aJ(i.searchParams),s=o.next();!s.done;s=o.next()){var a=a0(s.value,2),l=a[0],u=a[1];r[l]=a1(a1([],a0(null!=(n=r[l])?n:[]),!1),a0(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(r).reduce(function(e,t){var n=a0(t,2),r=n[0],i=n[1];return e[r]=1==i.length?i[0]:i,e},{})}},e}();az.experimentInstances={};var lA=az.experimentInstances,lR=function(e){return(null==e?void 0:e.instanceName)||lt.instanceName},lM=function(e,t){var n=lR(t),r=null==t?void 0:t.internalInstanceNameSuffix;return r?"".concat(n,".").concat(e,".").concat(r):"".concat(n,".").concat(e)},lI=function(e,t,n){var r=lM(e,t),i=lA[r];return i?i:(i=new lT(e,aG(aG({},t),{userProvider:new lP(null==t?void 0:t.userProvider,e)})),n&&i.addPlugin(n()),lA[r]=i,i)};function lD(){}lD.prototype.getUser=function(){return{}},lD.prototype.start=function(e){return aZ(this,void 0,void 0,function(){return aY(this,function(e){return[2]})})},lD.prototype.stop=function(){},lD.prototype.setUser=function(e){},lD.prototype.fetch=function(e,t){return aZ(this,void 0,void 0,function(){return aY(this,function(e){return[2,this]})})},lD.prototype.getUserProvider=function(){return null},lD.prototype.setUserProvider=function(e){return this},lD.prototype.variant=function(e,t){return lt.fallbackVariant},lD.prototype.all=function(){return{}},lD.prototype.clear=function(){},lD.prototype.exposure=function(e){};var lL=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,t){var n;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(t){var r,i;return this.experiment=lI(r=(null==(n=this.config)?void 0:n.deploymentKey)||e.apiKey,i=this.config,function(){return new a6(r,ta.getInstance(lR(i)),1e4)}),[2]})})},e.pluginName="@amplitude/experiment-analytics-plugin",e}(),lN=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:lB(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),lB=function(){return"u">typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},lF=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),lj=function(){return(lj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function lU(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function lq(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}var lW=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=lU(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next())if(s.value===i)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),l=Array.isArray(t);if(a!==l)return!1;if(a&&l){for(var u=0;u<e.length;u++)if(!lW(e[u],t[u]))return!1}else{if(!lW(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(n){lW(e[n],t[n])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var lz=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=lj({},this.identity.userProperties),n=lj(lj({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,l=n.userProperties||{};try{for(var u=lU(Object.entries(e)),c=u.next();!c.done;c=u.next()){var h=lq(c.value,2),d=h[0],f=h[1];switch(d){case"$set":try{for(var p=(i=void 0,lU(Object.entries(f))),g=p.next();!g.done;g=p.next()){var m=lq(g.value,2),v=m[0],y=m[1];l[v]=y}}catch(e){i={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,lU(Object.keys(f))),w=b.next();!w.done;w=b.next()){var v=w.value;delete l[v]}}catch(e){s={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=l,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return lj({},this.identity)},e.prototype.setIdentity=function(e){var t=lj({},this.identity);this.identity=lj({},e),lW(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),lV="u">typeof globalThis?globalThis:"u">typeof window?window:self,lH=function(){function e(){this.identityStore=new lz,this.eventBridge=new lF,this.applicationContextProvider=new lN}return e.getInstance=function(t){return lV.analyticsConnectorInstances||(lV.analyticsConnectorInstances={}),lV.analyticsConnectorInstances[t]||(lV.analyticsConnectorInstances[t]=new e),lV.analyticsConnectorInstances[t]},e}(),lQ=["boot"],l$=((r=l$||{}).Local="https://local.amplitude.com:3010/",r.Staging="https://apps.stag2.amplitude.com/",r.Production="https://app.amplitude.com/",r.ProductionEU="https://app.eu.amplitude.com/",r),lK=((e=>{if("u">typeof window&&window.opener)for(let t of Object.values(l$))window.opener.postMessage({message:e},t)})("ENGAGEMENT_SNIPPET"),D=(e,t,n,r)=>(function(e,t,n,r){for(let i of e){let e=document.createElement("script");e.src=i,e.id="engagement-sdk-bundle",n&&e.setAttribute("nonce",n),t&&e.setAttribute("type",t),r&&(e.onerror=r),document.getElementsByTagName("head")[0].appendChild(e)}})([e||"https://cdn.amplitude.com/engagement-browser/prod/index.min.js.gz"],t,n,r),new Proxy(o={_q:null!=(L=null==(i="u">typeof window?window.engagement:void 0)?void 0:i._q)?L:[],_configuration:{apiKey:null!=(B=null==(N=null==i?void 0:i._configuration)?void 0:N.apiKey)?B:"",serverUrl:null==(F=null==i?void 0:i._configuration)?void 0:F.serverUrl,chatUrl:null==(j=null==i?void 0:i._configuration)?void 0:j.chatUrl,mediaUrl:null==(U=null==i?void 0:i._configuration)?void 0:U.mediaUrl,serverZone:null!=(W=null==(q=null==i?void 0:i._configuration)?void 0:q.serverZone)?W:"US",options:{...null==(z=null==i?void 0:i._configuration)?void 0:z.options}},_sentry:void 0,init(e,t){var n,r,i;let s;if(o._configuration.apiKey)return void console.log("Engagement SDK has already been initialized. Ignoring additional init call.");if(o._configuration={...o._configuration,...t,apiKey:e,options:{splitting:!0,...o._configuration.options,...null==t?void 0:t.options}},null!=(r=null==(n=o._configuration)?void 0:n.options)&&r.logger&&o._configuration.options.logger.enable(null!=(i=o._configuration.options.logLevel)?i:2),null!=t&&t.cdnUrl)s=o._configuration.options.splitting?`${t.cdnUrl}/engagement-browser/prod/split/index.js`:t.cdnUrl+"/engagement-browser/prod/index.min.js.gz";else{let e="EU"===o._configuration.serverZone?"https://cdn.eu.amplitude.com":"https://cdn.amplitude.com";s=o._configuration.options.splitting?`${e}/engagement-browser/prod/split/index.js`:`${e}/engagement-browser/prod/index.min.js.gz`}let a=null,l=()=>{if(a&&(clearTimeout(a),a=null),o._q&&o._q.length>0)for(console.warn(`Engagement SDK failed to load within ${u}ms. Resolving pending calls gracefully.`);o._q.length>0;){let e=o._q.shift();if(!e)continue;let t=e[0],n=lQ.includes(t);if(console.warn(`Engagement SDK method '${t}' still in queue (isAsyncMethod=${n}); attempting to resolve as no-op.`),n&&e[1]instanceof Function&&e[2]instanceof Function){let n=e[1];console.warn(`Engagement SDK method '${t}' resolved as no-op due to script loading failure`),n(void 0)}}};D(s,o._configuration.options.splitting?"module":void 0,null==t?void 0:t.nonce,l);let u=1e4;a=setTimeout(()=>{l()},1e4)},plugin(e){let t=o.init;return{name:"@amplitude/engagement-browser",type:"enrichment",async setup(n,r){var i;let o=null!=(i=n.instanceName)?i:"$default_instance",s=lH.getInstance(o).identityStore;t(n.apiKey,{serverZone:n.serverZone,...e,options:{logLevel:n.logLevel,logger:n.loggerProvider,...null==e?void 0:e.options}});let a=[{track:e=>{r.track(e)}}];await window.engagement.boot({user:()=>{let e=s.getIdentity();return{user_id:r.getUserId(),device_id:r.getDeviceId(),user_properties:e.userProperties,getSessionId:r.getSessionId}},integrations:a}),s.addIdentityListener(e=>{var t,n,i,o;null!=(t=window.engagement)&&t._.user&&null!=(n=window.engagement)&&n._analytics.hasBooted?(null==(o=null==(i=window.engagement)?void 0:i._.user)?void 0:o.user_id)!==e.userId?(window.engagement.shutdown(),window.engagement.boot({user:()=>{let e=s.getIdentity();return{user_id:r.getUserId(),device_id:r.getDeviceId(),user_properties:e.userProperties,getSessionId:r.getSessionId}},integrations:a})):window.engagement._setUserProperties(e.userProperties):console.warn("Engagement SDK not booted. Ignoring identity change.")})},execute:async e=>(window.engagement.forwardEvent(e),e)}}},{get:function(e,t){return t in o?o[t]:"then"!==t?"gs"===t||"rc"===t?new Proxy({},{get:function(e,n){return function(){let e=Array.from(arguments),r=`${t}.${n}`;e.unshift(r),o._q.push(e)}}}):lQ.includes(t)?function(){let e=Array.prototype.slice.call(arguments);return new Promise((n,r)=>{e.unshift(t,n,r),o._q.push(e)})}:function(){let e=Array.prototype.slice.call(arguments);e.unshift(t),o._q.push(e)}:void 0}})),lX=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,ev.__extends)(t,e),t.prototype.sessionReplay=function(){return this._sessionReplay},t.prototype.experiment=function(){if(void 0!==this.config){var e=this.plugins(lL);return 0===e.length?void this.config.loggerProvider.debug("".concat(lL.pluginName," plugin is not found.")):1===e.length?e[0].experiment:void this.config.loggerProvider.debug("Multiple instances of ".concat(lL.pluginName," are found."))}},t.prototype.initAll=function(t,n){return(0,ev.__awaiter)(this,void 0,void 0,function(){var r,i;return(0,ev.__generator)(this,function(o){switch(o.label){case 0:return r={serverZone:null==n?void 0:n.serverZone,instanceName:null==n?void 0:n.instanceName},e.prototype.add.call(this,{type:"enrichment",name:"@amplitude/unified-library-plugin",execute:function(e){var t;return(0,ev.__awaiter)(this,void 0,void 0,function(){return(0,ev.__generator)(this,function(n){return e.library="".concat("amplitude-ts-unified","/").concat("1.0.0-beta.9","-").concat(null!=(t=e.library)?t:""),[2,e]})})}}),[4,e.prototype.init.call(this,t,(0,ev.__assign)((0,ev.__assign)({},null==n?void 0:n.analytics),r)).promise];case 1:return o.sent(),[4,e.prototype.add.call(this,new sz((0,ev.__assign)((0,ev.__assign)({},null==n?void 0:n.sessionReplay),r))).promise];case 2:return o.sent(),[4,e.prototype.add.call(this,new lL((0,ev.__assign)((0,ev.__assign)({},null==n?void 0:n.experiment),r))).promise];case 3:let s;return o.sent(),void 0===(i=this.plugin(sz.pluginName))?this.config.loggerProvider.debug("".concat(sz.pluginName," plugin is not found.")):this._sessionReplay=i.sessionReplay,[4,e.prototype.add.call(this,(s=(0,ev.__assign)((0,ev.__assign)({},null==n?void 0:n.engagement),r),"u">typeof window&&!window.engagement&&(window.engagement=lK),lK.plugin(s))).promise];case 4:return o.sent(),[2]}})})},t.prototype.init=function(t,n,r){return void 0===t&&(t=""),e.prototype.init.call(this,t,n,r)},t}(i0);(V=em||(em={}))[V.None=0]="None",V[V.Error=1]="Error",V[V.Warn=2]="Warn",V[V.Verbose=3]="Verbose",V[V.Debug=4]="Debug";var lG=function(e){return function(){var t=(0,ev.__assign)({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},lZ=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=(0,ev.__values)(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},lY=function(e,t){return function(){var n,r,i={};try{for(var o=(0,ev.__values)(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=lZ(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},lJ=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),l=a.logger,u=a.logLevel;if(u&&u<em.Debug||!u||!l)return e.apply(i,o);var c={type:"invoke public method",name:t,args:o,stacktrace:(Error().stack||"").split("\n").slice(3).map(function(e){return e.trim()}),time:{start:new Date().toISOString()},states:{}};r&&c.states&&(c.states.before=r());var h=e.apply(i,o);return h&&h.promise?h.promise.then(function(){r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))}):(r&&c.states&&(c.states.after=r()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))),h}};let l0={_setDiagnosticsSampleRate:lJ((H=new lX)._setDiagnosticsSampleRate.bind(H),"_setDiagnosticsSampleRate",lG(H),lY(H,["config"])),experiment:lJ(H.experiment.bind(H),"experiment",lG(H),lY(H,["config"])),sessionReplay:lJ(H.sessionReplay.bind(H),"sessionReplay",lG(H),lY(H,["config"])),initAll:lJ(H.initAll.bind(H),"initAll",lG(H),lY(H,["config"])),init:lJ(H.init.bind(H),"init",lG(H),lY(H,["config"])),add:lJ(H.add.bind(H),"add",lG(H),lY(H,["config.apiKey","timeline.plugins"])),remove:lJ(H.remove.bind(H),"remove",lG(H),lY(H,["config.apiKey","timeline.plugins"])),track:lJ(H.track.bind(H),"track",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),logEvent:lJ(H.logEvent.bind(H),"logEvent",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),identify:lJ(H.identify.bind(H),"identify",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),groupIdentify:lJ(H.groupIdentify.bind(H),"groupIdentify",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),setGroup:lJ(H.setGroup.bind(H),"setGroup",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),revenue:lJ(H.revenue.bind(H),"revenue",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),flush:lJ(H.flush.bind(H),"flush",lG(H),lY(H,["config.apiKey","timeline.queue.length"])),getUserId:lJ(H.getUserId.bind(H),"getUserId",lG(H),lY(H,["config","config.userId"])),setUserId:lJ(H.setUserId.bind(H),"setUserId",lG(H),lY(H,["config","config.userId"])),getDeviceId:lJ(H.getDeviceId.bind(H),"getDeviceId",lG(H),lY(H,["config","config.deviceId"])),setDeviceId:lJ(H.setDeviceId.bind(H),"setDeviceId",lG(H),lY(H,["config","config.deviceId"])),reset:lJ(H.reset.bind(H),"reset",lG(H),lY(H,["config","config.userId","config.deviceId"])),getSessionId:lJ(H.getSessionId.bind(H),"getSessionId",lG(H),lY(H,["config"])),setSessionId:lJ(H.setSessionId.bind(H),"setSessionId",lG(H),lY(H,["config"])),extendSession:lJ(H.extendSession.bind(H),"extendSession",lG(H),lY(H,["config"])),setOptOut:lJ(H.setOptOut.bind(H),"setOptOut",lG(H),lY(H,["config"])),getOptOut:lJ(H.getOptOut.bind(H),"getOptOut",lG(H),lY(H,["config"])),setTransport:lJ(H.setTransport.bind(H),"setTransport",lG(H),lY(H,["config"])),getIdentity:lJ(H.getIdentity.bind(H),"getIdentity",lG(H),lY(H,["config"]))};l0._setDiagnosticsSampleRate;var l1=l0.initAll,l2=(l0.experiment,l0.sessionReplay,l0.add,l0.extendSession,l0.flush,l0.getDeviceId,l0.getSessionId,l0.getUserId,l0.groupIdentify,l0.identify,l0.logEvent,l0.remove,l0.reset,l0.revenue,l0.setDeviceId,l0.setGroup,l0.setOptOut,l0.setSessionId,l0.setTransport,l0.setUserId,l0.track);function l3(e,t,n){return l4||console.log("[Tracking]",e,t,n),l2(e,t,n)}let l4=!1;function l8(){let e,t=(e=document.cookie.match("(^|;)\\s*recce_user_id\\s*=\\s*([^;]+)"))?e.pop():"",n="5abd9acde37fb6b73e8d8df519dc7454";if(t&&n)try{l1(n,{analytics:{userId:t,autocapture:!0},sessionReplay:{sampleRate:1}}),l4=!0}catch(e){console.error(e)}l4||console.log("[Tracking] Amplitude not initialized (missing API key or user ID). Events will be logged to console instead.")}function l6(e){l3("[Web] multi_nodes_action",e)}function l5(e){l3("[Web] history_action",e)}function l9(e){l3("[Experiment] preview_change",e)}function l7(e){l3("[Experiment] preview_change",e)}function ue(e){l3("[Experiment] single_environment",e)}function ut(e){l3("[Web] column_level_lineage",e)}function un(e){l3("[Web] share_state",e)}function ur(e){l3("[Web] state_action",e)}function ui(e){l3("[Click] copy_to_clipboard",e)}function uo(e){l3("[Web] navigation_change",e)}function us(e){l3("[Web] lineage_view_render",e)}function ua(e){l3("[Web] environment_config",e)}let ul={ROW_COUNT:"row_count",ROW_COUNT_DIFF:"row_count_diff",PROFILE:"profile",PROFILE_DIFF:"profile_diff",VALUE_DIFF:"value_diff",SCHEMA_DIFF:"schema_diff",LINEAGE_DIFF:"lineage_diff",QUERY:"query",HISTOGRAM_DIFF:"histogram_diff",TOP_K_DIFF:"top_k_diff"};function uu(e){l3("[Web] explore_action",e)}function uc(e){l3("[Web] explore_action_form",e)}function uh(e){return Object.values(ul).includes(e)}function ud(e){l3("[Web] lineage_selection",e)}e.s(["EXPLORE_ACTION",0,ul,"EXPLORE_FORM_EVENT",0,{EXECUTE:"execute",CANCEL:"cancel"},"EXPLORE_SOURCE",0,{LINEAGE_VIEW_TOP_BAR:"lineage_view_top_bar",LINEAGE_VIEW_CONTEXT_MENU:"lineage_view_context_menu",NODE_KEBAB_MENU:"node_kebab_menu",NODE_SIDEBAR_SINGLE_ENV:"node_sidebar_single_env",NODE_SIDEBAR_MULTI_ENV:"node_sidebar_multi_env",SCHEMA_ROW_COUNT_BUTTON:"schema_row_count_button",SCHEMA_COLUMN_MENU:"schema_column_menu"},"isExploreAction",()=>uh,"trackColumnLevelLineage",()=>ut,"trackCopyToClipboard",()=>ui,"trackEnvironmentConfig",()=>ua,"trackExploreAction",()=>uu,"trackExploreActionForm",()=>uc,"trackHistoryAction",()=>l5,"trackInit",()=>l8,"trackLineageSelection",()=>ud,"trackLineageViewRender",()=>us,"trackMultiNodesAction",()=>l6,"trackNavigation",()=>uo,"trackPreviewChange",()=>l9,"trackPreviewChangeFeedback",()=>l7,"trackShareState",()=>un,"trackSingleEnvironment",()=>ue,"trackStateAction",()=>ur],211363)},307215,e=>{"use strict";var t=e.i(139507);let n=t.default.env.NEXT_PUBLIC_API_URL,r=n??=window.location.origin,i=t.default.env.NEXT_PUBLIC_CLOUD_WEB_URL;i??="https://cloud.datarecce.io";let o=t.default.env.NEXT_PUBLIC_RECCE_SUPPORT_CALENDAR_URL,s=o??="https://cal.com/team/recce/chat";e.s(["PUBLIC_API_URL",0,r,"RECCE_SUPPORT_CALENDAR_URL",0,s])},861291,e=>{"use strict";var t=e.i(752036),n=e.i(307215),r=e.i(987562);let i={apiPrefix:"",authToken:void 0,baseUrl:void 0,apiClient:t.default.create({baseURL:n.PUBLIC_API_URL})};function o(){return(0,r.useApiConfigOptional)()??i}e.s(["useApiConfig",()=>o])},854535,e=>{"use strict";var t=e.i(991047),n=e.i(600943);let r=(0,n.createContext)({sql:"",isExecuting:!1});function i({children:e,sql:i="",isExecuting:o=!1,error:s,baseResult:a,currentResult:l,onSqlChange:u,onExecute:c,onCancel:h,sqlQuery:d,setSqlQuery:f,primaryKeys:p,setPrimaryKeys:g,isCustomQueries:m,setCustomQueries:v,baseSqlQuery:y,setBaseSqlQuery:b}){let w=(0,n.useMemo)(()=>({sql:i,isExecuting:o,error:s,baseResult:a,currentResult:l,onSqlChange:u,onExecute:c,onCancel:h,sqlQuery:d,setSqlQuery:f,primaryKeys:p,setPrimaryKeys:g,isCustomQueries:m,setCustomQueries:v,baseSqlQuery:y,setBaseSqlQuery:b}),[i,o,s,a,l,u,c,h,d,f,p,g,m,v,y,b]);return(0,t.jsx)(r.Provider,{value:w,children:e})}r.displayName="RecceQueryContext";let o='select * from {{ ref("mymodel") }}';function s({children:e}){let[r,s]=(0,n.useState)(o),[a,l]=(0,n.useState)(o),[u,c]=(0,n.useState)(!1),[h,d]=(0,n.useState)();return(0,t.jsx)(i,{sql:r,sqlQuery:r,setSqlQuery:s,primaryKeys:h,setPrimaryKeys:d,isCustomQueries:u,setCustomQueries:c,baseSqlQuery:a,setBaseSqlQuery:l,children:e})}let a=e=>{},l=e=>{},u=e=>{},c=e=>{};function h(){let e=(0,n.useContext)(r);return{sqlQuery:e.sqlQuery??o,setSqlQuery:e.setSqlQuery??a,primaryKeys:e.primaryKeys,setPrimaryKeys:e.setPrimaryKeys??l,isCustomQueries:e.isCustomQueries??!1,setCustomQueries:e.setCustomQueries??u,baseSqlQuery:e.baseSqlQuery??o,setBaseSqlQuery:e.setBaseSqlQuery??c}}e.s(["QueryContextAdapter",()=>s,"defaultSqlQuery",0,o,"useRecceQueryContext",()=>h],854535)},901968,e=>{"use strict";function t(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function n(e,r=!1){return e&&(t(e.value)&&""!==e.value||r&&t(e.defaultValue)&&""!==e.defaultValue)}function r(e){return e.startAdornment}e.s(["isAdornedStart",()=>r,"isFilled",()=>n])},34430,e=>{"use strict";var t=e.i(600943);function n(e,n){return t.isValidElement(e)&&-1!==n.indexOf(e.type.muiName??e.type?._payload?.value?.muiName)}e.s(["default",()=>n])},564665,e=>{"use strict";let t=e.i(34430).default;e.s(["default",0,t])},329777,e=>{"use strict";let t=e.i(600943).createContext(void 0);e.s(["default",0,t])},393149,e=>{"use strict";function t({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&void 0===e[r]&&(t[r]=n[r]),t),{})}e.s(["default",()=>t])},431001,e=>{"use strict";var t=e.i(600943),n=e.i(329777);function r(){return t.useContext(n.default)}e.s(["default",()=>r])},452078,e=>{"use strict";function t(e,n=166){let r;function i(...t){let o=()=>{e.apply(this,t)};clearTimeout(r),r=setTimeout(o,n)}return i.clear=()=>{clearTimeout(r)},i}e.s(["default",()=>t])},451134,e=>{"use strict";var t=e.i(600943),n=e.i(452078),r=e.i(593152),i=e.i(514934),o=e.i(907480),s=e.i(857482),a=e.i(991047);function l(e){return parseInt(e,10)||0}let u={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function c(e){return function(e){for(let t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}let h=t.forwardRef(function(e,h){let{onChange:d,maxRows:f,minRows:p=1,style:g,value:m,...v}=e,{current:y}=t.useRef(null!=m),b=t.useRef(null),w=(0,r.default)(h,b),x=t.useRef(null),S=t.useRef(null),k=t.useCallback(()=>{let t=b.current,n=S.current;if(!t||!n)return;let r=(0,s.default)(t).getComputedStyle(t);if("0px"===r.width)return{outerHeightStyle:0,overflowing:!1};n.style.width=r.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");let i=r.boxSizing,o=l(r.paddingBottom)+l(r.paddingTop),a=l(r.borderBottomWidth)+l(r.borderTopWidth),u=n.scrollHeight;n.value="x";let c=n.scrollHeight,h=u;return p&&(h=Math.max(Number(p)*c,h)),f&&(h=Math.min(Number(f)*c,h)),{outerHeightStyle:(h=Math.max(h,c))+("border-box"===i?o+a:0),overflowing:1>=Math.abs(h-u)}},[f,p,e.placeholder]),_=(0,o.default)(()=>{let e=b.current,t=k();if(!e||!t||c(t))return!1;let n=t.outerHeightStyle;return null!=x.current&&x.current!==n}),O=t.useCallback(()=>{let e=b.current,t=k();if(!e||!t||c(t))return;let n=t.outerHeightStyle;x.current!==n&&(x.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?"hidden":""},[k]),C=t.useRef(-1);return(0,i.default)(()=>{let e,t=(0,n.default)(O),r=b?.current;if(!r)return;let i=(0,s.default)(r);return i.addEventListener("resize",t),"u">typeof ResizeObserver&&(e=new ResizeObserver(()=>{_()&&(e.unobserve(r),cancelAnimationFrame(C.current),O(),C.current=requestAnimationFrame(()=>{e.observe(r)}))})).observe(r),()=>{t.clear(),cancelAnimationFrame(C.current),i.removeEventListener("resize",t),e&&e.disconnect()}},[k,O,_]),(0,i.default)(()=>{O()}),(0,a.jsxs)(t.Fragment,{children:[(0,a.jsx)("textarea",{value:m,onChange:e=>{y||O();let t=e.target,n=t.value.length,r=t.value.endsWith("\n"),i=t.selectionStart===n;r&&i&&t.setSelectionRange(n,n),d&&d(e)},ref:w,rows:p,style:g,...v}),(0,a.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:S,tabIndex:-1,style:{...u,...g,paddingTop:0,paddingBottom:0}})]})});e.s(["default",0,h])},957770,e=>{"use strict";let t=e.i(514934).default;e.s(["default",0,t])},564476,704593,e=>{"use strict";e.i(139507);var t,n=e.i(622482),r=e.i(600943),i=e.i(7284),o=e.i(295456),s=e.i(509912),a=e.i(451134),l=e.i(393149),u=e.i(329777),c=e.i(431001),h=e.i(721431),d=e.i(57803),f=e.i(842196),p=e.i(138961),g=e.i(663888),m=e.i(987074),v=e.i(957770),y=e.i(901968),b=e.i(11507),w=e.i(222942);function x(e){return(0,w.default)("MuiInputBase",e)}let S=(0,b.default)("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);e.s(["default",0,S,"getInputBaseUtilityClass",()=>x],704593);var k=e.i(991047);let _=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,"small"===n.size&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${(0,g.default)(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},O=(e,t)=>{let{ownerState:n}=e;return[t.input,"small"===n.size&&t.inputSizeSmall,n.multiline&&t.inputMultiline,"search"===n.type&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},C=(0,h.styled)("div",{name:"MuiInputBase",slot:"Root",overridesResolver:_})((0,f.default)(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${S.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:e,size:t})=>e.multiline&&"small"===t,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:"100%"}}]}))),E=(0,h.styled)("input",{name:"MuiInputBase",slot:"Input",overridesResolver:O})((0,f.default)(({theme:e})=>{let t="light"===e.palette.mode,n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${S.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${S.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),T=(0,d.globalCss)({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),P=r.forwardRef(function(e,h){let d=(0,p.useDefaultProps)({props:e,name:"MuiInputBase"}),{"aria-describedby":f,autoComplete:b,autoFocus:w,className:S,color:_,components:O={},componentsProps:P={},defaultValue:A,disabled:R,disableInjectingGlobalStyles:M,endAdornment:I,error:D,fullWidth:L=!1,id:N,inputComponent:B="input",inputProps:F={},inputRef:j,margin:U,maxRows:q,minRows:W,multiline:z=!1,name:V,onBlur:H,onChange:Q,onClick:$,onFocus:K,onKeyDown:X,onKeyUp:G,placeholder:Z,readOnly:Y,renderSuffix:J,rows:ee,size:et,slotProps:en={},slots:er={},startAdornment:ei,type:eo="text",value:es,...ea}=d,el=null!=F.value?F.value:es,{current:eu}=r.useRef(null!=el),ec=r.useRef(),eh=r.useCallback(e=>{},[]),ed=(0,m.default)(ec,j,F.ref,eh),[ef,ep]=r.useState(!1),eg=(0,c.default)(),em=(0,l.default)({props:d,muiFormControl:eg,states:["color","disabled","error","hiddenLabel","size","required","filled"]});em.focused=eg?eg.focused:ef,r.useEffect(()=>{!eg&&R&&ef&&(ep(!1),H&&H())},[eg,R,ef,H]);let ev=eg&&eg.onFilled,ey=eg&&eg.onEmpty,eb=r.useCallback(e=>{(0,y.isFilled)(e)?ev&&ev():ey&&ey()},[ev,ey]);(0,v.default)(()=>{eu&&eb({value:el})},[el,eb,eu]),r.useEffect(()=>{eb(ec.current)},[]);let ew=B,ex=F;z&&"input"===ew&&(ex=ee?{type:void 0,minRows:ee,maxRows:ee,...ex}:{type:void 0,maxRows:q,minRows:W,...ex},ew=a.default),r.useEffect(()=>{eg&&eg.setAdornedStart(!!ei)},[eg,ei]);let eS={...d,color:em.color||"primary",disabled:em.disabled,endAdornment:I,error:em.error,focused:em.focused,formControl:eg,fullWidth:L,hiddenLabel:em.hiddenLabel,multiline:z,size:em.size,startAdornment:ei,type:eo},ek=(e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:s,focused:a,formControl:l,fullWidth:u,hiddenLabel:c,multiline:h,readOnly:d,size:f,startAdornment:p,type:m}=e,v={root:["root",`color${(0,g.default)(n)}`,r&&"disabled",i&&"error",u&&"fullWidth",a&&"focused",l&&"formControl",f&&"medium"!==f&&`size${(0,g.default)(f)}`,h&&"multiline",p&&"adornedStart",s&&"adornedEnd",c&&"hiddenLabel",d&&"readOnly"],input:["input",r&&"disabled","search"===m&&"inputTypeSearch",h&&"inputMultiline","small"===f&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",s&&"inputAdornedEnd",d&&"readOnly"]};return(0,o.default)(v,x,t)})(eS),e_=er.root||O.Root||C,eO=en.root||P.root||{},eC=er.input||O.Input||E;return ex={...ex,...en.input??P.input},(0,k.jsxs)(r.Fragment,{children:[!M&&"function"==typeof T&&(t||(t=(0,k.jsx)(T,{}))),(0,k.jsxs)(e_,{...eO,ref:h,onClick:e=>{ec.current&&e.currentTarget===e.target&&ec.current.focus(),$&&$(e)},...ea,...!(0,s.default)(e_)&&{ownerState:{...eS,...eO.ownerState}},className:(0,i.default)(ek.root,eO.className,S,Y&&"MuiInputBase-readOnly"),children:[ei,(0,k.jsx)(u.default.Provider,{value:null,children:(0,k.jsx)(eC,{"aria-invalid":em.error,"aria-describedby":f,autoComplete:b,autoFocus:w,defaultValue:A,disabled:em.disabled,id:N,onAnimationStart:e=>{eb("mui-auto-fill-cancel"===e.animationName?ec.current:{value:"x"})},name:V,placeholder:Z,readOnly:Y,required:em.required,rows:ee,value:el,onKeyDown:X,onKeyUp:G,type:eo,...ex,...!(0,s.default)(eC)&&{as:ew,ownerState:{...eS,...ex.ownerState}},ref:ed,className:(0,i.default)(ek.input,ex.className,Y&&"MuiInputBase-readOnly"),onBlur:e=>{H&&H(e),F.onBlur&&F.onBlur(e),eg&&eg.onBlur?eg.onBlur(e):ep(!1)},onChange:(e,...t)=>{if(!eu){let t=e.target||ec.current;if(null==t)throw Error((0,n.default)(1));eb({value:t.value})}F.onChange&&F.onChange(e,...t),Q&&Q(e,...t)},onFocus:e=>{K&&K(e),F.onFocus&&F.onFocus(e),eg&&eg.onFocus?eg.onFocus(e):ep(!0)}})}),I,J?J({...em,startAdornment:ei}):null]})]})});e.s(["InputBaseInput",0,E,"InputBaseRoot",0,C,"default",0,P,"inputOverridesResolver",0,O,"rootOverridesResolver",0,_],564476)},488193,(e,t,n)=>{(function(){var r,i="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",a=1/0,l=0/0,u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",h="[object Array]",d="[object Boolean]",f="[object Date]",p="[object Error]",g="[object Function]",m="[object GeneratorFunction]",v="[object Map]",y="[object Number]",b="[object Object]",w="[object Promise]",x="[object RegExp]",S="[object Set]",k="[object String]",_="[object Symbol]",O="[object WeakMap]",C="[object ArrayBuffer]",E="[object DataView]",T="[object Float32Array]",P="[object Float64Array]",A="[object Int8Array]",R="[object Int16Array]",M="[object Int32Array]",I="[object Uint8Array]",D="[object Uint8ClampedArray]",L="[object Uint16Array]",N="[object Uint32Array]",B=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,W=RegExp(U.source),z=RegExp(q.source),V=/<%-([\s\S]+?)%>/g,H=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(G.source),Y=/^\s+/,J=/\s/,ee=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,et=/\{\n\/\* \[wrapped with (.+)\] \*/,en=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ei=/[()=,{}\[\]\/\s]/,eo=/\\(\\)?/g,es=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ea=/\w*$/,el=/^[-+]0x[0-9a-f]+$/i,eu=/^0b[01]+$/i,ec=/^\[object .+?Constructor\]$/,eh=/^0o[0-7]+$/i,ed=/^(?:0|[1-9]\d*)$/,ef=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ep=/($^)/,eg=/['\n\r\u2028\u2029\\]/g,em="\\ud800-\\udfff",ev="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ey="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",ew="A-Z\\xc0-\\xd6\\xd8-\\xde",ex="\\ufe0e\\ufe0f",eS="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ek="['’]",e_="["+eS+"]",eO="["+ev+"]",eC="["+eb+"]",eE="[^"+em+eS+"\\d+"+ey+eb+ew+"]",eT="\\ud83c[\\udffb-\\udfff]",eP="[^"+em+"]",eA="(?:\\ud83c[\\udde6-\\uddff]){2}",eR="[\\ud800-\\udbff][\\udc00-\\udfff]",eM="["+ew+"]",eI="\\u200d",eD="(?:"+eC+"|"+eE+")",eL="(?:"+eM+"|"+eE+")",eN="(?:"+ek+"(?:d|ll|m|re|s|t|ve))?",eB="(?:"+ek+"(?:D|LL|M|RE|S|T|VE))?",eF="(?:"+eO+"|"+eT+")?",ej="["+ex+"]?",eU="(?:"+eI+"(?:"+[eP,eA,eR].join("|")+")"+ej+eF+")*",eq=ej+eF+eU,eW="(?:"+["["+ey+"]",eA,eR].join("|")+")"+eq,ez="(?:"+[eP+eO+"?",eO,eA,eR,"["+em+"]"].join("|")+")",eV=RegExp(ek,"g"),eH=RegExp(eO,"g"),eQ=RegExp(eT+"(?="+eT+")|"+ez+eq,"g"),e$=RegExp([eM+"?"+eC+"+"+eN+"(?="+[e_,eM,"$"].join("|")+")",eL+"+"+eB+"(?="+[e_,eM+eD,"$"].join("|")+")",eM+"?"+eD+"+"+eN,eM+"+"+eB,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",eW].join("|"),"g"),eK=RegExp("["+eI+em+ev+ex+"]"),eX=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eG=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eZ=-1,eY={};eY[T]=eY[P]=eY[A]=eY[R]=eY[M]=eY[I]=eY[D]=eY[L]=eY[N]=!0,eY[c]=eY[h]=eY[C]=eY[d]=eY[E]=eY[f]=eY[p]=eY[g]=eY[v]=eY[y]=eY[b]=eY[x]=eY[S]=eY[k]=eY[O]=!1;var eJ={};eJ[c]=eJ[h]=eJ[C]=eJ[E]=eJ[d]=eJ[f]=eJ[T]=eJ[P]=eJ[A]=eJ[R]=eJ[M]=eJ[v]=eJ[y]=eJ[b]=eJ[x]=eJ[S]=eJ[k]=eJ[_]=eJ[I]=eJ[D]=eJ[L]=eJ[N]=!0,eJ[p]=eJ[g]=eJ[O]=!1;var e0={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e1=parseFloat,e2=parseInt,e3=e.g&&e.g.Object===Object&&e.g,e4="object"==typeof self&&self&&self.Object===Object&&self,e8=e3||e4||Function("return this")(),e6=n&&!n.nodeType&&n,e5=e6&&t&&!t.nodeType&&t,e9=e5&&e5.exports===e6,e7=e9&&e3.process,te=function(){try{var e=e5&&e5.require&&e5.require("util").types;if(e)return e;return e7&&e7.binding&&e7.binding("util")}catch(e){}}(),tt=te&&te.isArrayBuffer,tn=te&&te.isDate,tr=te&&te.isMap,ti=te&&te.isRegExp,to=te&&te.isSet,ts=te&&te.isTypedArray;function ta(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function tl(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function tu(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function tc(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function th(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function td(e,t){return!!(null==e?0:e.length)&&tS(e,t,0)>-1}function tf(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function tp(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function tg(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function tm(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function tv(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function ty(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var tb=tC("length");function tw(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function tx(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return -1}function tS(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return -1}(e,t,n):tx(e,t_,n)}function tk(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return -1}function t_(e){return e!=e}function tO(e,t){var n=null==e?0:e.length;return n?tP(e,t)/n:l}function tC(e){return function(t){return null==t?r:t[e]}}function tE(e){return function(t){return null==e?r:e[t]}}function tT(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function tP(e,t){for(var n,i=-1,o=e.length;++i<o;){var s=t(e[i]);r!==s&&(n=r===n?s:n+s)}return n}function tA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function tR(e){return e?e.slice(0,t$(e)+1).replace(Y,""):e}function tM(e){return function(t){return e(t)}}function tI(e,t){return tp(t,function(t){return e[t]})}function tD(e,t){return e.has(t)}function tL(e,t){for(var n=-1,r=e.length;++n<r&&tS(t,e[n],0)>-1;);return n}function tN(e,t){for(var n=e.length;n--&&tS(t,e[n],0)>-1;);return n}var tB=tE({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tF=tE({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tj(e){return"\\"+e0[e]}function tU(e){return eK.test(e)}function tq(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function tW(e,t){return function(n){return e(t(n))}}function tz(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];(a===t||a===s)&&(e[n]=s,o[i++]=n)}return o}function tV(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function tH(e){return tU(e)?function(e){for(var t=eQ.lastIndex=0;eQ.test(e);)++t;return t}(e):tb(e)}function tQ(e){return tU(e)?e.match(eQ)||[]:e.split("")}function t$(e){for(var t=e.length;t--&&J.test(e.charAt(t)););return t}var tK=tE({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tX=function e(t){var n,J,em,ev,ey=(t=null==t?e8:tX.defaults(e8.Object(),t,tX.pick(e8,eG))).Array,eb=t.Date,ew=t.Error,ex=t.Function,eS=t.Math,ek=t.Object,e_=t.RegExp,eO=t.String,eC=t.TypeError,eE=ey.prototype,eT=ex.prototype,eP=ek.prototype,eA=t["__core-js_shared__"],eR=eT.toString,eM=eP.hasOwnProperty,eI=0,eD=(n=/[^.]+$/.exec(eA&&eA.keys&&eA.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",eL=eP.toString,eN=eR.call(ek),eB=e8._,eF=e_("^"+eR.call(eM).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ej=e9?t.Buffer:r,eU=t.Symbol,eq=t.Uint8Array,eW=ej?ej.allocUnsafe:r,ez=tW(ek.getPrototypeOf,ek),eQ=ek.create,eK=eP.propertyIsEnumerable,e0=eE.splice,e3=eU?eU.isConcatSpreadable:r,e4=eU?eU.iterator:r,e6=eU?eU.toStringTag:r,e5=function(){try{var e=ip(ek,"defineProperty");return e({},"",{}),e}catch(e){}}(),e7=t.clearTimeout!==e8.clearTimeout&&t.clearTimeout,te=eb&&eb.now!==e8.Date.now&&eb.now,tb=t.setTimeout!==e8.setTimeout&&t.setTimeout,tE=eS.ceil,tG=eS.floor,tZ=ek.getOwnPropertySymbols,tY=ej?ej.isBuffer:r,tJ=t.isFinite,t0=eE.join,t1=tW(ek.keys,ek),t2=eS.max,t3=eS.min,t4=eb.now,t8=t.parseInt,t6=eS.random,t5=eE.reverse,t9=ip(t,"DataView"),t7=ip(t,"Map"),ne=ip(t,"Promise"),nt=ip(t,"Set"),nn=ip(t,"WeakMap"),nr=ip(ek,"create"),ni=nn&&new nn,no={},ns=ij(t9),na=ij(t7),nl=ij(ne),nu=ij(nt),nc=ij(nn),nh=eU?eU.prototype:r,nd=nh?nh.valueOf:r,nf=nh?nh.toString:r;function np(e){if(oK(e)&&!oB(e)&&!(e instanceof ny)){if(e instanceof nv)return e;if(eM.call(e,"__wrapped__"))return iU(e)}return new nv(e)}var ng=function(){function e(){}return function(t){if(!o$(t))return{};if(eQ)return eQ(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function nm(){}function nv(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function ny(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function nb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nw(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nx(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nS(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new nx;++t<n;)this.add(e[t])}function nk(e){var t=this.__data__=new nw(e);this.size=t.size}function n_(e,t){var n=oB(e),r=!n&&oN(e),i=!n&&!r&&oq(e),o=!n&&!r&&!i&&o2(e),s=n||r||i||o,a=s?tA(e.length,eO):[],l=a.length;for(var u in e)(t||eM.call(e,u))&&!(s&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ix(u,l)))&&a.push(u);return a}function nO(e){var t=e.length;return t?e[ru(0,t-1)]:r}np.templateSettings={escape:V,evaluate:H,interpolate:Q,variable:"",imports:{_:np}},np.prototype=nm.prototype,np.prototype.constructor=np,nv.prototype=ng(nm.prototype),nv.prototype.constructor=nv,ny.prototype=ng(nm.prototype),ny.prototype.constructor=ny,nb.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},nb.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},nb.prototype.get=function(e){var t=this.__data__;if(nr){var n=t[e];return n===o?r:n}return eM.call(t,e)?t[e]:r},nb.prototype.has=function(e){var t=this.__data__;return nr?t[e]!==r:eM.call(t,e)},nb.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=nr&&r===t?o:t,this},nw.prototype.clear=function(){this.__data__=[],this.size=0},nw.prototype.delete=function(e){var t=this.__data__,n=nT(t,e);return!(n<0)&&(n==t.length-1?t.pop():e0.call(t,n,1),--this.size,!0)},nw.prototype.get=function(e){var t=this.__data__,n=nT(t,e);return n<0?r:t[n][1]},nw.prototype.has=function(e){return nT(this.__data__,e)>-1},nw.prototype.set=function(e,t){var n=this.__data__,r=nT(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},nx.prototype.clear=function(){this.size=0,this.__data__={hash:new nb,map:new(t7||nw),string:new nb}},nx.prototype.delete=function(e){var t=ih(this,e).delete(e);return this.size-=!!t,t},nx.prototype.get=function(e){return ih(this,e).get(e)},nx.prototype.has=function(e){return ih(this,e).has(e)},nx.prototype.set=function(e,t){var n=ih(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},nS.prototype.add=nS.prototype.push=function(e){return this.__data__.set(e,o),this},nS.prototype.has=function(e){return this.__data__.has(e)};function nC(e,t,n){(r===n||oI(e[t],n))&&(r!==n||t in e)||nR(e,t,n)}function nE(e,t,n){var i=e[t];eM.call(e,t)&&oI(i,n)&&(r!==n||t in e)||nR(e,t,n)}function nT(e,t){for(var n=e.length;n--;)if(oI(e[n][0],t))return n;return -1}function nP(e,t,n,r){return nF(e,function(e,i,o){t(r,e,n(e),o)}),r}function nA(e,t){return e&&rq(t,sp(t),e)}function nR(e,t,n){"__proto__"==t&&e5?e5(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function nM(e,t){for(var n=-1,i=t.length,o=ey(i),s=null==e;++n<i;)o[n]=s?r:su(e,t[n]);return o}function nI(e,t,n){return e==e&&(r!==n&&(e=e<=n?e:n),r!==t&&(e=e>=t?e:t)),e}function nD(e,t,n,i,o,s){var a,l=1&t,u=2&t,h=4&t;if(n&&(a=o?n(e,i,o,s):n(e)),r!==a)return a;if(!o$(e))return e;var p=oB(e);if(p){if(O=(w=e).length,B=new w.constructor(O),O&&"string"==typeof w[0]&&eM.call(w,"index")&&(B.index=w.index,B.input=w.input),a=B,!l)return rU(e,a)}else{var w,O,B,F,j,U,q,W,z=iv(e),V=z==g||z==m;if(oq(e))return rD(e,l);if(z==b||z==c||V&&!o){if(a=u||V?{}:ib(e),!l){return u?(F=e,j=(W=a)&&rq(e,sg(e),W),rq(F,im(F),j)):(U=e,q=nA(a,e),rq(U,ig(U),q))}}else{if(!eJ[z])return o?e:{};a=function(e,t,n){var r,i,o=e.constructor;switch(t){case C:return rL(e);case d:case f:return new o(+e);case E:return r=n?rL(e.buffer):e.buffer,new e.constructor(r,e.byteOffset,e.byteLength);case T:case P:case A:case R:case M:case I:case D:case L:case N:return rN(e,n);case v:return new o;case y:case k:return new o(e);case x:return(i=new e.constructor(e.source,ea.exec(e))).lastIndex=e.lastIndex,i;case S:return new o;case _:return nd?ek(nd.call(e)):{}}}(e,z,l)}}s||(s=new nk);var H=s.get(e);if(H)return H;s.set(e,a),oJ(e)?e.forEach(function(r){a.add(nD(r,t,n,r,e,s))}):oX(e)&&e.forEach(function(r,i){a.set(i,nD(r,t,n,i,e,s))});var Q=h?u?is:io:u?sg:sp,$=p?r:Q(e);return tu($||e,function(r,i){$&&(r=e[i=r]),nE(a,i,nD(r,t,n,i,e,s))}),a}function nL(e,t,n){var i=n.length;if(null==e)return!i;for(e=ek(e);i--;){var o=n[i],s=t[o],a=e[o];if(r===a&&!(o in e)||!s(a))return!1}return!0}function nN(e,t,n){if("function"!=typeof e)throw new eC(i);return iM(function(){e.apply(r,n)},t)}function nB(e,t,n,r){var i=-1,o=td,s=!0,a=e.length,l=[],u=t.length;if(!a)return l;n&&(t=tp(t,tM(n))),r?(o=tf,s=!1):t.length>=200&&(o=tD,s=!1,t=new nS(t));e:for(;++i<a;){var c=e[i],h=null==n?c:n(c);if(c=r||0!==c?c:0,s&&h==h){for(var d=u;d--;)if(t[d]===h)continue e;l.push(c)}else o(t,h,r)||l.push(c)}return l}nk.prototype.clear=function(){this.__data__=new nw,this.size=0},nk.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nk.prototype.get=function(e){return this.__data__.get(e)},nk.prototype.has=function(e){return this.__data__.has(e)},nk.prototype.set=function(e,t){var n=this.__data__;if(n instanceof nw){var r=n.__data__;if(!t7||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nx(r)}return n.set(e,t),this.size=n.size,this};var nF=rV(nQ),nj=rV(n$,!0);function nU(e,t){var n=!0;return nF(e,function(e,r,i){return n=!!t(e,r,i)}),n}function nq(e,t,n){for(var i=-1,o=e.length;++i<o;){var s=e[i],a=t(s);if(null!=a&&(r===l?a==a&&!o1(a):n(a,l)))var l=a,u=s}return u}function nW(e,t){var n=[];return nF(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function nz(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=iw),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?nz(a,t-1,n,r,i):tg(i,a):r||(i[i.length]=a)}return i}var nV=rH(),nH=rH(!0);function nQ(e,t){return e&&nV(e,t,sp)}function n$(e,t){return e&&nH(e,t,sp)}function nK(e,t){return th(t,function(t){return oV(e[t])})}function nX(e,t){t=rR(t,e);for(var n=0,i=t.length;null!=e&&n<i;)e=e[iF(t[n++])];return n&&n==i?e:r}function nG(e,t,n){var r=t(e);return oB(e)?r:tg(r,n(e))}function nZ(e){var t;return null==e?r===e?"[object Undefined]":"[object Null]":e6&&e6 in ek(e)?function(e){var t=eM.call(e,e6),n=e[e6];try{e[e6]=r;var i=!0}catch(e){}var o=eL.call(e);return i&&(t?e[e6]=n:delete e[e6]),o}(e):(t=e,eL.call(t))}function nY(e,t){return e>t}function nJ(e,t){return null!=e&&eM.call(e,t)}function n0(e,t){return null!=e&&t in ek(e)}function n1(e,t,n){for(var i=n?tf:td,o=e[0].length,s=e.length,a=s,l=ey(s),u=1/0,c=[];a--;){var h=e[a];a&&t&&(h=tp(h,tM(t))),u=t3(h.length,u),l[a]=!n&&(t||o>=120&&h.length>=120)?new nS(a&&h):r}h=e[0];var d=-1,f=l[0];e:for(;++d<o&&c.length<u;){var p=h[d],g=t?t(p):p;if(p=n||0!==p?p:0,!(f?tD(f,g):i(c,g,n))){for(a=s;--a;){var m=l[a];if(!(m?tD(m,g):i(e[a],g,n)))continue e}f&&f.push(g),c.push(p)}}return c}function n2(e,t,n){t=rR(t,e);var i=null==(e=iP(e,t))?e:e[iF(iZ(t))];return null==i?r:ta(i,e,n)}function n3(e){return oK(e)&&nZ(e)==c}function n4(e,t,n,i,o){return e===t||(null!=e&&null!=t&&(oK(e)||oK(t))?function(e,t,n,i,o,s){var a=oB(e),l=oB(t),u=a?h:iv(e),g=l?h:iv(t);u=u==c?b:u,g=g==c?b:g;var m=u==b,w=g==b,O=u==g;if(O&&oq(e)){if(!oq(t))return!1;a=!0,m=!1}if(O&&!m)return s||(s=new nk),a||o2(e)?ir(e,t,n,i,o,s):function(e,t,n,r,i,o,s){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case C:if(e.byteLength!=t.byteLength||!o(new eq(e),new eq(t)))break;return!0;case d:case f:case y:return oI(+e,+t);case p:return e.name==t.name&&e.message==t.message;case x:case k:return e==t+"";case v:var a=tq;case S:var l=1&r;if(a||(a=tV),e.size!=t.size&&!l)break;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var c=ir(a(e),a(t),r,i,o,s);return s.delete(e),c;case _:if(nd)return nd.call(e)==nd.call(t)}return!1}(e,t,u,n,i,o,s);if(!(1&n)){var T=m&&eM.call(e,"__wrapped__"),P=w&&eM.call(t,"__wrapped__");if(T||P){var A=T?e.value():e,R=P?t.value():t;return s||(s=new nk),o(A,R,n,i,s)}}return!!O&&(s||(s=new nk),function(e,t,n,i,o,s){var a=1&n,l=io(e),u=l.length;if(u!=io(t).length&&!a)return!1;for(var c=u;c--;){var h=l[c];if(!(a?h in t:eM.call(t,h)))return!1}var d=s.get(e),f=s.get(t);if(d&&f)return d==t&&f==e;var p=!0;s.set(e,t),s.set(t,e);for(var g=a;++c<u;){var m=e[h=l[c]],v=t[h];if(i)var y=a?i(v,m,h,t,e,s):i(m,v,h,e,t,s);if(!(r===y?m===v||o(m,v,n,i,s):y)){p=!1;break}g||(g="constructor"==h)}if(p&&!g){var b=e.constructor,w=t.constructor;b!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,i,o,s))}(e,t,n,i,n4,o):e!=e&&t!=t)}function n8(e,t,n,i){var o=n.length,s=o,a=!i;if(null==e)return!s;for(e=ek(e);o--;){var l=n[o];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<s;){var u=(l=n[o])[0],c=e[u],h=l[1];if(a&&l[2]){if(r===c&&!(u in e))return!1}else{var d=new nk;if(i)var f=i(c,h,u,e,t,d);if(!(r===f?n4(h,c,3,i,d):f))return!1}}return!0}function n6(e){var t;return!(!o$(e)||(t=e,eD&&eD in t))&&(oV(e)?eF:ec).test(ij(e))}function n5(e){return"function"==typeof e?e:null==e?sU:"object"==typeof e?oB(e)?rn(e[0],e[1]):rt(e):sX(e)}function n9(e){if(!iC(e))return t1(e);var t=[];for(var n in ek(e))eM.call(e,n)&&"constructor"!=n&&t.push(n);return t}function n7(e,t){return e<t}function re(e,t){var n=-1,r=oj(e)?ey(e.length):[];return nF(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function rt(e){var t=id(e);return 1==t.length&&t[0][2]?iE(t[0][0],t[0][1]):function(n){return n===e||n8(n,e,t)}}function rn(e,t){var n;return ik(e)&&(n=t)==n&&!o$(n)?iE(iF(e),t):function(n){var i=su(n,e);return r===i&&i===t?sc(n,e):n4(t,i,3)}}function rr(e,t,n,i,o){e!==t&&nV(t,function(s,a){if(o||(o=new nk),o$(s))!function(e,t,n,i,o,s,a){var l=iA(e,n),u=iA(t,n),c=a.get(u);if(c)return nC(e,n,c);var h=s?s(l,u,n+"",e,t,a):r,d=r===h;if(d){var f=oB(u),p=!f&&oq(u),g=!f&&!p&&o2(u);h=u,f||p||g?oB(l)?h=l:oU(l)?h=rU(l):p?(d=!1,h=rD(u,!0)):g?(d=!1,h=rN(u,!0)):h=[]:oZ(u)||oN(u)?(h=l,oN(l)?h=se(l):(!o$(l)||oV(l))&&(h=ib(u))):d=!1}d&&(a.set(u,h),o(h,u,i,s,a),a.delete(u)),nC(e,n,h)}(e,t,a,n,rr,i,o);else{var l=i?i(iA(e,a),s,a+"",e,t,o):r;r===l&&(l=s),nC(e,a,l)}},sg)}function ri(e,t){var n=e.length;if(n)return ix(t+=t<0?n:0,n)?e[t]:r}function ro(e,t,n){t=t.length?tp(t,function(e){return oB(e)?function(t){return nX(t,1===e.length?e[0]:e)}:e}):[sU];var r=-1;t=tp(t,tM(ic()));var i=re(e,function(e,n,i){return{criteria:tp(t,function(t){return t(e)}),index:++r,value:e}}),o=i.length;for(i.sort(function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=rB(i[r],o[r]);if(l){if(r>=a)return l;return l*("desc"==n[r]?-1:1)}}return e.index-t.index}(e,t,n)});o--;)i[o]=i[o].value;return i}function rs(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=nX(e,s);n(a,s)&&rd(o,rR(s,e),a)}return o}function ra(e,t,n,r){var i=r?tk:tS,o=-1,s=t.length,a=e;for(e===t&&(t=rU(t)),n&&(a=tp(e,tM(n)));++o<s;)for(var l=0,u=t[o],c=n?n(u):u;(l=i(a,c,l,r))>-1;)a!==e&&e0.call(a,l,1),e0.call(e,l,1);return e}function rl(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;ix(i)?e0.call(e,i,1):rk(e,i)}}return e}function ru(e,t){return e+tG(t6()*(t-e+1))}function rc(e,t){var n="";if(!e||t<1||t>0x1fffffffffffff)return n;do t%2&&(n+=e),(t=tG(t/2))&&(e+=e);while(t)return n}function rh(e,t){return iI(iT(e,t,sU),e+"")}function rd(e,t,n,i){if(!o$(e))return e;t=rR(t,e);for(var o=-1,s=t.length,a=s-1,l=e;null!=l&&++o<s;){var u=iF(t[o]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)break;if(o!=a){var h=l[u];c=i?i(h,u,l):r,r===c&&(c=o$(h)?h:ix(t[o+1])?[]:{})}nE(l,u,c),l=l[u]}return e}var rf=ni?function(e,t){return ni.set(e,t),e}:sU,rp=e5?function(e,t){return e5(e,"toString",{configurable:!0,enumerable:!1,value:sB(t),writable:!0})}:sU;function rg(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=ey(i);++r<i;)o[r]=e[r+t];return o}function rm(e,t){var n;return nF(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function rv(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=0x7fffffff){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!o1(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return ry(e,t,sU,n)}function ry(e,t,n,i){var o=0,s=null==e?0:e.length;if(0===s)return 0;for(var a=(t=n(t))!=t,l=null===t,u=o1(t),c=r===t;o<s;){var h=tG((o+s)/2),d=n(e[h]),f=r!==d,p=null===d,g=d==d,m=o1(d);if(a)var v=i||g;else v=c?g&&(i||f):l?g&&f&&(i||!p):u?g&&f&&!p&&(i||!m):!p&&!m&&(i?d<=t:d<t);v?o=h+1:s=h}return t3(s,0xfffffffe)}function rb(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!oI(a,l)){var l=a;o[i++]=0===s?0:s}}return o}function rw(e){return"number"==typeof e?e:o1(e)?l:+e}function rx(e){if("string"==typeof e)return e;if(oB(e))return tp(e,rx)+"";if(o1(e))return nf?nf.call(e):"";var t=e+"";return"0"==t&&1/e==-a?"-0":t}function rS(e,t,n){var r=-1,i=td,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=tf;else if(o>=200){var u=t?null:r6(e);if(u)return tV(u);s=!1,i=tD,l=new nS}else l=t?[]:a;e:for(;++r<o;){var c=e[r],h=t?t(c):c;if(c=n||0!==c?c:0,s&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),a.push(c)}else i(l,h,n)||(l!==a&&l.push(h),a.push(c))}return a}function rk(e,t){t=rR(t,e);var n=-1,r=t.length;if(!r)return!0;for(var i=null==e||"object"!=typeof e&&"function"!=typeof e;++n<r;){var o=t[n];if("string"==typeof o){if("__proto__"===o&&!eM.call(e,"__proto__"))return!1;if("constructor"===o&&n+1<r&&"string"==typeof t[n+1]&&"prototype"===t[n+1]){if(i&&0===n)continue;return!1}}}var s=iP(e,t);return null==s||delete s[iF(iZ(t))]}function r_(e,t,n,r){return rd(e,t,n(nX(e,t)),r)}function rO(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?rg(e,r?0:o,r?o+1:i):rg(e,r?o+1:0,r?i:o)}function rC(e,t){var n=e;return n instanceof ny&&(n=n.value()),tm(t,function(e,t){return t.func.apply(t.thisArg,tg([e],t.args))},n)}function rE(e,t,n){var r=e.length;if(r<2)return r?rS(e[0]):[];for(var i=-1,o=ey(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=nB(o[i]||s,e[a],t,n));return rS(nz(o,1),t,n)}function rT(e,t,n){for(var i=-1,o=e.length,s=t.length,a={};++i<o;){var l=i<s?t[i]:r;n(a,e[i],l)}return a}function rP(e){return oU(e)?e:[]}function rA(e){return"function"==typeof e?e:sU}function rR(e,t){return oB(e)?e:ik(e,t)?[e]:iB(st(e))}function rM(e,t,n){var i=e.length;return n=r===n?i:n,!t&&n>=i?e:rg(e,t,n)}var rI=e7||function(e){return e8.clearTimeout(e)};function rD(e,t){if(t)return e.slice();var n=e.length,r=eW?eW(n):new e.constructor(n);return e.copy(r),r}function rL(e){var t=new e.constructor(e.byteLength);return new eq(t).set(new eq(e)),t}function rN(e,t){var n=t?rL(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function rB(e,t){if(e!==t){var n=r!==e,i=null===e,o=e==e,s=o1(e),a=r!==t,l=null===t,u=t==t,c=o1(t);if(!l&&!c&&!s&&e>t||s&&a&&u&&!l&&!c||i&&a&&u||!n&&u||!o)return 1;if(!i&&!s&&!c&&e<t||c&&n&&o&&!i&&!s||l&&n&&o||!a&&o||!u)return -1}return 0}function rF(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,l=t.length,u=t2(o-s,0),c=ey(l+u),h=!r;++a<l;)c[a]=t[a];for(;++i<s;)(h||i<o)&&(c[n[i]]=e[i]);for(;u--;)c[a++]=e[i++];return c}function rj(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,l=-1,u=t.length,c=t2(o-a,0),h=ey(c+u),d=!r;++i<c;)h[i]=e[i];for(var f=i;++l<u;)h[f+l]=t[l];for(;++s<a;)(d||i<o)&&(h[f+n[s]]=e[i++]);return h}function rU(e,t){var n=-1,r=e.length;for(t||(t=ey(r));++n<r;)t[n]=e[n];return t}function rq(e,t,n,i){var o=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var l=t[s],u=i?i(n[l],e[l],l,n,e):r;r===u&&(u=e[l]),o?nR(n,l,u):nE(n,l,u)}return n}function rW(e,t){return function(n,r){var i=oB(n)?tl:nP,o=t?t():{};return i(n,e,ic(r,2),o)}}function rz(e){return rh(function(t,n){var i=-1,o=n.length,s=o>1?n[o-1]:r,a=o>2?n[2]:r;for(s=e.length>3&&"function"==typeof s?(o--,s):r,a&&iS(n[0],n[1],a)&&(s=o<3?r:s,o=1),t=ek(t);++i<o;){var l=n[i];l&&e(t,l,i,s)}return t})}function rV(e,t){return function(n,r){if(null==n)return n;if(!oj(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=ek(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function rH(e){return function(t,n,r){for(var i=-1,o=ek(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(!1===n(o[l],l,o))break}return t}}function rQ(e){return function(t){var n=tU(t=st(t))?tQ(t):r,i=n?n[0]:t.charAt(0),o=n?rM(n,1).join(""):t.slice(1);return i[e]()+o}}function r$(e){return function(t){return tm(sD(sC(t).replace(eV,"")),e,"")}}function rK(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=ng(e.prototype),r=e.apply(n,t);return o$(r)?r:n}}function rX(e){return function(t,n,i){var o=ek(t);if(!oj(t)){var s=ic(n,3);t=sp(t),n=function(e){return s(o[e],e,o)}}var a=e(t,n,i);return a>-1?o[s?t[a]:a]:r}}function rG(e){return ii(function(t){var n=t.length,o=n,s=nv.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new eC(i);if(s&&!l&&"wrapper"==il(a))var l=new nv([],!0)}for(o=l?o:n;++o<n;){var u=il(a=t[o]),c="wrapper"==u?ia(a):r;l=c&&i_(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[il(c[0])].apply(l,c[3]):1==a.length&&i_(a)?l[u]():l.thru(a)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&oB(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}})}function rZ(e,t,n,i,o,s,a,l,u,c){var h=128&t,d=1&t,f=2&t,p=24&t,g=512&t,m=f?r:rK(e);function v(){for(var y=arguments.length,b=ey(y),w=y;w--;)b[w]=arguments[w];if(p)var x=iu(v),S=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,x);if(i&&(b=rF(b,i,o,p)),s&&(b=rj(b,s,a,p)),y-=S,p&&y<c){var k=tz(b,x);return r4(e,t,rZ,v.placeholder,n,b,k,l,u,c-y)}var _=d?n:this,O=f?_[e]:e;return y=b.length,l?b=function(e,t){for(var n=e.length,i=t3(t.length,n),o=rU(e);i--;){var s=t[i];e[i]=ix(s,n)?o[s]:r}return e}(b,l):g&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==e8&&this instanceof v&&(O=m||rK(O)),O.apply(_,b)}return v}function rY(e,t){return function(n,r){var i,o;return i=t(r),o={},nQ(n,function(t,n,r){e(o,i(t),n,r)}),o}}function rJ(e,t){return function(n,i){var o;if(r===n&&r===i)return t;if(r!==n&&(o=n),r!==i){if(r===o)return i;"string"==typeof n||"string"==typeof i?(n=rx(n),i=rx(i)):(n=rw(n),i=rw(i)),o=e(n,i)}return o}}function r0(e){return ii(function(t){return t=tp(t,tM(ic())),rh(function(n){var r=this;return e(t,function(e){return ta(e,r,n)})})})}function r1(e,t){var n=(t=r===t?" ":rx(t)).length;if(n<2)return n?rc(t,e):t;var i=rc(t,tE(e/tH(t)));return tU(t)?rM(tQ(i),0,e).join(""):i.slice(0,e)}function r2(e){return function(t,n,i){i&&"number"!=typeof i&&iS(t,n,i)&&(n=i=r),t=o6(t),r===n?(n=t,t=0):n=o6(n),i=r===i?t<n?1:-1:o6(i);for(var o=t,s=n,a=i,l=-1,u=t2(tE((s-o)/(a||1)),0),c=ey(u);u--;)c[e?u:++l]=o,o+=a;return c}}function r3(e){return function(t,n){return("string"!=typeof t||"string"!=typeof n)&&(t=o7(t),n=o7(n)),e(t,n)}}function r4(e,t,n,i,o,s,a,l,u,c){var h=8&t,d=h?a:r,f=h?r:a,p=h?s:r,g=h?r:s;t|=h?32:64,4&(t&=~(h?64:32))||(t&=-4);var m=[e,t,o,p,d,g,f,l,u,c],v=n.apply(r,m);return i_(e)&&iR(v,m),v.placeholder=i,iD(v,e,t)}function r8(e){var t=eS[e];return function(e,n){if(e=o7(e),(n=null==n?0:t3(o5(n),292))&&tJ(e)){var r=(st(e)+"e").split("e");return+((r=(st(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(r[1]-n))}return t(e)}}var r6=nt&&1/tV(new nt([,-0]))[1]==a?function(e){return new nt(e)}:sH;function r5(e){return function(t){var n,r,i=iv(t);return i==v?tq(t):i==S?(n=-1,r=Array(t.size),t.forEach(function(e){r[++n]=[e,e]}),r):tp(e(t),function(e){return[e,t[e]]})}}function r9(e,t,n,o,a,l,u,c){var h=2&t;if(!h&&"function"!=typeof e)throw new eC(i);var d=o?o.length:0;if(d||(t&=-97,o=a=r),u=r===u?u:t2(o5(u),0),c=r===c?c:o5(c),d-=a?a.length:0,64&t){var f=o,p=a;o=a=r}var g=h?r:ia(e),m=[e,t,n,o,a,f,p,l,u,c];if(g&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(o||a){1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?rF(u,l,t[4]):l,e[4]=u?tz(e[3],s):t[4]}(l=t[5])&&(u=e[5],e[5]=u?rj(u,l,t[6]):l,e[6]=u?tz(e[5],s):t[6]),(l=t[7])&&(e[7]=l),128&r&&(e[8]=null==e[8]?t[8]:t3(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}}(m,g),e=m[0],t=m[1],n=m[2],o=m[3],a=m[4],(c=m[9]=m[9]===r?h?0:e.length:t2(m[9]-d,0))||!(24&t)||(t&=-25),t&&1!=t)8==t||16==t?T=function(e,t,n){var i=rK(e);function o(){for(var s=arguments.length,a=ey(s),l=s,u=iu(o);l--;)a[l]=arguments[l];var c=s<3&&a[0]!==u&&a[s-1]!==u?[]:tz(a,u);return(s-=c.length)<n?r4(e,t,rZ,o.placeholder,r,a,c,r,r,n-s):ta(this&&this!==e8&&this instanceof o?i:e,this,a)}return o}(e,t,c):32!=t&&33!=t||a.length?T=rZ.apply(r,m):(v=e,y=t,b=n,w=o,x=1&y,S=rK(v),T=function e(){for(var t=-1,n=arguments.length,r=-1,i=w.length,o=ey(i+n),s=this&&this!==e8&&this instanceof e?S:v;++r<i;)o[r]=w[r];for(;n--;)o[r++]=arguments[++t];return ta(s,x?b:this,o)});else var v,y,b,w,x,S,k,_,O,C,E,T=(k=e,_=t,O=n,C=1&_,E=rK(k),function e(){return(this&&this!==e8&&this instanceof e?E:k).apply(C?O:this,arguments)});return iD((g?rf:iR)(T,m),e,t)}function r7(e,t,n,i){return r===e||oI(e,eP[n])&&!eM.call(i,n)?t:e}function ie(e,t,n,i,o,s){return o$(e)&&o$(t)&&(s.set(t,e),rr(e,t,r,ie,s),s.delete(t)),e}function it(e){return oZ(e)?r:e}function ir(e,t,n,i,o,s){var a=1&n,l=e.length,u=t.length;if(l!=u&&!(a&&u>l))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,f=!0,p=2&n?new nS:r;for(s.set(e,t),s.set(t,e);++d<l;){var g=e[d],m=t[d];if(i)var v=a?i(m,g,d,t,e,s):i(g,m,d,e,t,s);if(r!==v){if(v)continue;f=!1;break}if(p){if(!ty(t,function(e,t){if(!tD(p,t)&&(g===e||o(g,e,n,i,s)))return p.push(t)})){f=!1;break}}else if(!(g===m||o(g,m,n,i,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function ii(e){return iI(iT(e,r,iQ),e+"")}function io(e){return nG(e,sp,ig)}function is(e){return nG(e,sg,im)}var ia=ni?function(e){return ni.get(e)}:sH;function il(e){for(var t=e.name+"",n=no[t],r=eM.call(no,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function iu(e){return(eM.call(np,"placeholder")?np:e).placeholder}function ic(){var e=np.iteratee||sq;return e=e===sq?n5:e,arguments.length?e(arguments[0],arguments[1]):e}function ih(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function id(e){for(var t=sp(e),n=t.length;n--;){var r,i=t[n],o=e[i];t[n]=[i,o,(r=o)==r&&!o$(r)]}return t}function ip(e,t){var n=null==e?r:e[t];return n6(n)?n:r}var ig=tZ?function(e){return null==e?[]:th(tZ(e=ek(e)),function(t){return eK.call(e,t)})}:sY,im=tZ?function(e){for(var t=[];e;)tg(t,ig(e)),e=ez(e);return t}:sY,iv=nZ;function iy(e,t,n){t=rR(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=iF(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&oQ(i)&&ix(s,i)&&(oB(e)||oN(e))}function ib(e){return"function"!=typeof e.constructor||iC(e)?{}:ng(ez(e))}function iw(e){return oB(e)||oN(e)||!!(e3&&e&&e[e3])}function ix(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&ed.test(e))&&e>-1&&e%1==0&&e<t}function iS(e,t,n){if(!o$(n))return!1;var r=typeof t;return("number"==r?!!(oj(n)&&ix(t,n.length)):"string"==r&&t in n)&&oI(n[t],e)}function ik(e,t){if(oB(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||o1(e))||K.test(e)||!$.test(e)||null!=t&&e in ek(t)}function i_(e){var t=il(e),n=np[t];if("function"!=typeof n||!(t in ny.prototype))return!1;if(e===n)return!0;var r=ia(n);return!!r&&e===r[0]}(t9&&iv(new t9(new ArrayBuffer(1)))!=E||t7&&iv(new t7)!=v||ne&&iv(ne.resolve())!=w||nt&&iv(new nt)!=S||nn&&iv(new nn)!=O)&&(iv=function(e){var t=nZ(e),n=t==b?e.constructor:r,i=n?ij(n):"";if(i)switch(i){case ns:return E;case na:return v;case nl:return w;case nu:return S;case nc:return O}return t});var iO=eA?oV:sJ;function iC(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||eP)}function iE(e,t){return function(n){return null!=n&&n[e]===t&&(r!==t||e in ek(n))}}function iT(e,t,n){return t=t2(r===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=t2(r.length-t,0),s=ey(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=ey(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),ta(e,this,a)}}function iP(e,t){return t.length<2?e:nX(e,rg(t,0,-1))}function iA(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var iR=iL(rf),iM=tb||function(e,t){return e8.setTimeout(e,t)},iI=iL(rp);function iD(e,t,n){var r,i,o,s=t+"";return iI(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ee,"{\n/* [wrapped with "+t+"] */\n")}(s,(r=(o=s.match(et))?o[1].split(en):[],i=n,tu(u,function(e){var t="_."+e[0];i&e[1]&&!td(r,t)&&r.push(t)}),r.sort())))}function iL(e){var t=0,n=0;return function(){var i=t4(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function iN(e,t){var n=-1,i=e.length,o=i-1;for(t=r===t?i:t;++n<t;){var s=ru(n,o),a=e[s];e[s]=e[n],e[n]=a}return e.length=t,e}var iB=(em=(J=oE(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(X,function(e,n,r,i){t.push(r?i.replace(eo,"$1"):n||e)}),t},function(e){return 500===em.size&&em.clear(),e})).cache,J);function iF(e){if("string"==typeof e||o1(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function ij(e){if(null!=e){try{return eR.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function iU(e){if(e instanceof ny)return e.clone();var t=new nv(e.__wrapped__,e.__chain__);return t.__actions__=rU(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var iq=rh(function(e,t){return oU(e)?nB(e,nz(t,1,oU,!0)):[]}),iW=rh(function(e,t){var n=iZ(t);return oU(n)&&(n=r),oU(e)?nB(e,nz(t,1,oU,!0),ic(n,2)):[]}),iz=rh(function(e,t){var n=iZ(t);return oU(n)&&(n=r),oU(e)?nB(e,nz(t,1,oU,!0),r,n):[]});function iV(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:o5(n);return i<0&&(i=t2(r+i,0)),tx(e,ic(t,3),i)}function iH(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var o=i-1;return r!==n&&(o=o5(n),o=n<0?t2(i+o,0):t3(o,i-1)),tx(e,ic(t,3),o,!0)}function iQ(e){return(null==e?0:e.length)?nz(e,1):[]}function i$(e){return e&&e.length?e[0]:r}var iK=rh(function(e){var t=tp(e,rP);return t.length&&t[0]===e[0]?n1(t):[]}),iX=rh(function(e){var t=iZ(e),n=tp(e,rP);return t===iZ(n)?t=r:n.pop(),n.length&&n[0]===e[0]?n1(n,ic(t,2)):[]}),iG=rh(function(e){var t=iZ(e),n=tp(e,rP);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?n1(n,r,t):[]});function iZ(e){var t=null==e?0:e.length;return t?e[t-1]:r}var iY=rh(iJ);function iJ(e,t){return e&&e.length&&t&&t.length?ra(e,t):e}var i0=ii(function(e,t){var n=null==e?0:e.length,r=nM(e,t);return rl(e,tp(t,function(e){return ix(e,n)?+e:e}).sort(rB)),r});function i1(e){return null==e?e:t5.call(e)}var i2=rh(function(e){return rS(nz(e,1,oU,!0))}),i3=rh(function(e){var t=iZ(e);return oU(t)&&(t=r),rS(nz(e,1,oU,!0),ic(t,2))}),i4=rh(function(e){var t=iZ(e);return t="function"==typeof t?t:r,rS(nz(e,1,oU,!0),r,t)});function i8(e){if(!(e&&e.length))return[];var t=0;return e=th(e,function(e){if(oU(e))return t=t2(e.length,t),!0}),tA(t,function(t){return tp(e,tC(t))})}function i6(e,t){if(!(e&&e.length))return[];var n=i8(e);return null==t?n:tp(n,function(e){return ta(t,r,e)})}var i5=rh(function(e,t){return oU(e)?nB(e,t):[]}),i9=rh(function(e){return rE(th(e,oU))}),i7=rh(function(e){var t=iZ(e);return oU(t)&&(t=r),rE(th(e,oU),ic(t,2))}),oe=rh(function(e){var t=iZ(e);return t="function"==typeof t?t:r,rE(th(e,oU),r,t)}),ot=rh(i8),on=rh(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,i6(e,n)});function or(e){var t=np(e);return t.__chain__=!0,t}function oi(e,t){return t(e)}var oo=ii(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return nM(t,e)};return!(t>1)&&!this.__actions__.length&&i instanceof ny&&ix(n)?((i=i.slice(n,+n+ +!!t)).__actions__.push({func:oi,args:[o],thisArg:r}),new nv(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),os=rW(function(e,t,n){eM.call(e,n)?++e[n]:nR(e,n,1)}),oa=rX(iV),ol=rX(iH);function ou(e,t){return(oB(e)?tu:nF)(e,ic(t,3))}function oc(e,t){return(oB(e)?function(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}:nj)(e,ic(t,3))}var oh=rW(function(e,t,n){eM.call(e,n)?e[n].push(t):nR(e,n,[t])}),od=rh(function(e,t,n){var r=-1,i="function"==typeof t,o=oj(e)?ey(e.length):[];return nF(e,function(e){o[++r]=i?ta(t,e,n):n2(e,t,n)}),o}),of=rW(function(e,t,n){nR(e,n,t)});function op(e,t){return(oB(e)?tp:re)(e,ic(t,3))}var og=rW(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]}),om=rh(function(e,t){if(null==e)return[];var n=t.length;return n>1&&iS(e,t[0],t[1])?t=[]:n>2&&iS(t[0],t[1],t[2])&&(t=[t[0]]),ro(e,nz(t,1),[])}),ov=te||function(){return e8.Date.now()};function oy(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,r9(e,128,r,r,r,r,t)}function ob(e,t){var n;if("function"!=typeof t)throw new eC(i);return e=o5(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var ow=rh(function(e,t,n){var r=1;if(n.length){var i=tz(n,iu(ow));r|=32}return r9(e,r,t,n,i)}),ox=rh(function(e,t,n){var r=3;if(n.length){var i=tz(n,iu(ox));r|=32}return r9(t,r,e,n,i)});function oS(e,t,n){t=n?r:t;var i=r9(e,8,r,r,r,r,r,t);return i.placeholder=oS.placeholder,i}function ok(e,t,n){t=n?r:t;var i=r9(e,16,r,r,r,r,r,t);return i.placeholder=ok.placeholder,i}function o_(e,t,n){var o,s,a,l,u,c,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new eC(i);function g(t){var n=o,i=s;return o=s=r,h=t,l=e.apply(i,n)}function m(e){var n=e-c,i=e-h;return r===c||n>=t||n<0||f&&i>=a}function v(){var e,n,r,i=ov();if(m(i))return y(i);u=iM(v,(e=i-c,n=i-h,r=t-e,f?t3(r,a-n):r))}function y(e){return(u=r,p&&o)?g(e):(o=s=r,l)}function b(){var e,n=ov(),i=m(n);if(o=arguments,s=this,c=n,i){if(r===u)return h=e=c,u=iM(v,t),d?g(e):l;if(f)return rI(u),u=iM(v,t),g(c)}return r===u&&(u=iM(v,t)),l}return t=o7(t)||0,o$(n)&&(d=!!n.leading,a=(f="maxWait"in n)?t2(o7(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){r!==u&&rI(u),h=0,o=c=s=u=r},b.flush=function(){return r===u?l:y(ov())},b}var oO=rh(function(e,t){return nN(e,1,t)}),oC=rh(function(e,t,n){return nN(e,o7(t)||0,n)});function oE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new eC(i);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(oE.Cache||nx),n}function oT(e){if("function"!=typeof e)throw new eC(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}oE.Cache=nx;var oP=rh(function(e,t){var n=(t=1==t.length&&oB(t[0])?tp(t[0],tM(ic())):tp(nz(t,1),tM(ic()))).length;return rh(function(r){for(var i=-1,o=t3(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return ta(e,this,r)})}),oA=rh(function(e,t){var n=tz(t,iu(oA));return r9(e,32,r,t,n)}),oR=rh(function(e,t){var n=tz(t,iu(oR));return r9(e,64,r,t,n)}),oM=ii(function(e,t){return r9(e,256,r,r,r,t)});function oI(e,t){return e===t||e!=e&&t!=t}var oD=r3(nY),oL=r3(function(e,t){return e>=t}),oN=n3(function(){return arguments}())?n3:function(e){return oK(e)&&eM.call(e,"callee")&&!eK.call(e,"callee")},oB=ey.isArray,oF=tt?tM(tt):function(e){return oK(e)&&nZ(e)==C};function oj(e){return null!=e&&oQ(e.length)&&!oV(e)}function oU(e){return oK(e)&&oj(e)}var oq=tY||sJ,oW=tn?tM(tn):function(e){return oK(e)&&nZ(e)==f};function oz(e){if(!oK(e))return!1;var t=nZ(e);return t==p||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!oZ(e)}function oV(e){if(!o$(e))return!1;var t=nZ(e);return t==g||t==m||"[object AsyncFunction]"==t||"[object Proxy]"==t}function oH(e){return"number"==typeof e&&e==o5(e)}function oQ(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff}function o$(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function oK(e){return null!=e&&"object"==typeof e}var oX=tr?tM(tr):function(e){return oK(e)&&iv(e)==v};function oG(e){return"number"==typeof e||oK(e)&&nZ(e)==y}function oZ(e){if(!oK(e)||nZ(e)!=b)return!1;var t=ez(e);if(null===t)return!0;var n=eM.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&eR.call(n)==eN}var oY=ti?tM(ti):function(e){return oK(e)&&nZ(e)==x},oJ=to?tM(to):function(e){return oK(e)&&iv(e)==S};function o0(e){return"string"==typeof e||!oB(e)&&oK(e)&&nZ(e)==k}function o1(e){return"symbol"==typeof e||oK(e)&&nZ(e)==_}var o2=ts?tM(ts):function(e){return oK(e)&&oQ(e.length)&&!!eY[nZ(e)]},o3=r3(n7),o4=r3(function(e,t){return e<=t});function o8(e){if(!e)return[];if(oj(e))return o0(e)?tQ(e):rU(e);if(e4&&e[e4]){for(var t,n=e[e4](),r=[];!(t=n.next()).done;)r.push(t.value);return r}var i=iv(e);return(i==v?tq:i==S?tV:sk)(e)}function o6(e){return e?(e=o7(e))===a||e===-a?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function o5(e){var t=o6(e),n=t%1;return t==t?n?t-n:t:0}function o9(e){return e?nI(o5(e),0,0xffffffff):0}function o7(e){if("number"==typeof e)return e;if(o1(e))return l;if(o$(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o$(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tR(e);var n=eu.test(e);return n||eh.test(e)?e2(e.slice(2),n?2:8):el.test(e)?l:+e}function se(e){return rq(e,sg(e))}function st(e){return null==e?"":rx(e)}var sn=rz(function(e,t){if(iC(t)||oj(t))return void rq(t,sp(t),e);for(var n in t)eM.call(t,n)&&nE(e,n,t[n])}),sr=rz(function(e,t){rq(t,sg(t),e)}),si=rz(function(e,t,n,r){rq(t,sg(t),e,r)}),so=rz(function(e,t,n,r){rq(t,sp(t),e,r)}),ss=ii(nM),sa=rh(function(e,t){e=ek(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&iS(t[0],t[1],o)&&(i=1);++n<i;)for(var s=t[n],a=sg(s),l=-1,u=a.length;++l<u;){var c=a[l],h=e[c];(r===h||oI(h,eP[c])&&!eM.call(e,c))&&(e[c]=s[c])}return e}),sl=rh(function(e){return e.push(r,ie),ta(sv,r,e)});function su(e,t,n){var i=null==e?r:nX(e,t);return r===i?n:i}function sc(e,t){return null!=e&&iy(e,t,n0)}var sh=rY(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=eL.call(t)),e[t]=n},sB(sU)),sd=rY(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=eL.call(t)),eM.call(e,t)?e[t].push(n):e[t]=[n]},ic),sf=rh(n2);function sp(e){return oj(e)?n_(e):n9(e)}function sg(e){return oj(e)?n_(e,!0):function(e){if(!o$(e)){var t=e,n=[];if(null!=t)for(var r in ek(t))n.push(r);return n}var i=iC(e),o=[];for(var s in e)"constructor"==s&&(i||!eM.call(e,s))||o.push(s);return o}(e)}var sm=rz(function(e,t,n){rr(e,t,n)}),sv=rz(function(e,t,n,r){rr(e,t,n,r)}),sy=ii(function(e,t){var n={};if(null==e)return n;var r=!1;t=tp(t,function(t){return t=rR(t,e),r||(r=t.length>1),t}),rq(e,is(e),n),r&&(n=nD(n,7,it));for(var i=t.length;i--;)rk(n,t[i]);return n}),sb=ii(function(e,t){return null==e?{}:rs(e,t,function(t,n){return sc(e,n)})});function sw(e,t){if(null==e)return{};var n=tp(is(e),function(e){return[e]});return t=ic(t),rs(e,n,function(e,n){return t(e,n[0])})}var sx=r5(sp),sS=r5(sg);function sk(e){return null==e?[]:tI(e,sp(e))}var s_=r$(function(e,t,n){return t=t.toLowerCase(),e+(n?sO(t):t)});function sO(e){return sI(st(e).toLowerCase())}function sC(e){return(e=st(e))&&e.replace(ef,tB).replace(eH,"")}var sE=r$(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),sT=r$(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),sP=rQ("toLowerCase"),sA=r$(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),sR=r$(function(e,t,n){return e+(n?" ":"")+sI(t)}),sM=r$(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),sI=rQ("toUpperCase");function sD(e,t,n){if(e=st(e),t=n?r:t,r===t){var i;return(i=e,eX.test(i))?e.match(e$)||[]:e.match(er)||[]}return e.match(t)||[]}var sL=rh(function(e,t){try{return ta(e,r,t)}catch(e){return oz(e)?e:new ew(e)}}),sN=ii(function(e,t){return tu(t,function(t){nR(e,t=iF(t),ow(e[t],e))}),e});function sB(e){return function(){return e}}var sF=rG(),sj=rG(!0);function sU(e){return e}function sq(e){return n5("function"==typeof e?e:nD(e,1))}var sW=rh(function(e,t){return function(n){return n2(n,e,t)}}),sz=rh(function(e,t){return function(n){return n2(e,n,t)}});function sV(e,t,n){var r=sp(t),i=nK(t,r);null!=n||o$(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=nK(t,sp(t)));var o=!(o$(n)&&"chain"in n)||!!n.chain,s=oV(e);return tu(i,function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=rU(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,tg([this.value()],arguments))})}),e}function sH(){}var sQ=r0(tp),s$=r0(tc),sK=r0(ty);function sX(e){return ik(e)?tC(iF(e)):function(t){return nX(t,e)}}var sG=r2(),sZ=r2(!0);function sY(){return[]}function sJ(){return!1}var s0=rJ(function(e,t){return e+t},0),s1=r8("ceil"),s2=rJ(function(e,t){return e/t},1),s3=r8("floor"),s4=rJ(function(e,t){return e*t},1),s8=r8("round"),s6=rJ(function(e,t){return e-t},0);return np.after=function(e,t){if("function"!=typeof t)throw new eC(i);return e=o5(e),function(){if(--e<1)return t.apply(this,arguments)}},np.ary=oy,np.assign=sn,np.assignIn=sr,np.assignInWith=si,np.assignWith=so,np.at=ss,np.before=ob,np.bind=ow,np.bindAll=sN,np.bindKey=ox,np.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return oB(e)?e:[e]},np.chain=or,np.chunk=function(e,t,n){t=(n?iS(e,t,n):r===t)?1:t2(o5(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,s=0,a=ey(tE(i/t));o<i;)a[s++]=rg(e,o,o+=t);return a},np.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},np.concat=function(){var e=arguments.length;if(!e)return[];for(var t=ey(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return tg(oB(n)?rU(n):[n],nz(t,1))},np.cond=function(e){var t=null==e?0:e.length,n=ic();return e=t?tp(e,function(e){if("function"!=typeof e[1])throw new eC(i);return[n(e[0]),e[1]]}):[],rh(function(n){for(var r=-1;++r<t;){var i=e[r];if(ta(i[0],this,n))return ta(i[1],this,n)}})},np.conforms=function(e){var t,n;return n=sp(t=nD(e,1)),function(e){return nL(e,t,n)}},np.constant=sB,np.countBy=os,np.create=function(e,t){var n=ng(e);return null==t?n:nA(n,t)},np.curry=oS,np.curryRight=ok,np.debounce=o_,np.defaults=sa,np.defaultsDeep=sl,np.defer=oO,np.delay=oC,np.difference=iq,np.differenceBy=iW,np.differenceWith=iz,np.drop=function(e,t,n){var i=null==e?0:e.length;return i?rg(e,(t=n||r===t?1:o5(t))<0?0:t,i):[]},np.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?rg(e,0,(t=i-(t=n||r===t?1:o5(t)))<0?0:t):[]},np.dropRightWhile=function(e,t){return e&&e.length?rO(e,ic(t,3),!0,!0):[]},np.dropWhile=function(e,t){return e&&e.length?rO(e,ic(t,3),!0):[]},np.fill=function(e,t,n,i){var o=null==e?0:e.length;if(!o)return[];n&&"number"!=typeof n&&iS(e,t,n)&&(n=0,i=o);var s=n,a=i,l=e.length;for((s=o5(s))<0&&(s=-s>l?0:l+s),(a=r===a||a>l?l:o5(a))<0&&(a+=l),a=s>a?0:o9(a);s<a;)e[s++]=t;return e},np.filter=function(e,t){return(oB(e)?th:nW)(e,ic(t,3))},np.flatMap=function(e,t){return nz(op(e,t),1)},np.flatMapDeep=function(e,t){return nz(op(e,t),a)},np.flatMapDepth=function(e,t,n){return n=r===n?1:o5(n),nz(op(e,t),n)},np.flatten=iQ,np.flattenDeep=function(e){return(null==e?0:e.length)?nz(e,a):[]},np.flattenDepth=function(e,t){return(null==e?0:e.length)?nz(e,t=r===t?1:o5(t)):[]},np.flip=function(e){return r9(e,512)},np.flow=sF,np.flowRight=sj,np.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},np.functions=function(e){return null==e?[]:nK(e,sp(e))},np.functionsIn=function(e){return null==e?[]:nK(e,sg(e))},np.groupBy=oh,np.initial=function(e){return(null==e?0:e.length)?rg(e,0,-1):[]},np.intersection=iK,np.intersectionBy=iX,np.intersectionWith=iG,np.invert=sh,np.invertBy=sd,np.invokeMap=od,np.iteratee=sq,np.keyBy=of,np.keys=sp,np.keysIn=sg,np.map=op,np.mapKeys=function(e,t){var n={};return t=ic(t,3),nQ(e,function(e,r,i){nR(n,t(e,r,i),e)}),n},np.mapValues=function(e,t){var n={};return t=ic(t,3),nQ(e,function(e,r,i){nR(n,r,t(e,r,i))}),n},np.matches=function(e){return rt(nD(e,1))},np.matchesProperty=function(e,t){return rn(e,nD(t,1))},np.memoize=oE,np.merge=sm,np.mergeWith=sv,np.method=sW,np.methodOf=sz,np.mixin=sV,np.negate=oT,np.nthArg=function(e){return e=o5(e),rh(function(t){return ri(t,e)})},np.omit=sy,np.omitBy=function(e,t){return sw(e,oT(ic(t)))},np.once=function(e){return ob(2,e)},np.orderBy=function(e,t,n,i){return null==e?[]:(oB(t)||(t=null==t?[]:[t]),oB(n=i?r:n)||(n=null==n?[]:[n]),ro(e,t,n))},np.over=sQ,np.overArgs=oP,np.overEvery=s$,np.overSome=sK,np.partial=oA,np.partialRight=oR,np.partition=og,np.pick=sb,np.pickBy=sw,np.property=sX,np.propertyOf=function(e){return function(t){return null==e?r:nX(e,t)}},np.pull=iY,np.pullAll=iJ,np.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?ra(e,t,ic(n,2)):e},np.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?ra(e,t,r,n):e},np.pullAt=i0,np.range=sG,np.rangeRight=sZ,np.rearg=oM,np.reject=function(e,t){return(oB(e)?th:nW)(e,oT(ic(t,3)))},np.remove=function(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],o=e.length;for(t=ic(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return rl(e,i),n},np.rest=function(e,t){if("function"!=typeof e)throw new eC(i);return rh(e,t=r===t?t:o5(t))},np.reverse=i1,np.sampleSize=function(e,t,n){return t=(n?iS(e,t,n):r===t)?1:o5(t),(oB(e)?function(e,t){return iN(rU(e),nI(t,0,e.length))}:function(e,t){var n=sk(e);return iN(n,nI(t,0,n.length))})(e,t)},np.set=function(e,t,n){return null==e?e:rd(e,t,n)},np.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:rd(e,t,n,i)},np.shuffle=function(e){return(oB(e)?function(e){return iN(rU(e))}:function(e){return iN(sk(e))})(e)},np.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&iS(e,t,n)?(t=0,n=i):(t=null==t?0:o5(t),n=r===n?i:o5(n)),rg(e,t,n)):[]},np.sortBy=om,np.sortedUniq=function(e){return e&&e.length?rb(e):[]},np.sortedUniqBy=function(e,t){return e&&e.length?rb(e,ic(t,2)):[]},np.split=function(e,t,n){return(n&&"number"!=typeof n&&iS(e,t,n)&&(t=n=r),n=r===n?0xffffffff:n>>>0)?(e=st(e))&&("string"==typeof t||null!=t&&!oY(t))&&!(t=rx(t))&&tU(e)?rM(tQ(e),0,n):e.split(t,n):[]},np.spread=function(e,t){if("function"!=typeof e)throw new eC(i);return t=null==t?0:t2(o5(t),0),rh(function(n){var r=n[t],i=rM(n,0,t);return r&&tg(i,r),ta(e,this,i)})},np.tail=function(e){var t=null==e?0:e.length;return t?rg(e,1,t):[]},np.take=function(e,t,n){return e&&e.length?rg(e,0,(t=n||r===t?1:o5(t))<0?0:t):[]},np.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?rg(e,(t=i-(t=n||r===t?1:o5(t)))<0?0:t,i):[]},np.takeRightWhile=function(e,t){return e&&e.length?rO(e,ic(t,3),!1,!0):[]},np.takeWhile=function(e,t){return e&&e.length?rO(e,ic(t,3)):[]},np.tap=function(e,t){return t(e),e},np.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new eC(i);return o$(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),o_(e,t,{leading:r,maxWait:t,trailing:o})},np.thru=oi,np.toArray=o8,np.toPairs=sx,np.toPairsIn=sS,np.toPath=function(e){return oB(e)?tp(e,iF):o1(e)?[e]:rU(iB(st(e)))},np.toPlainObject=se,np.transform=function(e,t,n){var r=oB(e),i=r||oq(e)||o2(e);if(t=ic(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:o$(e)&&oV(o)?ng(ez(e)):{}}return(i?tu:nQ)(e,function(e,r,i){return t(n,e,r,i)}),n},np.unary=function(e){return oy(e,1)},np.union=i2,np.unionBy=i3,np.unionWith=i4,np.uniq=function(e){return e&&e.length?rS(e):[]},np.uniqBy=function(e,t){return e&&e.length?rS(e,ic(t,2)):[]},np.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?rS(e,r,t):[]},np.unset=function(e,t){return null==e||rk(e,t)},np.unzip=i8,np.unzipWith=i6,np.update=function(e,t,n){return null==e?e:r_(e,t,rA(n))},np.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:r_(e,t,rA(n),i)},np.values=sk,np.valuesIn=function(e){return null==e?[]:tI(e,sg(e))},np.without=i5,np.words=sD,np.wrap=function(e,t){return oA(rA(t),e)},np.xor=i9,np.xorBy=i7,np.xorWith=oe,np.zip=ot,np.zipObject=function(e,t){return rT(e||[],t||[],nE)},np.zipObjectDeep=function(e,t){return rT(e||[],t||[],rd)},np.zipWith=on,np.entries=sx,np.entriesIn=sS,np.extend=sr,np.extendWith=si,sV(np,np),np.add=s0,np.attempt=sL,np.camelCase=s_,np.capitalize=sO,np.ceil=s1,np.clamp=function(e,t,n){return r===n&&(n=t,t=r),r!==n&&(n=(n=o7(n))==n?n:0),r!==t&&(t=(t=o7(t))==t?t:0),nI(o7(e),t,n)},np.clone=function(e){return nD(e,4)},np.cloneDeep=function(e){return nD(e,5)},np.cloneDeepWith=function(e,t){return nD(e,5,t="function"==typeof t?t:r)},np.cloneWith=function(e,t){return nD(e,4,t="function"==typeof t?t:r)},np.conformsTo=function(e,t){return null==t||nL(e,t,sp(t))},np.deburr=sC,np.defaultTo=function(e,t){return null==e||e!=e?t:e},np.divide=s2,np.endsWith=function(e,t,n){e=st(e),t=rx(t);var i=e.length,o=n=r===n?i:nI(o5(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},np.eq=oI,np.escape=function(e){return(e=st(e))&&z.test(e)?e.replace(q,tF):e},np.escapeRegExp=function(e){return(e=st(e))&&Z.test(e)?e.replace(G,"\\$&"):e},np.every=function(e,t,n){var i=oB(e)?tc:nU;return n&&iS(e,t,n)&&(t=r),i(e,ic(t,3))},np.find=oa,np.findIndex=iV,np.findKey=function(e,t){return tw(e,ic(t,3),nQ)},np.findLast=ol,np.findLastIndex=iH,np.findLastKey=function(e,t){return tw(e,ic(t,3),n$)},np.floor=s3,np.forEach=ou,np.forEachRight=oc,np.forIn=function(e,t){return null==e?e:nV(e,ic(t,3),sg)},np.forInRight=function(e,t){return null==e?e:nH(e,ic(t,3),sg)},np.forOwn=function(e,t){return e&&nQ(e,ic(t,3))},np.forOwnRight=function(e,t){return e&&n$(e,ic(t,3))},np.get=su,np.gt=oD,np.gte=oL,np.has=function(e,t){return null!=e&&iy(e,t,nJ)},np.hasIn=sc,np.head=i$,np.identity=sU,np.includes=function(e,t,n,r){e=oj(e)?e:sk(e),n=n&&!r?o5(n):0;var i=e.length;return n<0&&(n=t2(i+n,0)),o0(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&tS(e,t,n)>-1},np.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return -1;var i=null==n?0:o5(n);return i<0&&(i=t2(r+i,0)),tS(e,t,i)},np.inRange=function(e,t,n){var i,o,s;return t=o6(t),r===n?(n=t,t=0):n=o6(n),(i=e=o7(e))>=t3(o=t,s=n)&&i<t2(o,s)},np.invoke=sf,np.isArguments=oN,np.isArray=oB,np.isArrayBuffer=oF,np.isArrayLike=oj,np.isArrayLikeObject=oU,np.isBoolean=function(e){return!0===e||!1===e||oK(e)&&nZ(e)==d},np.isBuffer=oq,np.isDate=oW,np.isElement=function(e){return oK(e)&&1===e.nodeType&&!oZ(e)},np.isEmpty=function(e){if(null==e)return!0;if(oj(e)&&(oB(e)||"string"==typeof e||"function"==typeof e.splice||oq(e)||o2(e)||oN(e)))return!e.length;var t=iv(e);if(t==v||t==S)return!e.size;if(iC(e))return!n9(e).length;for(var n in e)if(eM.call(e,n))return!1;return!0},np.isEqual=function(e,t){return n4(e,t)},np.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return r===i?n4(e,t,r,n):!!i},np.isError=oz,np.isFinite=function(e){return"number"==typeof e&&tJ(e)},np.isFunction=oV,np.isInteger=oH,np.isLength=oQ,np.isMap=oX,np.isMatch=function(e,t){return e===t||n8(e,t,id(t))},np.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,n8(e,t,id(t),n)},np.isNaN=function(e){return oG(e)&&e!=+e},np.isNative=function(e){if(iO(e))throw new ew("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return n6(e)},np.isNil=function(e){return null==e},np.isNull=function(e){return null===e},np.isNumber=oG,np.isObject=o$,np.isObjectLike=oK,np.isPlainObject=oZ,np.isRegExp=oY,np.isSafeInteger=function(e){return oH(e)&&e>=-0x1fffffffffffff&&e<=0x1fffffffffffff},np.isSet=oJ,np.isString=o0,np.isSymbol=o1,np.isTypedArray=o2,np.isUndefined=function(e){return r===e},np.isWeakMap=function(e){return oK(e)&&iv(e)==O},np.isWeakSet=function(e){return oK(e)&&"[object WeakSet]"==nZ(e)},np.join=function(e,t){return null==e?"":t0.call(e,t)},np.kebabCase=sE,np.last=iZ,np.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var o=i;return r!==n&&(o=(o=o5(n))<0?t2(i+o,0):t3(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--&&e[r]!==t;);return r}(e,t,o):tx(e,t_,o,!0)},np.lowerCase=sT,np.lowerFirst=sP,np.lt=o3,np.lte=o4,np.max=function(e){return e&&e.length?nq(e,sU,nY):r},np.maxBy=function(e,t){return e&&e.length?nq(e,ic(t,2),nY):r},np.mean=function(e){return tO(e,sU)},np.meanBy=function(e,t){return tO(e,ic(t,2))},np.min=function(e){return e&&e.length?nq(e,sU,n7):r},np.minBy=function(e,t){return e&&e.length?nq(e,ic(t,2),n7):r},np.stubArray=sY,np.stubFalse=sJ,np.stubObject=function(){return{}},np.stubString=function(){return""},np.stubTrue=function(){return!0},np.multiply=s4,np.nth=function(e,t){return e&&e.length?ri(e,o5(t)):r},np.noConflict=function(){return e8._===this&&(e8._=eB),this},np.noop=sH,np.now=ov,np.pad=function(e,t,n){e=st(e);var r=(t=o5(t))?tH(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return r1(tG(i),n)+e+r1(tE(i),n)},np.padEnd=function(e,t,n){e=st(e);var r=(t=o5(t))?tH(e):0;return t&&r<t?e+r1(t-r,n):e},np.padStart=function(e,t,n){e=st(e);var r=(t=o5(t))?tH(e):0;return t&&r<t?r1(t-r,n)+e:e},np.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t*=1),t8(st(e).replace(Y,""),t||0)},np.random=function(e,t,n){if(n&&"boolean"!=typeof n&&iS(e,t,n)&&(t=n=r),r===n&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),r===e&&r===t?(e=0,t=1):(e=o6(e),r===t?(t=e,e=0):t=o6(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=t6();return t3(e+o*(t-e+e1("1e-"+((o+"").length-1))),t)}return ru(e,t)},np.reduce=function(e,t,n){var r=oB(e)?tm:tT,i=arguments.length<3;return r(e,ic(t,4),n,i,nF)},np.reduceRight=function(e,t,n){var r=oB(e)?tv:tT,i=arguments.length<3;return r(e,ic(t,4),n,i,nj)},np.repeat=function(e,t,n){return t=(n?iS(e,t,n):r===t)?1:o5(t),rc(st(e),t)},np.replace=function(){var e=arguments,t=st(e[0]);return e.length<3?t:t.replace(e[1],e[2])},np.result=function(e,t,n){t=rR(t,e);var i=-1,o=t.length;for(o||(o=1,e=r);++i<o;){var s=null==e?r:e[iF(t[i])];r===s&&(i=o,s=n),e=oV(s)?s.call(e):s}return e},np.round=s8,np.runInContext=e,np.sample=function(e){return(oB(e)?nO:function(e){return nO(sk(e))})(e)},np.size=function(e){if(null==e)return 0;if(oj(e))return o0(e)?tH(e):e.length;var t=iv(e);return t==v||t==S?e.size:n9(e).length},np.snakeCase=sA,np.some=function(e,t,n){var i=oB(e)?ty:rm;return n&&iS(e,t,n)&&(t=r),i(e,ic(t,3))},np.sortedIndex=function(e,t){return rv(e,t)},np.sortedIndexBy=function(e,t,n){return ry(e,t,ic(n,2))},np.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=rv(e,t);if(r<n&&oI(e[r],t))return r}return -1},np.sortedLastIndex=function(e,t){return rv(e,t,!0)},np.sortedLastIndexBy=function(e,t,n){return ry(e,t,ic(n,2),!0)},np.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=rv(e,t,!0)-1;if(oI(e[n],t))return n}return -1},np.startCase=sR,np.startsWith=function(e,t,n){return e=st(e),n=null==n?0:nI(o5(n),0,e.length),t=rx(t),e.slice(n,n+t.length)==t},np.subtract=s6,np.sum=function(e){return e&&e.length?tP(e,sU):0},np.sumBy=function(e,t){return e&&e.length?tP(e,ic(t,2)):0},np.template=function(e,t,n){var i=np.templateSettings;n&&iS(e,t,n)&&(t=r),e=st(e),t=si({},t,i,r7);var o,s,a=si({},t.imports,i.imports,r7),l=sp(a),u=tI(a,l),c=0,h=t.interpolate||ep,d="__p += '",f=e_((t.escape||ep).source+"|"+h.source+"|"+(h===Q?es:ep).source+"|"+(t.evaluate||ep).source+"|$","g"),p="//# sourceURL="+(eM.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eZ+"]")+"\n";e.replace(f,function(t,n,r,i,a,l){return r||(r=i),d+=e.slice(c,l).replace(eg,tj),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=l+t.length,t}),d+="';\n";var g=eM.call(t,"variable")&&t.variable;if(g){if(ei.test(g))throw new ew("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(s?d.replace(B,""):d).replace(F,"$1").replace(j,"$1;"),d="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=sL(function(){return ex(l,p+"return "+d).apply(r,u)});if(m.source=d,oz(m))throw m;return m},np.times=function(e,t){if((e=o5(e))<1||e>0x1fffffffffffff)return[];var n=0xffffffff,r=t3(e,0xffffffff);t=ic(t),e-=0xffffffff;for(var i=tA(r,t);++n<e;)t(n);return i},np.toFinite=o6,np.toInteger=o5,np.toLength=o9,np.toLower=function(e){return st(e).toLowerCase()},np.toNumber=o7,np.toSafeInteger=function(e){return e?nI(o5(e),-0x1fffffffffffff,0x1fffffffffffff):0===e?e:0},np.toString=st,np.toUpper=function(e){return st(e).toUpperCase()},np.trim=function(e,t,n){if((e=st(e))&&(n||r===t))return tR(e);if(!e||!(t=rx(t)))return e;var i=tQ(e),o=tQ(t),s=tL(i,o),a=tN(i,o)+1;return rM(i,s,a).join("")},np.trimEnd=function(e,t,n){if((e=st(e))&&(n||r===t))return e.slice(0,t$(e)+1);if(!e||!(t=rx(t)))return e;var i=tQ(e),o=tN(i,tQ(t))+1;return rM(i,0,o).join("")},np.trimStart=function(e,t,n){if((e=st(e))&&(n||r===t))return e.replace(Y,"");if(!e||!(t=rx(t)))return e;var i=tQ(e),o=tL(i,tQ(t));return rM(i,o).join("")},np.truncate=function(e,t){var n=30,i="...";if(o$(t)){var o="separator"in t?t.separator:o;n="length"in t?o5(t.length):n,i="omission"in t?rx(t.omission):i}var s=(e=st(e)).length;if(tU(e)){var a=tQ(e);s=a.length}if(n>=s)return e;var l=n-tH(i);if(l<1)return i;var u=a?rM(a,0,l).join(""):e.slice(0,l);if(r===o)return u+i;if(a&&(l+=u.length-l),oY(o)){if(e.slice(l).search(o)){var c,h=u;for(o.global||(o=e_(o.source,st(ea.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,r===d?l:d)}}else if(e.indexOf(rx(o),l)!=l){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i},np.unescape=function(e){return(e=st(e))&&W.test(e)?e.replace(U,tK):e},np.uniqueId=function(e){var t=++eI;return st(e)+t},np.upperCase=sM,np.upperFirst=sI,np.each=ou,np.eachRight=oc,np.first=i$,sV(np,(ev={},nQ(np,function(e,t){eM.call(np.prototype,t)||(ev[t]=e)}),ev),{chain:!1}),np.VERSION="4.17.23",tu(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){np[e].placeholder=np}),tu(["drop","take"],function(e,t){ny.prototype[e]=function(n){n=r===n?1:t2(o5(n),0);var i=this.__filtered__&&!t?new ny(this):this.clone();return i.__filtered__?i.__takeCount__=t3(n,i.__takeCount__):i.__views__.push({size:t3(n,0xffffffff),type:e+(i.__dir__<0?"Right":"")}),i},ny.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),tu(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;ny.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ic(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),tu(["head","last"],function(e,t){var n="take"+(t?"Right":"");ny.prototype[e]=function(){return this[n](1).value()[0]}}),tu(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");ny.prototype[e]=function(){return this.__filtered__?new ny(this):this[n](1)}}),ny.prototype.compact=function(){return this.filter(sU)},ny.prototype.find=function(e){return this.filter(e).head()},ny.prototype.findLast=function(e){return this.reverse().find(e)},ny.prototype.invokeMap=rh(function(e,t){return"function"==typeof e?new ny(this):this.map(function(n){return n2(n,e,t)})}),ny.prototype.reject=function(e){return this.filter(oT(ic(e)))},ny.prototype.slice=function(e,t){e=o5(e);var n=this;return n.__filtered__&&(e>0||t<0)?new ny(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(t=o5(t))<0?n.dropRight(-t):n.take(t-e)),n)},ny.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ny.prototype.toArray=function(){return this.take(0xffffffff)},nQ(ny.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=np[i?"take"+("last"==t?"Right":""):t],s=i||/^find/.test(t);o&&(np.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof ny,u=a[0],c=l||oB(t),h=function(e){var t=o.apply(np,tg([e],a));return i&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,f=!!this.__actions__.length,p=s&&!d,g=l&&!f;if(!s&&c){t=g?t:new ny(this);var m=e.apply(t,a);return m.__actions__.push({func:oi,args:[h],thisArg:r}),new nv(m,d)}return p&&g?e.apply(this,a):(m=this.thru(h),p?i?m.value()[0]:m.value():m)})}),tu(["pop","push","shift","sort","splice","unshift"],function(e){var t=eE[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);np.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(oB(i)?i:[],e)}return this[n](function(n){return t.apply(oB(n)?n:[],e)})}}),nQ(ny.prototype,function(e,t){var n=np[t];if(n){var r=n.name+"";eM.call(no,r)||(no[r]=[]),no[r].push({name:t,func:n})}}),no[rZ(r,2).name]=[{name:"wrapper",func:r}],ny.prototype.clone=function(){var e=new ny(this.__wrapped__);return e.__actions__=rU(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=rU(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=rU(this.__views__),e},ny.prototype.reverse=function(){if(this.__filtered__){var e=new ny(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},ny.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=oB(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=t3(t,e+s);break;case"takeRight":e=t2(e,t-s)}}return{start:e,end:t}}(0,i,this.__views__),s=o.start,a=o.end,l=a-s,u=r?a:s-1,c=this.__iteratees__,h=c.length,d=0,f=t3(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return rC(e,this.__actions__);var p=[];e:for(;l--&&d<f;){for(var g=-1,m=e[u+=t];++g<h;){var v=c[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w)if(1==b)continue e;else break e}p[d++]=m}return p},np.prototype.at=oo,np.prototype.chain=function(){return or(this)},np.prototype.commit=function(){return new nv(this.value(),this.__chain__)},np.prototype.next=function(){this.__values__===r&&(this.__values__=o8(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}},np.prototype.plant=function(e){for(var t,n=this;n instanceof nm;){var i=iU(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},np.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof ny){var t=e;return this.__actions__.length&&(t=new ny(this)),(t=t.reverse()).__actions__.push({func:oi,args:[i1],thisArg:r}),new nv(t,this.__chain__)}return this.thru(i1)},np.prototype.toJSON=np.prototype.valueOf=np.prototype.value=function(){return rC(this.__wrapped__,this.__actions__)},np.prototype.first=np.prototype.head,e4&&(np.prototype[e4]=function(){return this}),np}();if("function"==typeof define&&"object"==typeof define.amd&&define.amd)e8._=tX,e.r,r!==tX&&e.v(tX);else e5?((e5.exports=tX)._=tX,e6._=tX):e8._=tX}).call(e.e)},492192,e=>{"use strict";var t=e.i(876761);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"},child:[]}]})(e)}function a(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"},child:[]}]})(e)}function h(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"},child:[]}]})(e)}function d(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"},child:[]}]})(e)}function f(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,112v96a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V112A16,16,0,0,1,56,96H80a8,8,0,0,1,0,16H56v96H200V112H176a8,8,0,0,1,0-16h24A16,16,0,0,1,216,112ZM93.66,69.66,120,43.31V136a8,8,0,0,0,16,0V43.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,69.66Z"},child:[]}]})(e)}function p(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"},child:[]}]})(e)}function g(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},child:[]}]})(e)}function m(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"},child:[]}]})(e)}function v(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z"},child:[]}]})(e)}function y(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"},child:[]}]})(e)}function b(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM51.31,160,136,75.31,152.69,92,68,176.68ZM48,179.31,76.69,208H48Zm48,25.38L79.31,188,164,103.31,180.69,120Zm96-96L147.31,64l24-24L216,84.68Z"},child:[]}]})(e)}function w(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H136v32a8,8,0,0,1-16,0V136H88a8,8,0,0,1,0-16h32V88a8,8,0,0,1,16,0v32h32A8,8,0,0,1,176,128Z"},child:[]}]})(e)}function x(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M24,128A72.08,72.08,0,0,1,96,56H204.69L194.34,45.66a8,8,0,0,1,11.32-11.32l24,24a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L204.69,72H96a56.06,56.06,0,0,0-56,56,8,8,0,0,1-16,0Zm200-8a8,8,0,0,0-8,8,56.06,56.06,0,0,1-56,56H51.31l10.35-10.34a8,8,0,0,0-11.32-11.32l-24,24a8,8,0,0,0,0,11.32l24,24a8,8,0,0,0,11.32-11.32L51.31,200H160a72.08,72.08,0,0,0,72-72A8,8,0,0,0,224,120Z"},child:[]}]})(e)}function S(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"},child:[]}]})(e)}function k(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"},child:[]}]})(e)}function _(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"},child:[]}]})(e)}function O(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"},child:[]}]})(e)}function C(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"},child:[]}]})(e)}e.s(["PiBookmarkSimple",()=>i,"PiCaretDown",()=>o,"PiChatText",()=>s,"PiCheck",()=>l,"PiCheckCircle",()=>a,"PiCircle",()=>u,"PiCopy",()=>c,"PiDotsThreeVertical",()=>h,"PiDownloadSimple",()=>d,"PiExport",()=>f,"PiImage",()=>p,"PiInfo",()=>g,"PiInfoFill",()=>n,"PiMoon",()=>m,"PiNotePencil",()=>v,"PiPencil",()=>b,"PiPencilSimple",()=>y,"PiPlusCircle",()=>w,"PiRepeat",()=>x,"PiSun",()=>S,"PiTable",()=>k,"PiTrashFill",()=>r,"PiTrashSimple",()=>_,"PiWarning",()=>O,"PiX",()=>C])},780232,e=>{"use strict";e.i(139507);var t=e.i(600943);e.s(["default",0,function(e){let{controlled:n,default:r,name:i,state:o="value"}=e,{current:s}=t.useRef(void 0!==n),[a,l]=t.useState(r),u=t.useCallback(e=>{s||l(e)},[]);return[s?n:a,u]}],780232)},987535,e=>{"use strict";var t=e.i(11507),n=e.i(222942);function r(e){return(0,n.default)("PrivateSwitchBase",e)}(0,t.default)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]),e.s(["getSwitchBaseUtilityClass",()=>r])},45721,e=>{"use strict";var t=e.i(600943),n=e.i(295456),r=e.i(663888),i=e.i(28469),o=e.i(721431),s=e.i(780232),a=e.i(431001),l=e.i(837499),u=e.i(987535),c=e.i(707706),h=e.i(991047);let d=(0,o.styled)(l.default,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),f=(0,o.styled)("input",{name:"MuiSwitchBase",shouldForwardProp:i.default})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),p=t.forwardRef(function(e,t){let{autoFocus:i,checked:o,checkedIcon:l,defaultChecked:p,disabled:g,disableFocusRipple:m=!1,edge:v=!1,icon:y,id:b,inputProps:w,inputRef:x,name:S,onBlur:k,onChange:_,onFocus:O,readOnly:C,required:E=!1,tabIndex:T,type:P,value:A,slots:R={},slotProps:M={},...I}=e,[D,L]=(0,s.default)({controlled:o,default:!!p,name:"SwitchBase",state:"checked"}),N=(0,a.default)(),B=g;N&&void 0===B&&(B=N.disabled);let F="checkbox"===P||"radio"===P,j={...e,checked:D,disabled:B,disableFocusRipple:m,edge:v},U=(e=>{let{classes:t,checked:i,disabled:o,edge:s}=e,a={root:["root",i&&"checked",o&&"disabled",s&&`edge${(0,r.default)(s)}`],input:["input"]};return(0,n.default)(a,u.getSwitchBaseUtilityClass,t)})(j),q={slots:R,slotProps:{input:w,...M}},[W,z]=(0,c.default)("root",{ref:t,elementType:d,className:U.root,shouldForwardComponentProp:!0,externalForwardedProps:{...q,component:"span",...I},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O&&O(t),N&&N.onFocus&&N.onFocus(t)},onBlur:t=>{e.onBlur?.(t),k&&k(t),N&&N.onBlur&&N.onBlur(t)}}),ownerState:j,additionalProps:{centerRipple:!0,focusRipple:!m,disabled:B,role:void 0,tabIndex:null}}),[V,H]=(0,c.default)("input",{ref:x,elementType:f,className:U.input,externalForwardedProps:q,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented||C)return;let t=e.target.checked;L(t),_&&_(e,t)})(t)}}),ownerState:j,additionalProps:{autoFocus:i,checked:o,defaultChecked:p,disabled:B,id:F?b:void 0,name:S,readOnly:C,required:E,tabIndex:T,type:P,..."checkbox"===P&&void 0===A?{}:{value:A}}});return(0,h.jsxs)(W,{...z,children:[(0,h.jsx)(V,{...H}),D?l:y]})});e.s(["default",0,p])},900854,e=>{"use strict";var t=e.i(7284);function n(e,n){if(!e)return n;function r(e,t){let n={};return Object.keys(t).forEach(r=>{var i;let o;i=t[r],o=r.charCodeAt(2),"o"===r[0]&&"n"===r[1]&&o>=65&&o<=90&&"function"==typeof i&&"function"==typeof e[r]&&(n[r]=(...n)=>{e[r](...n),t[r](...n)})}),n}if("function"==typeof e||"function"==typeof n)return i=>{let o="function"==typeof n?n(i):n,s="function"==typeof e?e({...i,...o}):e,a=(0,t.default)(i?.className,o?.className,s?.className),l=r(s,o);return{...o,...s,...l,...!!a&&{className:a},...o?.style&&s?.style&&{style:{...o.style,...s.style}},...o?.sx&&s?.sx&&{sx:[...Array.isArray(o.sx)?o.sx:[o.sx],...Array.isArray(s.sx)?s.sx:[s.sx]]}}};let i=r(e,n),o=(0,t.default)(n?.className,e?.className);return{...n,...e,...i,...!!o&&{className:o},...n?.style&&e?.style&&{style:{...n.style,...e.style}},...n?.sx&&e?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}e.s(["mergeSlotProps",()=>n],900854)},208320,e=>{"use strict";let t=e.i(466040).default;e.s(["default",0,t])},942711,e=>{"use strict";var t=e.i(600943),n=e.i(991047);let r=t.createContext();e.s(["default",0,function({value:e,...t}){return(0,n.jsx)(r.Provider,{value:e??!0,...t})},"useRtl",0,()=>t.useContext(r)??!1])},101651,e=>{"use strict";var t=e.i(593152),n=e.i(213063),r=e.i(682183),i=e.i(687782);e.s(["default",0,function(e){let{elementType:o,externalSlotProps:s,ownerState:a,skipResolvingSlotProps:l=!1,...u}=e,c=l?{}:(0,i.default)(s,a),{props:h,internalRef:d}=(0,r.default)({...u,externalSlotProps:c}),f=(0,t.default)(d,c?.ref,e.additionalProps?.ref);return(0,n.default)(o,{...h,ref:f},a)}])},85155,e=>{"use strict";let t=e.i(600943).createContext({});e.s(["default",0,t])},86280,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(721431),o=e.i(138961),s=e.i(85155),a=e.i(11507),l=e.i(222942);function u(e){return(0,l.default)("MuiList",e)}(0,a.default)("MuiList",["root","padding","dense","subheader"]);var c=e.i(991047);let h=(0,i.styled)("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),d=t.forwardRef(function(e,i){let a=(0,o.useDefaultProps)({props:e,name:"MuiList"}),{children:l,className:d,component:f="ul",dense:p=!1,disablePadding:g=!1,subheader:m,...v}=a,y=t.useMemo(()=>({dense:p}),[p]),b={...a,component:f,dense:p,disablePadding:g},w=(e=>{let{classes:t,disablePadding:n,dense:i,subheader:o}=e;return(0,r.default)({root:["root",!n&&"padding",i&&"dense",o&&"subheader"]},u,t)})(b);return(0,c.jsx)(s.default.Provider,{value:y,children:(0,c.jsxs)(h,{as:f,className:(0,n.default)(w.root,d),ref:i,ownerState:b,...v,children:[m,l]})})});e.s(["default",0,d],86280)},32945,e=>{"use strict";let t=e.i(603200).default;e.s(["default",0,t])},281690,e=>{"use strict";let t=e.i(857482).default;e.s(["default",0,t])},617533,920682,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(208320),r=e.i(86280),i=e.i(634402),o=e.i(32945),s=e.i(987074),a=e.i(957770),l=e.i(281690);e.s(["ownerWindow",()=>l.default],920682);var l=l,u=e.i(991047);function c(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function h(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function d(e,t){if(void 0===t)return!0;let n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join("")))}function f(e,t,n,r,i,o){let s=!1,a=i(e,t,!!t&&n);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}let t=!r&&(a.disabled||"true"===a.getAttribute("aria-disabled"));if(a.hasAttribute("tabindex")&&d(a,o)&&!t)return a.focus(),!0;a=i(e,a,n)}return!1}let p=t.forwardRef(function(e,p){let{actions:g,autoFocus:m=!1,autoFocusItem:v=!1,children:y,className:b,disabledItemsFocusable:w=!1,disableListWrap:x=!1,onKeyDown:S,variant:k="selectedMenu",..._}=e,O=t.useRef(null),C=t.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});(0,a.default)(()=>{m&&O.current.focus()},[m]),t.useImperativeHandle(g,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!O.current.style.width;if(e.clientHeight<O.current.clientHeight&&n){let n=`${(0,o.default)((0,l.default)(e))}px`;O.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,O.current.style.width=`calc(100% + ${n})`}return O.current}}),[]);let E=(0,s.default)(O,p),T=-1;t.Children.forEach(y,(e,n)=>{if(!t.isValidElement(e)){T===n&&(T+=1)>=y.length&&(T=-1);return}e.props.disabled||("selectedMenu"===k&&e.props.selected?T=n:-1===T&&(T=n)),T===n&&(e.props.disabled||e.props.muiSkipListHighlight||e.type.muiSkipListHighlight)&&(T+=1)>=y.length&&(T=-1)});let P=t.Children.map(y,(e,n)=>{if(n===T){let n={};return v&&(n.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===k&&(n.tabIndex=0),t.cloneElement(e,n)}return e});return(0,u.jsx)(r.default,{role:"menu",ref:E,className:b,onKeyDown:e=>{let t=O.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey){S&&S(e);return}let o=(0,i.default)((0,n.default)(t));if("ArrowDown"===r)e.preventDefault(),f(t,o,x,w,c);else if("ArrowUp"===r)e.preventDefault(),f(t,o,x,w,h);else if("Home"===r)e.preventDefault(),f(t,null,x,w,c);else if("End"===r)e.preventDefault(),f(t,null,x,w,h);else if(1===r.length){let n=C.current,i=r.toLowerCase(),s=performance.now();n.keys.length>0&&(s-n.lastTime>500?(n.keys=[],n.repeating=!0,n.previousKeyMatched=!0):n.repeating&&i!==n.keys[0]&&(n.repeating=!1)),n.lastTime=s,n.keys.push(i);let a=o&&!n.repeating&&d(o,n);n.previousKeyMatched&&(a||f(t,o,!1,w,c,n))?e.preventDefault():n.previousKeyMatched=!1}S&&S(e)},tabIndex:m?0:-1,..._,children:P})});e.s(["default",0,p],617533)},554828,e=>{"use strict";let t=e.i(452078).default;e.s(["default",0,t])},419607,e=>{"use strict";var t=e.i(11507),n=e.i(222942);function r(e){return(0,n.default)("MuiPopover",e)}(0,t.default)("MuiPopover",["root","paper"]),e.s(["getPopoverUtilityClass",()=>r])},760437,e=>{"use strict";var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(509912),o=e.i(721431),s=e.i(138961),a=e.i(554828),l=e.i(208320),u=e.i(281690),c=e.i(618378),h=e.i(622743),d=e.i(718533),f=e.i(419607),p=e.i(707706),g=e.i(900854),m=e.i(991047);function v(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function y(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function b(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function w(e){return"function"==typeof e?e():e}let x=(0,o.styled)(h.default,{name:"MuiPopover",slot:"Root"})({}),S=(0,o.styled)(d.default,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),k=t.forwardRef(function(e,o){let h=(0,s.useDefaultProps)({props:e,name:"MuiPopover"}),{action:d,anchorEl:k,anchorOrigin:_={vertical:"top",horizontal:"left"},anchorPosition:O,anchorReference:C="anchorEl",children:E,className:T,container:P,elevation:A=8,marginThreshold:R=16,open:M,PaperProps:I={},slots:D={},slotProps:L={},transformOrigin:N={vertical:"top",horizontal:"left"},TransitionComponent:B,transitionDuration:F="auto",TransitionProps:j={},disableScrollLock:U=!1,...q}=h,W=t.useRef(),z={...h,anchorOrigin:_,anchorReference:C,elevation:A,marginThreshold:R,transformOrigin:N,TransitionComponent:B,transitionDuration:F,TransitionProps:j},V=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"],paper:["paper"]},f.getPopoverUtilityClass,t)})(z),H=t.useCallback(()=>{if("anchorPosition"===C)return O;let e=w(k),t=(e&&1===e.nodeType?e:(0,l.default)(W.current).body).getBoundingClientRect();return{top:t.top+v(t,_.vertical),left:t.left+y(t,_.horizontal)}},[k,_.horizontal,_.vertical,O,C]),Q=t.useCallback(e=>({vertical:v(e,N.vertical),horizontal:y(e,N.horizontal)}),[N.horizontal,N.vertical]),$=t.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=Q(t);if("none"===C)return{top:null,left:null,transformOrigin:b(n)};let r=H(),i=r.top-n.vertical,o=r.left-n.horizontal,s=i+t.height,a=o+t.width,l=(0,u.default)(w(k)),c=l.innerHeight-R,h=l.innerWidth-R;if(null!==R&&i<R){let e=i-R;i-=e,n.vertical+=e}else if(null!==R&&s>c){let e=s-c;i-=e,n.vertical+=e}if(null!==R&&o<R){let e=o-R;o-=e,n.horizontal+=e}else if(a>h){let e=a-h;o-=e,n.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:b(n)}},[k,C,H,Q,R]),[K,X]=t.useState(M),G=t.useCallback(()=>{let e=W.current;if(!e)return;let t=$(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,X(!0)},[$]);t.useEffect(()=>(U&&window.addEventListener("scroll",G),()=>window.removeEventListener("scroll",G)),[k,U,G]),t.useEffect(()=>{M&&G()}),t.useImperativeHandle(d,()=>M?{updatePosition:()=>{G()}}:null,[M,G]),t.useEffect(()=>{if(!M)return;let e=(0,a.default)(()=>{G()}),t=(0,u.default)(w(k));return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[k,M,G]);let Z=F,Y={slots:{transition:B,...D},slotProps:{transition:j,paper:I,...L}},[J,ee]=(0,p.default)("transition",{elementType:c.default,externalForwardedProps:Y,ownerState:z,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),G()},onExited:t=>{e.onExited?.(t),X(!1)}}),additionalProps:{appear:!0,in:M}});"auto"!==F||J.muiSupportAuto||(Z=void 0);let et=P||(k?(0,l.default)(w(k)).body:void 0),[en,{slots:er,slotProps:ei,...eo}]=(0,p.default)("root",{ref:o,elementType:x,externalForwardedProps:{...Y,...q},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:D.backdrop},slotProps:{backdrop:(0,g.mergeSlotProps)("function"==typeof L.backdrop?L.backdrop(z):L.backdrop,{invisible:!0})},container:et,open:M},ownerState:z,className:(0,n.default)(V.root,T)}),[es,ea]=(0,p.default)("paper",{ref:W,className:V.paper,elementType:S,externalForwardedProps:Y,shouldForwardComponentProp:!0,additionalProps:{elevation:A,style:K?void 0:{opacity:0}},ownerState:z});return(0,m.jsx)(en,{...eo,...!(0,i.default)(en)&&{slots:er,slotProps:ei,disableScrollLock:U},children:(0,m.jsx)(J,{...ee,timeout:Z,children:(0,m.jsx)(es,{...ea,children:E})})})});e.s(["PopoverPaper",0,S,"default",0,k])},765165,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(942711),o=e.i(101651),s=e.i(617533),a=e.i(760437),l=e.i(28469),u=e.i(721431),c=e.i(138961),h=e.i(11507),d=e.i(222942);function f(e){return(0,d.default)("MuiMenu",e)}(0,h.default)("MuiMenu",["root","paper","list"]);var p=e.i(707706),g=e.i(991047);let m={vertical:"top",horizontal:"right"},v={vertical:"top",horizontal:"left"},y=(0,u.styled)(a.default,{shouldForwardProp:e=>(0,l.default)(e)||"classes"===e,name:"MuiMenu",slot:"Root"})({}),b=(0,u.styled)(a.PopoverPaper,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),w=(0,u.styled)(s.default,{name:"MuiMenu",slot:"List"})({outline:0}),x=t.forwardRef(function(e,s){let a=(0,c.useDefaultProps)({props:e,name:"MuiMenu"}),{autoFocus:l=!0,children:u,className:h,disableAutoFocusItem:d=!1,MenuListProps:x={},onClose:S,open:k,PaperProps:_={},PopoverClasses:O,transitionDuration:C="auto",TransitionProps:{onEntering:E,...T}={},variant:P="selectedMenu",slots:A={},slotProps:R={},...M}=a,I=(0,i.useRtl)(),D={...a,autoFocus:l,disableAutoFocusItem:d,MenuListProps:x,onEntering:E,PaperProps:_,transitionDuration:C,TransitionProps:T,variant:P},L=(e=>{let{classes:t}=e;return(0,r.default)({root:["root"],paper:["paper"],list:["list"]},f,t)})(D),N=l&&!d&&k,B=t.useRef(null),F=-1;t.Children.map(u,(e,n)=>{t.isValidElement(e)&&(e.props.disabled||("selectedMenu"===P&&e.props.selected?F=n:-1===F&&(F=n)))});let j={slots:A,slotProps:{list:x,transition:T,paper:_,...R}},U=(0,o.default)({elementType:A.root,externalSlotProps:R.root,ownerState:D,className:[L.root,h]}),[q,W]=(0,p.default)("paper",{className:L.paper,elementType:b,externalForwardedProps:j,shouldForwardComponentProp:!0,ownerState:D}),[z,V]=(0,p.default)("list",{className:(0,n.default)(L.list,x.className),elementType:w,shouldForwardComponentProp:!0,externalForwardedProps:j,getSlotProps:e=>({...e,onKeyDown:t=>{"Tab"===t.key&&(t.preventDefault(),S&&S(t,"tabKeyDown")),e.onKeyDown?.(t)}}),ownerState:D}),H="function"==typeof j.slotProps.transition?j.slotProps.transition(D):j.slotProps.transition;return(0,g.jsx)(y,{onClose:S,anchorOrigin:{vertical:"bottom",horizontal:I?"right":"left"},transformOrigin:I?m:v,slots:{root:A.root,paper:q,backdrop:A.backdrop,...A.transition&&{transition:A.transition}},slotProps:{root:U,paper:W,backdrop:"function"==typeof R.backdrop?R.backdrop(D):R.backdrop,transition:{...H,onEntering:(...e)=>{((e,t)=>{B.current&&B.current.adjustStyleForScrollbar(e,{direction:I?"rtl":"ltr"}),E&&E(e,t)})(...e),H?.onEntering?.(...e)}}},open:k,ref:s,transitionDuration:C,ownerState:D,...M,classes:O,children:(0,g.jsx)(z,{actions:B,autoFocus:l&&(-1===F||d),autoFocusItem:N,variant:P,...V,children:u})})});e.s(["default",0,x],765165)},941666,e=>{"use strict";function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){var n=t(e).Element;return e instanceof n||e instanceof Element}function r(e){var n=t(e).HTMLElement;return e instanceof n||e instanceof HTMLElement}function i(e){if("u"<typeof ShadowRoot)return!1;var n=t(e).ShadowRoot;return e instanceof n||e instanceof ShadowRoot}var o,s,a,l,u,c=Math.max,h=Math.min,d=Math.round;function f(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function p(){return!/^((?!chrome|android).)*safari/i.test(f())}function g(e,i,o){void 0===i&&(i=!1),void 0===o&&(o=!1);var s=e.getBoundingClientRect(),a=1,l=1;i&&r(e)&&(a=e.offsetWidth>0&&d(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&d(s.height)/e.offsetHeight||1);var u=(n(e)?t(e):window).visualViewport,c=!p()&&o,h=(s.left+(c&&u?u.offsetLeft:0))/a,f=(s.top+(c&&u?u.offsetTop:0))/l,g=s.width/a,m=s.height/l;return{width:g,height:m,top:f,right:h+g,bottom:f+m,left:h,x:h,y:f}}function m(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function v(e){return e?(e.nodeName||"").toLowerCase():null}function y(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function b(e){return g(y(e)).left+m(e).scrollLeft}function w(e){return t(e).getComputedStyle(e)}function x(e){var t=w(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function S(e){var t=g(e),n=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function k(e){return"html"===v(e)?e:e.assignedSlot||e.parentNode||(i(e)?e.host:null)||y(e)}function _(e,n){void 0===n&&(n=[]);var i,o=function e(t){return["html","body","#document"].indexOf(v(t))>=0?t.ownerDocument.body:r(t)&&x(t)?t:e(k(t))}(e),s=o===(null==(i=e.ownerDocument)?void 0:i.body),a=t(o),l=s?[a].concat(a.visualViewport||[],x(o)?o:[]):o,u=n.concat(l);return s?u:u.concat(_(k(l)))}function O(e){return r(e)&&"fixed"!==w(e).position?e.offsetParent:null}function C(e){for(var n=t(e),o=O(e);o&&["table","td","th"].indexOf(v(o))>=0&&"static"===w(o).position;)o=O(o);return o&&("html"===v(o)||"body"===v(o)&&"static"===w(o).position)?n:o||function(e){var t=/firefox/i.test(f());if(/Trident/i.test(f())&&r(e)&&"fixed"===w(e).position)return null;var n=k(e);for(i(n)&&(n=n.host);r(n)&&0>["html","body"].indexOf(v(n));){var o=w(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||n}var E="bottom",T="right",P="left",A="auto",R=["top",E,T,P],M="start",I="viewport",D="popper",L=R.reduce(function(e,t){return e.concat([t+"-"+M,t+"-end"])},[]),N=[].concat(R,[A]).reduce(function(e,t){return e.concat([t,t+"-"+M,t+"-end"])},[]),B=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function F(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&i(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function U(e,r,i){var o,s,a,l,u,h,d,f,v,x;return r===I?j(function(e,n){var r=t(e),i=y(e),o=r.visualViewport,s=i.clientWidth,a=i.clientHeight,l=0,u=0;if(o){s=o.width,a=o.height;var c=p();(c||!c&&"fixed"===n)&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:a,x:l+b(e),y:u}}(e,i)):n(r)?((o=g(r,!1,"fixed"===i)).top=o.top+r.clientTop,o.left=o.left+r.clientLeft,o.bottom=o.top+r.clientHeight,o.right=o.left+r.clientWidth,o.width=r.clientWidth,o.height=r.clientHeight,o.x=o.left,o.y=o.top,o):j((s=y(e),l=y(s),u=m(s),h=null==(a=s.ownerDocument)?void 0:a.body,d=c(l.scrollWidth,l.clientWidth,h?h.scrollWidth:0,h?h.clientWidth:0),f=c(l.scrollHeight,l.clientHeight,h?h.scrollHeight:0,h?h.clientHeight:0),v=-u.scrollLeft+b(s),x=-u.scrollTop,"rtl"===w(h||l).direction&&(v+=c(l.clientWidth,h?h.clientWidth:0)-d),{width:d,height:f,x:v,y:x}))}function q(e){return e.split("-")[0]}function W(e){return e.split("-")[1]}function z(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function V(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?q(i):null,s=i?W(i):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case"top":t={x:a,y:n.y-r.height};break;case E:t={x:a,y:n.y+n.height};break;case T:t={x:n.x+n.width,y:l};break;case P:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?z(o):null;if(null!=u){var c="y"===u?"height":"width";switch(s){case M:t[u]=t[u]-(n[c]/2-r[c]/2);break;case"end":t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function H(){return{top:0,right:0,bottom:0,left:0}}function Q(e){return Object.assign({},H(),e)}function $(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}function K(e,t){void 0===t&&(t={});var i,o,s,a,l,u,d,f,p=t,m=p.placement,b=void 0===m?e.placement:m,x=p.strategy,S=void 0===x?e.strategy:x,O=p.boundary,P=p.rootBoundary,A=p.elementContext,M=void 0===A?D:A,L=p.altBoundary,N=p.padding,B=void 0===N?0:N,q=Q("number"!=typeof B?B:$(B,R)),W=e.rects.popper,z=e.elements[void 0!==L&&L?M===D?"reference":D:M],H=(i=n(z)?z:z.contextElement||y(e.elements.popper),o=void 0===O?"clippingParents":O,s=void 0===P?I:P,d=(u=[].concat("clippingParents"===o?(a=_(k(i)),!n(l=["absolute","fixed"].indexOf(w(i).position)>=0&&r(i)?C(i):i)?[]:a.filter(function(e){return n(e)&&F(e,l)&&"body"!==v(e)})):[].concat(o),[s]))[0],(f=u.reduce(function(e,t){var n=U(i,t,S);return e.top=c(n.top,e.top),e.right=h(n.right,e.right),e.bottom=h(n.bottom,e.bottom),e.left=c(n.left,e.left),e},U(i,d,S))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f),K=g(e.elements.reference),X=V({reference:K,element:W,strategy:"absolute",placement:b}),G=j(Object.assign({},W,X)),Z=M===D?G:K,Y={top:H.top-Z.top+q.top,bottom:Z.bottom-H.bottom+q.bottom,left:H.left-Z.left+q.left,right:Z.right-H.right+q.right},J=e.modifiersData.offset;if(M===D&&J){var ee=J[b];Object.keys(Y).forEach(function(e){var t=[T,E].indexOf(e)>=0?1:-1,n=["top",E].indexOf(e)>=0?"y":"x";Y[e]+=ee[n]*t})}return Y}var X={placement:"bottom",modifiers:[],strategy:"absolute"};function G(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}var Z={passive:!0},Y={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var n,r,i,o,s,a,l,u=e.popper,c=e.popperRect,h=e.placement,f=e.variation,p=e.offsets,g=e.position,m=e.gpuAcceleration,v=e.adaptive,b=e.roundOffsets,x=e.isFixed,S=p.x,k=void 0===S?0:S,_=p.y,O=void 0===_?0:_,A="function"==typeof b?b({x:k,y:O}):{x:k,y:O};k=A.x,O=A.y;var R=p.hasOwnProperty("x"),M=p.hasOwnProperty("y"),I=P,D="top",L=window;if(v){var N=C(u),B="clientHeight",F="clientWidth";N===t(u)&&"static"!==w(N=y(u)).position&&"absolute"===g&&(B="scrollHeight",F="scrollWidth"),("top"===h||(h===P||h===T)&&"end"===f)&&(D=E,O-=(x&&N===L&&L.visualViewport?L.visualViewport.height:N[B])-c.height,O*=m?1:-1),(h===P||("top"===h||h===E)&&"end"===f)&&(I=T,k-=(x&&N===L&&L.visualViewport?L.visualViewport.width:N[F])-c.width,k*=m?1:-1)}var j=Object.assign({position:g},v&&Y),U=!0===b?(n={x:k,y:O},r=t(u),i=n.x,o=n.y,{x:d(i*(s=r.devicePixelRatio||1))/s||0,y:d(o*s)/s||0}):{x:k,y:O};return(k=U.x,O=U.y,m)?Object.assign({},j,((l={})[D]=M?"0":"",l[I]=R?"0":"",l.transform=1>=(L.devicePixelRatio||1)?"translate("+k+"px, "+O+"px)":"translate3d("+k+"px, "+O+"px, 0)",l)):Object.assign({},j,((a={})[D]=M?O+"px":"",a[I]=R?k+"px":"",a.transform="",a))}var ee={left:"right",right:"left",bottom:"top",top:"bottom"};function et(e){return e.replace(/left|right|bottom|top/g,function(e){return ee[e]})}var en={start:"end",end:"start"};function er(e){return e.replace(/start|end/g,function(e){return en[e]})}function ei(e,t,n){return c(e,h(t,n))}function eo(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function es(e){return["top",T,E,P].some(function(t){return e[t]>=0})}var ea=(a=void 0===(s=(o={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,i=e.options,o=i.scroll,s=void 0===o||o,a=i.resize,l=void 0===a||a,u=t(n.elements.popper),c=[].concat(n.scrollParents.reference,n.scrollParents.popper);return s&&c.forEach(function(e){e.addEventListener("scroll",r.update,Z)}),l&&u.addEventListener("resize",r.update,Z),function(){s&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Z)}),l&&u.removeEventListener("resize",r.update,Z)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=V({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=n.adaptive,o=n.roundOffsets,s=void 0===o||o,a={placement:q(t.placement),variation:W(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===r||r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},a,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===i||i,roundOffsets:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},a,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:s})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];r(o)&&v(o)&&(Object.assign(o.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],o=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});r(i)&&v(i)&&(Object.assign(i.style,s),Object.keys(o).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=N.reduce(function(e,n){var r,i,s,a,l,u;return e[n]=(r=t.rects,s=[P,"top"].indexOf(i=q(n))>=0?-1:1,l=(a="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0],u=a[1],l=l||0,u=(u||0)*s,[P,T].indexOf(i)>=0?{x:u,y:l}:{x:l,y:u}),e},{}),a=s[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,h=n.rootBoundary,d=n.altBoundary,f=n.flipVariations,p=void 0===f||f,g=n.allowedAutoPlacements,m=t.options.placement,v=q(m)===m,y=l||(v||!p?[et(m)]:function(e){if(q(e)===A)return[];var t=et(e);return[er(e),t,er(t)]}(m)),b=[m].concat(y).reduce(function(e,n){var r,i,o,s,a,l,d,f,m,v,y,b;return e.concat(q(n)===A?(i=(r={placement:n,boundary:c,rootBoundary:h,padding:u,flipVariations:p,allowedAutoPlacements:g}).placement,o=r.boundary,s=r.rootBoundary,a=r.padding,l=r.flipVariations,f=void 0===(d=r.allowedAutoPlacements)?N:d,0===(y=(v=(m=W(i))?l?L:L.filter(function(e){return W(e)===m}):R).filter(function(e){return f.indexOf(e)>=0})).length&&(y=v),Object.keys(b=y.reduce(function(e,n){return e[n]=K(t,{placement:n,boundary:o,rootBoundary:s,padding:a})[q(n)],e},{})).sort(function(e,t){return b[e]-b[t]})):n)},[]),w=t.rects.reference,x=t.rects.popper,S=new Map,k=!0,_=b[0],O=0;O<b.length;O++){var C=b[O],I=q(C),D=W(C)===M,B=["top",E].indexOf(I)>=0,F=B?"width":"height",j=K(t,{placement:C,boundary:c,rootBoundary:h,altBoundary:d,padding:u}),U=B?D?T:P:D?E:"top";w[F]>x[F]&&(U=et(U));var z=et(U),V=[];if(o&&V.push(j[I]<=0),a&&V.push(j[U]<=0,j[z]<=0),V.every(function(e){return e})){_=C,k=!1;break}S.set(C,V)}if(k)for(var H=p?3:1,Q=function(e){var t=b.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return _=t,"break"},$=H;$>0&&"break"!==Q($);$--);t.placement!==_&&(t.modifiersData[r]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=n.altAxis,s=n.boundary,a=n.rootBoundary,l=n.altBoundary,u=n.padding,d=n.tether,f=void 0===d||d,p=n.tetherOffset,g=void 0===p?0:p,m=K(t,{boundary:s,rootBoundary:a,padding:u,altBoundary:l}),v=q(t.placement),y=W(t.placement),b=!y,w=z(v),x="x"===w?"y":"x",k=t.modifiersData.popperOffsets,_=t.rects.reference,O=t.rects.popper,A="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,R="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(k){if(void 0===i||i){var L,N="y"===w?"top":P,B="y"===w?E:T,F="y"===w?"height":"width",j=k[w],U=j+m[N],V=j-m[B],Q=f?-O[F]/2:0,$=y===M?_[F]:O[F],X=y===M?-O[F]:-_[F],G=t.elements.arrow,Z=f&&G?S(G):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:H(),J=Y[N],ee=Y[B],et=ei(0,_[F],Z[F]),en=b?_[F]/2-Q-et-J-R.mainAxis:$-et-J-R.mainAxis,er=b?-_[F]/2+Q+et+ee+R.mainAxis:X+et+ee+R.mainAxis,eo=t.elements.arrow&&C(t.elements.arrow),es=eo?"y"===w?eo.clientTop||0:eo.clientLeft||0:0,ea=null!=(L=null==I?void 0:I[w])?L:0,el=ei(f?h(U,j+en-ea-es):U,j,f?c(V,j+er-ea):V);k[w]=el,D[w]=el-j}if(void 0!==o&&o){var eu,ec,eh="x"===w?"top":P,ed="x"===w?E:T,ef=k[x],ep="y"===x?"height":"width",eg=ef+m[eh],em=ef-m[ed],ev=-1!==["top",P].indexOf(v),ey=null!=(ec=null==I?void 0:I[x])?ec:0,eb=ev?eg:ef-_[ep]-O[ep]-ey+R.altAxis,ew=ev?ef+_[ep]+O[ep]-ey-R.altAxis:em,ex=f&&ev?(eu=ei(eb,ef,ew))>ew?ew:eu:ei(f?eb:eg,ef,f?ew:em);k[x]=ex,D[x]=ex-ef}t.modifiersData[r]=D}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=q(n.placement),l=z(a),u=[P,T].indexOf(a)>=0?"height":"width";if(o&&s){var c,h=(c=i.padding,Q("number"!=typeof(c="function"==typeof c?c(Object.assign({},n.rects,{placement:n.placement})):c)?c:$(c,R))),d=S(o),f="y"===l?"top":P,p="y"===l?E:T,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=C(o),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=h[f],w=y-d[u]-h[p],x=y/2-d[u]/2+(g/2-m/2),k=ei(b,x,w);n.modifiersData[r]=((t={})[l]=k,t.centerOffset=k-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null==r||("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&F(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=K(t,{elementContext:"reference"}),a=K(t,{altBoundary:!0}),l=eo(s,r),u=eo(a,i,o),c=es(l),h=es(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":h})}}]}).defaultModifiers)?[]:s,u=void 0===(l=o.defaultOptions)?X:l,function(e,i,o){void 0===o&&(o=u);var s,l,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},X,u),modifiersData:{},elements:{reference:e,popper:i},attributes:{},styles:{}},h=[],f=!1,p={state:c,setOptions:function(t){var r,o,s,l,d,f,g="function"==typeof t?t(c.options):t;w(),c.options=Object.assign({},u,c.options,g),c.scrollParents={reference:n(e)?_(e):e.contextElement?_(e.contextElement):[],popper:_(i)};var m=(o=Object.keys(r=[].concat(a,c.options.modifiers).reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{})).map(function(e){return r[e]}),s=new Map,l=new Set,d=[],o.forEach(function(e){s.set(e.name,e)}),o.forEach(function(e){l.has(e.name)||function e(t){l.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!l.has(t)){var n=s.get(t);n&&e(n)}}),d.push(t)}(e)}),f=d,B.reduce(function(e,t){return e.concat(f.filter(function(e){return e.phase===t}))},[]));return c.orderedModifiers=m.filter(function(e){return e.enabled}),c.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=e.effect;if("function"==typeof r){var i=r({state:c,name:t,instance:p,options:void 0===n?{}:n});h.push(i||function(){})}}),p.update()},forceUpdate:function(){if(!f){var e=c.elements,n=e.reference,i=e.popper;if(G(n,i)){c.rects={reference:(o=C(i),s="fixed"===c.options.strategy,a=r(o),w=r(o)&&(u=d((l=o.getBoundingClientRect()).width)/o.offsetWidth||1,h=d(l.height)/o.offsetHeight||1,1!==u||1!==h),k=y(o),_=g(n,w,s),O={scrollLeft:0,scrollTop:0},E={x:0,y:0},(a||!a&&!s)&&(("body"!==v(o)||x(k))&&(O=function(e){return e!==t(e)&&r(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:m(e)}(o)),r(o)?(E=g(o,!0),E.x+=o.clientLeft,E.y+=o.clientTop):k&&(E.x=b(k))),{x:_.left+O.scrollLeft-E.x,y:_.top+O.scrollTop-E.y,width:_.width,height:_.height}),popper:S(i)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(e){return c.modifiersData[e.name]=Object.assign({},e.data)});for(var o,s,a,l,u,h,w,k,_,O,E,T=0;T<c.orderedModifiers.length;T++){if(!0===c.reset){c.reset=!1,T=-1;continue}var P=c.orderedModifiers[T],A=P.fn,R=P.options,M=void 0===R?{}:R,I=P.name;"function"==typeof A&&(c=A({state:c,options:M,name:I,instance:p})||c)}}}},update:(s=function(){return new Promise(function(e){p.forceUpdate(),e(c)})},function(){return l||(l=new Promise(function(e){Promise.resolve().then(function(){l=void 0,e(s())})})),l}),destroy:function(){w(),f=!0}};if(!G(e,i))return p;function w(){h.forEach(function(e){return e()}),h=[]}return p.setOptions(o).then(function(e){!f&&o.onFirstUpdate&&o.onFirstUpdate(e)}),p});e.s(["createPopper",()=>ea],941666)},392179,e=>{"use strict";e.i(139507);var t=e.i(942711),n=e.i(600943),r=e.i(466040),i=e.i(514934),o=e.i(593152),s=e.i(941666),a=e.i(295456),l=e.i(101651),u=e.i(16720),c=e.i(11507),h=e.i(222942);function d(e){return(0,h.default)("MuiPopper",e)}(0,c.default)("MuiPopper",["root"]);var f=e.i(991047);function p(e){return"function"==typeof e?e():e}let g={},m=n.forwardRef(function(e,t){let{anchorEl:r,children:u,direction:c,disablePortal:h,modifiers:g,open:m,placement:v,popperOptions:y,popperRef:b,slotProps:w={},slots:x={},TransitionProps:S,ownerState:k,..._}=e,O=n.useRef(null),C=(0,o.default)(O,t),E=n.useRef(null),T=(0,o.default)(E,b),P=n.useRef(T);(0,i.default)(()=>{P.current=T},[T]),n.useImperativeHandle(b,()=>E.current,[]);let A=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(v,c),[R,M]=n.useState(A),[I,D]=n.useState(p(r));n.useEffect(()=>{E.current&&E.current.forceUpdate()}),n.useEffect(()=>{r&&D(p(r))},[r]),(0,i.default)(()=>{if(!I||!m)return;let e=[{name:"preventOverflow",options:{altBoundary:h}},{name:"flip",options:{altBoundary:h}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:e})=>{M(e.placement)}}];null!=g&&(e=e.concat(g)),y&&null!=y.modifiers&&(e=e.concat(y.modifiers));let t=(0,s.createPopper)(I,O.current,{placement:A,...y,modifiers:e});return P.current(t),()=>{t.destroy(),P.current(null)}},[I,h,g,m,y,A]);let L={placement:R};null!==S&&(L.TransitionProps=S);let N=(e=>{let{classes:t}=e;return(0,a.default)({root:["root"]},d,t)})(e),B=x.root??"div",F=(0,l.default)({elementType:B,externalSlotProps:w.root,externalForwardedProps:_,additionalProps:{role:"tooltip",ref:C},ownerState:e,className:N.root});return(0,f.jsx)(B,{...F,children:"function"==typeof u?u(L):u})}),v=n.forwardRef(function(e,t){let i,{anchorEl:o,children:s,container:a,direction:l="ltr",disablePortal:c=!1,keepMounted:h=!1,modifiers:d,open:v,placement:y="bottom",popperOptions:b=g,popperRef:w,style:x,transition:S=!1,slotProps:k={},slots:_={},...O}=e,[C,E]=n.useState(!0);if(!h&&!v&&(!S||C))return null;if(a)i=a;else if(o){let e=p(o);i=e&&void 0!==e.nodeType?(0,r.default)(e).body:(0,r.default)(null).body}let T=!v&&h&&(!S||C)?"none":void 0,P=S?{in:v,onEnter:()=>{E(!1)},onExited:()=>{E(!0)}}:void 0;return(0,f.jsx)(u.default,{disablePortal:c,container:i,children:(0,f.jsx)(m,{anchorEl:o,direction:l,disablePortal:c,modifiers:d,ref:t,open:S?!C:v,placement:y,popperOptions:b,popperRef:w,slotProps:k,slots:_,...O,style:{position:"fixed",top:0,left:0,display:T,...x},TransitionProps:P,children:s})})});var y=e.i(721431),b=e.i(138961);let w=(0,y.styled)(v,{name:"MuiPopper",slot:"Root"})({}),x=n.forwardRef(function(e,n){let r=(0,t.useRtl)(),{anchorEl:i,component:o,components:s,componentsProps:a,container:l,disablePortal:u,keepMounted:c,modifiers:h,open:d,placement:p,popperOptions:g,popperRef:m,transition:v,slots:y,slotProps:x,...S}=(0,b.useDefaultProps)({props:e,name:"MuiPopper"}),k=y?.root??s?.Root,_={anchorEl:i,container:l,disablePortal:u,keepMounted:c,modifiers:h,open:d,placement:p,popperOptions:g,popperRef:m,transition:v,...S};return(0,f.jsx)(w,{as:o,direction:r?"rtl":"ltr",slots:{root:k},slotProps:x??a,..._,ref:n})});e.s(["default",0,x],392179)},691838,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(447239),i=e.i(295456),o=e.i(942711),s=e.i(754907),a=e.i(60934),l=e.i(721431),u=e.i(473287),c=e.i(842196),h=e.i(138961),d=e.i(663888),f=e.i(618378),p=e.i(392179),g=e.i(752084),m=e.i(987074),v=e.i(53246),y=e.i(780232),b=e.i(707706),w=e.i(11507),x=e.i(222942);function S(e){return(0,x.default)("MuiTooltip",e)}let k=(0,w.default)("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);var _=e.i(991047);let O=(0,l.styled)(p.default,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})((0,c.default)(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:e})=>!e.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:e})=>!e,style:{pointerEvents:"none"}},{props:({ownerState:e})=>e.arrow,style:{[`&[data-popper-placement*="bottom"] .${k.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${k.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${k.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${k.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="right"] .${k.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="right"] .${k.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!e.isRtl,style:{[`&[data-popper-placement*="left"] .${k.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:e})=>e.arrow&&!!e.isRtl,style:{[`&[data-popper-placement*="left"] .${k.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),C=(0,l.styled)("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${(0,d.default)(n.placement.split("-")[0])}`]]}})((0,c.default)(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${k.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${k.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${k.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${k.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:e})=>e.arrow,style:{position:"relative",margin:0}},{props:({ownerState:e})=>e.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Math.round(16/14*1e5)/1e5}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:e})=>!e.isRtl,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:e})=>!e.isRtl&&e.touch,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:e})=>!!e.isRtl,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:e})=>!!e.isRtl&&e.touch,style:{[`.${k.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${k.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${k.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:e})=>e.touch,style:{[`.${k.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),E=(0,l.styled)("span",{name:"MuiTooltip",slot:"Arrow"})((0,c.default)(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}))),T=!1,P=new r.Timeout,A={x:0,y:0};function R(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}let M=t.forwardRef(function(e,l){let c=(0,h.useDefaultProps)({props:e,name:"MuiTooltip"}),{arrow:w=!1,children:x,classes:k,components:M={},componentsProps:I={},describeChild:D=!1,disableFocusListener:L=!1,disableHoverListener:N=!1,disableInteractive:B=!1,disableTouchListener:F=!1,enterDelay:j=100,enterNextDelay:U=0,enterTouchDelay:q=700,followCursor:W=!1,id:z,leaveDelay:V=0,leaveTouchDelay:H=1500,onClose:Q,onOpen:$,open:K,placement:X="bottom",PopperComponent:G,PopperProps:Z={},slotProps:Y={},slots:J={},title:ee,TransitionComponent:et,TransitionProps:en,...er}=c,ei=t.isValidElement(x)?x:(0,_.jsx)("span",{children:x}),eo=(0,u.useTheme)(),es=(0,o.useRtl)(),[ea,el]=t.useState(),[eu,ec]=t.useState(null),eh=t.useRef(!1),ed=B||W,ef=(0,r.default)(),ep=(0,r.default)(),eg=(0,r.default)(),em=(0,r.default)(),[ev,ey]=(0,y.default)({controlled:K,default:!1,name:"Tooltip",state:"open"}),eb=ev,ew=(0,v.default)(z),ex=t.useRef(),eS=(0,g.default)(()=>{void 0!==ex.current&&(document.body.style.WebkitUserSelect=ex.current,ex.current=void 0),em.clear()});t.useEffect(()=>eS,[eS]);let ek=e=>{P.clear(),T=!0,ey(!0),$&&!eb&&$(e)},e_=(0,g.default)(e=>{P.start(800+V,()=>{T=!1}),ey(!1),Q&&eb&&Q(e),ef.start(eo.transitions.duration.shortest,()=>{eh.current=!1})}),eO=e=>{eh.current&&"touchstart"!==e.type||(ea&&ea.removeAttribute("title"),ep.clear(),eg.clear(),j||T&&U?ep.start(T?U:j,()=>{ek(e)}):ek(e))},eC=e=>{ep.clear(),eg.start(V,()=>{e_(e)})},[,eE]=t.useState(!1),eT=e=>{(0,s.default)(e.target)||(eE(!1),eC(e))},eP=e=>{ea||el(e.currentTarget),(0,s.default)(e.target)&&(eE(!0),eO(e))},eA=e=>{eh.current=!0;let t=ei.props;t.onTouchStart&&t.onTouchStart(e)};t.useEffect(()=>{if(eb)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&e_(e)}},[e_,eb]);let eR=(0,m.default)((0,a.default)(ei),el,l);ee||0===ee||(eb=!1);let eM=t.useRef(),eI={},eD="string"==typeof ee;D?(eI.title=eb||!eD||N?null:ee,eI["aria-describedby"]=eb?ew:null):(eI["aria-label"]=eD?ee:null,eI["aria-labelledby"]=eb&&!eD?ew:null);let eL={...eI,...er,...ei.props,className:(0,n.default)(er.className,ei.props.className),onTouchStart:eA,ref:eR,...W?{onMouseMove:e=>{let t=ei.props;t.onMouseMove&&t.onMouseMove(e),A={x:e.clientX,y:e.clientY},eM.current&&eM.current.update()}}:{}},eN={};F||(eL.onTouchStart=e=>{eA(e),eg.clear(),ef.clear(),eS(),ex.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",em.start(q,()=>{document.body.style.WebkitUserSelect=ex.current,eO(e)})},eL.onTouchEnd=e=>{ei.props.onTouchEnd&&ei.props.onTouchEnd(e),eS(),eg.start(H,()=>{e_(e)})}),!N&&(eL.onMouseOver=R(eO,eL.onMouseOver),eL.onMouseLeave=R(eC,eL.onMouseLeave),ed||(eN.onMouseOver=eO,eN.onMouseLeave=eC)),!L&&(eL.onFocus=R(eP,eL.onFocus),eL.onBlur=R(eT,eL.onBlur),ed||(eN.onFocus=eP,eN.onBlur=eT));let eB={...c,isRtl:es,arrow:w,disableInteractive:ed,placement:X,PopperComponentProp:G,touch:eh.current},eF="function"==typeof Y.popper?Y.popper(eB):Y.popper,ej=t.useMemo(()=>{let e=[{name:"arrow",enabled:!!eu,options:{element:eu,padding:4}}];return Z.popperOptions?.modifiers&&(e=e.concat(Z.popperOptions.modifiers)),eF?.popperOptions?.modifiers&&(e=e.concat(eF.popperOptions.modifiers)),{...Z.popperOptions,...eF?.popperOptions,modifiers:e}},[eu,Z.popperOptions,eF?.popperOptions]),eU=(e=>{let{classes:t,disableInteractive:n,arrow:r,touch:o,placement:s}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${(0,d.default)(s.split("-")[0])}`],arrow:["arrow"]};return(0,i.default)(a,S,t)})(eB),eq="function"==typeof Y.transition?Y.transition(eB):Y.transition,eW={slots:{popper:M.Popper,transition:M.Transition??et,tooltip:M.Tooltip,arrow:M.Arrow,...J},slotProps:{arrow:Y.arrow??I.arrow,popper:{...Z,...eF??I.popper},tooltip:Y.tooltip??I.tooltip,transition:{...en,...eq??I.transition}}},[ez,eV]=(0,b.default)("popper",{elementType:O,externalForwardedProps:eW,ownerState:eB,className:(0,n.default)(eU.popper,Z?.className)}),[eH,eQ]=(0,b.default)("transition",{elementType:f.default,externalForwardedProps:eW,ownerState:eB}),[e$,eK]=(0,b.default)("tooltip",{elementType:C,className:eU.tooltip,externalForwardedProps:eW,ownerState:eB}),[eX,eG]=(0,b.default)("arrow",{elementType:E,className:eU.arrow,externalForwardedProps:eW,ownerState:eB,ref:ec});return(0,_.jsxs)(t.Fragment,{children:[t.cloneElement(ei,eL),(0,_.jsx)(ez,{as:G??p.default,placement:X,anchorEl:W?{getBoundingClientRect:()=>({top:A.y,left:A.x,right:A.x,bottom:A.y,width:0,height:0})}:ea,popperRef:eM,open:!!ea&&eb,id:ew,transition:!0,...eN,...eV,popperOptions:ej,children:({TransitionProps:e})=>(0,_.jsx)(eH,{timeout:eo.transitions.duration.shorter,...e,...eQ,children:(0,_.jsxs)(e$,{...eK,children:[ee,w?(0,_.jsx)(eX,{...eG}):null]})})})]})});e.s(["default",0,M],691838)},375569,e=>{"use strict";var t=e.i(11507),n=e.i(222942);function r(e){return(0,n.default)("MuiDivider",e)}let i=(0,t.default)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);e.s(["default",0,i,"getDividerUtilityClass",()=>r])},413600,e=>{"use strict";var t=e.i(375569);e.s(["dividerClasses",()=>t.default])},182527,e=>{"use strict";var t=e.i(11507),n=e.i(222942);function r(e){return(0,n.default)("MuiListItemIcon",e)}let i=(0,t.default)("MuiListItemIcon",["root","alignItemsFlexStart"]);e.s(["default",0,i,"getListItemIconUtilityClass",()=>r])},800835,e=>{"use strict";var t=e.i(182527);e.s(["listItemIconClasses",()=>t.default])},918455,e=>{"use strict";var t=e.i(11507),n=e.i(222942);function r(e){return(0,n.default)("MuiListItemText",e)}let i=(0,t.default)("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);e.s(["default",0,i,"getListItemTextUtilityClass",()=>r])},278013,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(28469),o=e.i(721431),s=e.i(842196),a=e.i(138961),l=e.i(85155),u=e.i(837499),c=e.i(957770),h=e.i(987074),d=e.i(413600),f=e.i(800835),p=e.i(918455),p=p,g=e.i(11507),m=e.i(222942);function v(e){return(0,m.default)("MuiMenuItem",e)}let y=(0,g.default)("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]);var b=e.i(991047);let w=(0,o.styled)(u.default,{shouldForwardProp:e=>(0,i.default)(e)||"classes"===e,name:"MuiMenuItem",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})((0,s.default)(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${y.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${y.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${y.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${y.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${y.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${d.dividerClasses.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${d.dividerClasses.inset}`]:{marginLeft:52},[`& .${p.default.root}`]:{marginTop:0,marginBottom:0},[`& .${p.default.inset}`]:{paddingLeft:36},[`& .${f.listItemIconClasses.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${f.listItemIconClasses.root} svg`]:{fontSize:"1.25rem"}}}]}))),x=t.forwardRef(function(e,i){let o,s=(0,a.useDefaultProps)({props:e,name:"MuiMenuItem"}),{autoFocus:u=!1,component:d="li",dense:f=!1,divider:p=!1,disableGutters:g=!1,focusVisibleClassName:m,role:y="menuitem",tabIndex:x,className:S,...k}=s,_=t.useContext(l.default),O=t.useMemo(()=>({dense:f||_.dense||!1,disableGutters:g}),[_.dense,f,g]),C=t.useRef(null);(0,c.default)(()=>{u&&C.current&&C.current.focus()},[u]);let E={...s,dense:O.dense,divider:p,disableGutters:g},T=(e=>{let{disabled:t,dense:n,divider:i,disableGutters:o,selected:s,classes:a}=e,l=(0,r.default)({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",i&&"divider",s&&"selected"]},v,a);return{...a,...l}})(s),P=(0,h.default)(C,i);return s.disabled||(o=void 0!==x?x:-1),(0,b.jsx)(l.default.Provider,{value:O,children:(0,b.jsx)(w,{ref:P,role:y,tabIndex:o,component:d,focusVisibleClassName:(0,n.default)(T.focusVisible,m),className:(0,n.default)(T.root,S),...k,ownerState:E,classes:T})})});e.s(["default",0,x],278013)},109253,e=>{"use strict";var t=e.i(876761);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M9.588 2.215A5.808 5.808 0 0 0 8 2c-.554 0-1.082.073-1.588.215l-.006.002c-.514.141-.99.342-1.432.601A6.156 6.156 0 0 0 2.82 4.98l-.002.004A5.967 5.967 0 0 0 2.21 6.41 5.986 5.986 0 0 0 2 8c0 .555.07 1.085.21 1.591a6.05 6.05 0 0 0 1.548 2.651c.37.365.774.677 1.216.94a6.1 6.1 0 0 0 1.435.609A6.02 6.02 0 0 0 8 14c.555 0 1.085-.07 1.591-.21.515-.145.99-.348 1.426-.607l.004-.002a6.16 6.16 0 0 0 2.161-2.155 5.85 5.85 0 0 0 .6-1.432l.003-.006A5.807 5.807 0 0 0 14 8c0-.554-.072-1.082-.215-1.588l-.002-.006a5.772 5.772 0 0 0-.6-1.423l-.002-.004a5.9 5.9 0 0 0-.942-1.21l-.008-.008a5.902 5.902 0 0 0-1.21-.942l-.004-.002a5.772 5.772 0 0 0-1.423-.6l-.006-.002zm4.455 9.32a7.157 7.157 0 0 1-2.516 2.508 6.966 6.966 0 0 1-1.668.71A6.984 6.984 0 0 1 8 15a6.984 6.984 0 0 1-1.86-.246 7.098 7.098 0 0 1-1.674-.711 7.3 7.3 0 0 1-1.415-1.094 7.295 7.295 0 0 1-1.094-1.415 7.098 7.098 0 0 1-.71-1.675A6.985 6.985 0 0 1 1 8c0-.643.082-1.262.246-1.86a6.968 6.968 0 0 1 .711-1.667 7.156 7.156 0 0 1 2.509-2.516 6.895 6.895 0 0 1 1.675-.704A6.808 6.808 0 0 1 8 1a6.8 6.8 0 0 1 1.86.253 6.899 6.899 0 0 1 3.083 1.805 6.903 6.903 0 0 1 1.804 3.083C14.916 6.738 15 7.357 15 8s-.084 1.262-.253 1.86a6.9 6.9 0 0 1-.704 1.674z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 1L4 1.5V3.02746C4.16417 3.00932 4.331 3 4.5 3C4.669 3 4.83583 3.00932 5 3.02746V2H14V7H12.2929L11 8.29289V7H8.97254C8.99068 7.16417 9 7.331 9 7.5C9 7.669 8.99068 7.83583 8.97254 8H10V9.5L10.8536 9.85355L12.7071 8H14.5L15 7.5V1.5L14.5 1H4.5Z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6.41705 10.4288C7.37039 9.80348 8 8.72527 8 7.5C8 5.567 6.433 4 4.5 4C2.567 4 1 5.567 1 7.5C1 8.72527 1.62961 9.80348 2.58295 10.4288C2.11364 10.6498 1.68557 10.9505 1.31802 11.318C0.900156 11.7359 0.568688 12.232 0.342542 12.7779C0.180451 13.1692 0.0747425 13.5807 0.0278638 14C0.00933826 14.1657 0 14.3326 0 14.5V15H1L0.999398 14.5C0.999398 14.4784 0.999599 14.4567 1 14.4351C1.00811 13.9975 1.09823 13.5651 1.26587 13.1604C1.44179 12.7357 1.69964 12.3498 2.0247 12.0247C2.34976 11.6996 2.73566 11.4418 3.16038 11.2659C3.57088 11.0958 4.00986 11.0056 4.45387 10.9997C4.46922 10.9999 4.4846 11 4.5 11C4.5154 11 4.53078 10.9999 4.54613 10.9997C4.99014 11.0056 5.42912 11.0958 5.83962 11.2659C6.26433 11.4418 6.65024 11.6996 6.9753 12.0247C7.30036 12.3498 7.55821 12.7357 7.73413 13.1604C7.90177 13.5651 7.99189 13.9975 8 14.4351C8.0004 14.4567 8.0006 14.4784 8.0006 14.5L8 15H9V14.5C9 14.3326 8.99066 14.1657 8.97214 14C8.92526 13.5807 8.81955 13.1692 8.65746 12.7779C8.43131 12.232 8.09984 11.7359 7.68198 11.318C7.31443 10.9505 6.88636 10.6498 6.41705 10.4288ZM4.5 10C3.11929 10 2 8.88071 2 7.5C2 6.11929 3.11929 5 4.5 5C5.88071 5 7 6.11929 7 7.5C7 8.88071 5.88071 10 4.5 10Z"},child:[]}]})(e)}function o(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M5.616 4.928a2.487 2.487 0 0 1-1.119.922c-.148.06-.458.138-.458.138v5.008a2.51 2.51 0 0 1 1.579 1.062c.273.412.419.895.419 1.388.008.343-.057.684-.19 1A2.485 2.485 0 0 1 3.5 15.984a2.482 2.482 0 0 1-1.388-.419A2.487 2.487 0 0 1 1.05 13c.095-.486.331-.932.68-1.283.349-.343.79-.579 1.269-.68V5.949a2.6 2.6 0 0 1-1.269-.68 2.503 2.503 0 0 1-.68-1.283 2.487 2.487 0 0 1 1.06-2.565A2.49 2.49 0 0 1 3.5 1a2.504 2.504 0 0 1 1.807.729 2.493 2.493 0 0 1 .729 1.81c.002.494-.144.978-.42 1.389zm-.756 7.861a1.5 1.5 0 0 0-.552-.579 1.45 1.45 0 0 0-.77-.21 1.495 1.495 0 0 0-1.47 1.79 1.493 1.493 0 0 0 1.18 1.179c.288.058.586.03.86-.08.276-.117.512-.312.68-.56.15-.226.235-.49.249-.76a1.51 1.51 0 0 0-.177-.78zM2.708 4.741c.247.161.536.25.83.25.271 0 .538-.075.77-.211a1.514 1.514 0 0 0 .729-1.359 1.513 1.513 0 0 0-.25-.76 1.551 1.551 0 0 0-.68-.56 1.49 1.49 0 0 0-.86-.08 1.494 1.494 0 0 0-1.179 1.18c-.058.288-.03.586.08.86.117.276.312.512.56.68zm10.329 6.296c.48.097.922.335 1.269.68.466.47.729 1.107.725 1.766.002.493-.144.977-.42 1.388a2.499 2.499 0 0 1-4.532-.899 2.5 2.5 0 0 1 1.067-2.565c.267-.183.571-.308.889-.37V5.489a1.5 1.5 0 0 0-1.5-1.499H8.687l1.269 1.27-.71.709L7.117 3.84v-.7l2.13-2.13.71.711-1.269 1.27h1.85a2.484 2.484 0 0 1 2.312 1.541c.125.302.189.628.187.957v5.548zm.557 3.509a1.493 1.493 0 0 0 .191-1.89 1.552 1.552 0 0 0-.68-.559 1.49 1.49 0 0 0-.86-.08 1.493 1.493 0 0 0-1.179 1.18 1.49 1.49 0 0 0 .08.86 1.496 1.496 0 0 0 2.448.49z"},child:[]}]})(e)}function s(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M13.507 12.324a7 7 0 0 0 .065-8.56A7 7 0 0 0 2 4.393V2H1v3.5l.5.5H5V5H2.811a6.008 6.008 0 1 1-.135 5.77l-.887.462a7 7 0 0 0 11.718 1.092zm-3.361-.97l.708-.707L8 7.792V4H7v4l.146.354 3 3z"},child:[]}]})(e)}function a(e){return(0,t.GenIcon)({tag:"svg",attr:{fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.444 13.832a1 1 0 1 0 1.111-1.663 1 1 0 0 0-1.11 1.662zM8 9a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0-5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},child:[]}]})(e)}function l(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.351 1.091a4.528 4.528 0 0 1 3.44 3.16c.215.724.247 1.49.093 2.23a4.583 4.583 0 0 1-4.437 3.6c-.438 0-.874-.063-1.293-.19l-.8.938-.379.175H7v1.5l-.5.5H5v1.5l-.5.5h-3l-.5-.5v-2.307l.146-.353L6.12 6.87a4.464 4.464 0 0 1-.2-1.405 4.528 4.528 0 0 1 5.431-4.375zm1.318 7.2a3.568 3.568 0 0 0 1.239-2.005l.004.005A3.543 3.543 0 0 0 9.72 2.08a3.576 3.576 0 0 0-2.8 3.4c-.01.456.07.908.239 1.33l-.11.543L2 12.404v1.6h2v-1.5l.5-.5H6v-1.5l.5-.5h1.245l.876-1.016.561-.14a3.47 3.47 0 0 0 1.269.238 3.568 3.568 0 0 0 2.218-.795zm-.838-2.732a1 1 0 1 0-1.662-1.11 1 1 0 0 0 1.662 1.11z"},child:[]}]})(e)}function u(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 5v7h-.278c-.406 0-.778-.086-1.117-.258A2.528 2.528 0 0 1 11.73 11H8.87a3.463 3.463 0 0 1-.546.828 3.685 3.685 0 0 1-.735.633c-.27.177-.565.31-.882.398a3.875 3.875 0 0 1-.985.141h-.5V9H2l-1-.5L2 8h3.222V4h.5c.339 0 .664.047.977.14.312.094.607.227.883.4A3.404 3.404 0 0 1 8.87 6h2.859a2.56 2.56 0 0 1 .875-.734c.338-.172.71-.26 1.117-.266H14zm-.778 1.086a1.222 1.222 0 0 0-.32.156 1.491 1.491 0 0 0-.43.461L12.285 7H8.183l-.117-.336a2.457 2.457 0 0 0-.711-1.047C7.027 5.331 6.427 5.09 6 5v7c.427-.088 1.027-.33 1.355-.617.328-.287.565-.636.71-1.047L8.184 10h4.102l.18.297c.057.094.122.177.195.25.073.073.153.143.242.21.088.069.195.12.32.157V6.086z"},child:[]}]})(e)}function c(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4 2h7v.278c0 .406-.086.778-.258 1.117-.172.339-.42.63-.742.875v2.86c.307.145.583.328.828.546.245.219.456.464.633.735.177.27.31.565.398.882.089.318.136.646.141.985v.5H8V14l-.5 1-.5-1v-3.222H3v-.5c0-.339.047-.664.14-.977.094-.312.227-.607.4-.883A3.404 3.404 0 0 1 5 7.13V4.27a2.561 2.561 0 0 1-.734-.875A2.505 2.505 0 0 1 4 2.278V2zm1.086.778c.042.125.094.232.156.32a1.494 1.494 0 0 0 .461.43L6 3.715v4.102l-.336.117c-.411.146-.76.383-1.047.711C4.331 8.973 4.09 9.573 4 10h7c-.088-.427-.33-1.027-.617-1.355a2.456 2.456 0 0 0-1.047-.71L9 7.816V3.715l.297-.18c.094-.057.177-.122.25-.195a2.28 2.28 0 0 0 .21-.242.968.968 0 0 0 .157-.32H5.086z"},child:[]}]})(e)}e.s(["VscCircleLarge",()=>n,"VscClose",()=>r,"VscFeedback",()=>i,"VscGitPullRequest",()=>o,"VscHistory",()=>s,"VscKebabVertical",()=>a,"VscKey",()=>l,"VscPin",()=>u,"VscPinned",()=>c])},968287,e=>{"use strict";var t=e.i(991047),n=e.i(600943);let r=(0,n.createContext)({runAction:()=>void 0,showRunId:()=>void 0,isRunResultOpen:!1,closeRunResult:()=>void 0,isHistoryOpen:!1,closeHistory:()=>void 0,showHistory:()=>void 0,setHistoryOpen:()=>void 0,clearRunResult:()=>void 0});function i({children:e,onRunAction:i,onShowRunId:o,initialRunId:s,initialHistoryOpen:a=!1}){let[l,u]=(0,n.useState)(!!s),[c,h]=(0,n.useState)(s),[d,f]=(0,n.useState)(a),p=(0,n.useCallback)(()=>{u(!1)},[]),g=(0,n.useCallback)(()=>{h(void 0),u(!1)},[]),m=(0,n.useCallback)(()=>{f(!0)},[]),v=(0,n.useCallback)(()=>{f(!1)},[]),y=(0,n.useCallback)((e,t)=>{h(e),u(!0),o?.(e,t)},[o]),b=(0,n.useCallback)(async(e,t,n)=>{if(!i)return void console.warn("RecceActionProvider: onRunAction not provided, cannot execute run");let r=await i(e,t,n);"string"==typeof r&&y(r)},[i,y]),w=(0,n.useMemo)(()=>({runAction:b,runId:c,showRunId:y,isRunResultOpen:l,closeRunResult:p,isHistoryOpen:d,closeHistory:v,showHistory:m,setHistoryOpen:f,clearRunResult:g}),[b,c,y,l,p,d,v,m,g]);return(0,t.jsx)(r.Provider,{value:w,children:e})}function o(){return(0,n.useContext)(r)}r.displayName="RecceActionContext",e.s(["RecceActionProvider",()=>i,"useRecceActionContext",()=>o])},572537,e=>{"use strict";e.i(139507);var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(754907),o=e.i(663888),s=e.i(721431),a=e.i(473287),l=e.i(842196),u=e.i(234308),c=e.i(138961),h=e.i(367745),d=e.i(11507),f=e.i(222942);function p(e){return(0,f.default)("MuiLink",e)}let g=(0,d.default)("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]);var m=e.i(761007),v=e.i(941647),y=e.i(991047);let b={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},w=(0,s.styled)(h.default,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`underline${(0,o.default)(n.underline)}`],"button"===n.component&&t.button]}})((0,l.default)(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:e,ownerState:t})=>"always"===e&&"inherit"!==t.color,style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:e,ownerState:t})=>"always"===e&&"inherit"===t.color,style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter((0,u.default)()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${g.focusVisible}`]:{outline:"auto"}}}]}))),x=t.forwardRef(function(e,s){let l=(0,c.useDefaultProps)({props:e,name:"MuiLink"}),u=(0,a.useTheme)(),{className:h,color:d="primary",component:f="a",onBlur:g,onFocus:x,TypographyClasses:S,underline:k="always",variant:_="inherit",sx:O,...C}=l,[E,T]=t.useState(!1),P={...l,color:d,component:f,focusVisible:E,underline:k,variant:_},A=(e=>{let{classes:t,component:n,focusVisible:i,underline:s}=e,a={root:["root",`underline${(0,o.default)(s)}`,"button"===n&&"button",i&&"focusVisible"]};return(0,r.default)(a,p,t)})(P);return(0,y.jsx)(w,{color:d,className:(0,n.default)(A.root,h),classes:S,component:f,onBlur:e=>{(0,i.default)(e.target)||T(!1),g&&g(e)},onFocus:e=>{(0,i.default)(e.target)&&T(!0),x&&x(e)},ref:s,ownerState:P,variant:_,...C,sx:[...void 0===b[d]?[{color:d}]:[],...Array.isArray(O)?O:[O]],style:{...C.style,..."always"===k&&"inherit"!==d&&!b[d]&&{"--Link-underlineColor":(({theme:e,ownerState:t})=>{let n=t.color;if("colorSpace"in e&&e.colorSpace){let r=(0,m.getPath)(e,`palette.${n}.main`)||(0,m.getPath)(e,`palette.${n}`)||t.color;return e.alpha(r,.4)}let r=(0,m.getPath)(e,`palette.${n}.main`,!1)||(0,m.getPath)(e,`palette.${n}`,!1)||t.color,i=(0,m.getPath)(e,`palette.${n}.mainChannel`)||(0,m.getPath)(e,`palette.${n}Channel`);return"vars"in e&&i?`rgba(${i} / 0.4)`:(0,v.alpha)(r,.4)})({theme:u,ownerState:P})}}})});e.s(["default",0,x],572537)},144899,e=>{"use strict";var t=e.i(600943),n=e.i(7284),r=e.i(295456),i=e.i(721431),o=e.i(842196),s=e.i(138961),a=e.i(375569),l=e.i(991047);let u=(0,i.styled)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})((0,o.default)(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.alpha((e.vars||e).palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:e})=>!!e.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:e})=>e.children&&"vertical"!==e.orientation,style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:e})=>"vertical"===e.orientation&&e.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:e})=>"right"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:e})=>"left"===e.textAlign&&"vertical"!==e.orientation,style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),c=(0,i.styled)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})((0,o.default)(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),h=t.forwardRef(function(e,t){let i=(0,s.useDefaultProps)({props:e,name:"MuiDivider"}),{absolute:o=!1,children:h,className:d,orientation:f="horizontal",component:p=h||"vertical"===f?"div":"hr",flexItem:g=!1,light:m=!1,role:v="hr"!==p?"separator":void 0,textAlign:y="center",variant:b="fullWidth",...w}=i,x={...i,absolute:o,component:p,flexItem:g,light:m,orientation:f,role:v,textAlign:y,variant:b},S=(e=>{let{absolute:t,children:n,classes:i,flexItem:o,light:s,orientation:l,textAlign:u,variant:c}=e;return(0,r.default)({root:["root",t&&"absolute",c,s&&"light","vertical"===l&&"vertical",o&&"flexItem",n&&"withChildren",n&&"vertical"===l&&"withChildrenVertical","right"===u&&"vertical"!==l&&"textAlignRight","left"===u&&"vertical"!==l&&"textAlignLeft"],wrapper:["wrapper","vertical"===l&&"wrapperVertical"]},a.getDividerUtilityClass,i)})(x);return(0,l.jsx)(u,{as:p,className:(0,n.default)(S.root,d),role:v,ref:t,ownerState:x,"aria-orientation":"separator"===v&&("hr"!==p||"vertical"===f)?f:void 0,...w,children:h?(0,l.jsx)(c,{className:S.wrapper,ownerState:x,children:h}):null})});h&&(h.muiSkipListHighlight=!0),e.s(["default",0,h])},51449,e=>{"use strict";var t=e.i(259864),n=e.i(539392),r=e.i(313805),i=class extends n.Removable{#c;#F;#j;#h;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#j=e.mutationCache,this.#F=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#F.includes(e)||(this.#F.push(e),this.clearGcTimeout(),this.#j.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#F=this.#F.filter(t=>t!==e),this.scheduleGc(),this.#j.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#F.length||("pending"===this.state.status?this.scheduleGc():this.#j.remove(this))}continue(){return this.#h?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#p({type:"continue"})},n={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#h=(0,r.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#j.canRun(this)});let i="pending"===this.state.status,o=!this.#h.canStart();try{if(i)t();else{this.#p({type:"pending",variables:e,isPaused:o}),this.#j.config.onMutate&&await this.#j.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#p({type:"pending",context:t,variables:e,isPaused:o})}let r=await this.#h.start();return await this.#j.config.onSuccess?.(r,e,this.state.context,this,n),await this.options.onSuccess?.(r,e,this.state.context,n),await this.#j.config.onSettled?.(r,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(r,null,e,this.state.context,n),this.#p({type:"success",data:r}),r}catch(t){try{await this.#j.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#j.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#p({type:"error",error:t}),t}finally{this.#j.runNext(this)}}#p(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#F.forEach(t=>{t.onMutationUpdate(e)}),this.#j.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",()=>i,"getDefaultState",()=>o])},895299,e=>{"use strict";var t=e.i(876761);function n(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"},child:[]}]})(e)}function r(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M128 64c0-35.3 28.7-64 64-64L352 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64l-256 0c-35.3 0-64-28.7-64-64l0-112 174.1 0-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39L128 288l0-224zm0 224l0 48L24 336c-13.3 0-24-10.7-24-24s10.7-24 24-24l104 0zM512 128l-128 0L384 0 512 128z"},child:[]}]})(e)}function i(e){return(0,t.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"},child:[]}]})(e)}e.s(["FaBookmark",()=>n,"FaFileImport",()=>r,"FaPlay",()=>i])},568029,e=>{"use strict";function t(e){let t=new Set,n=new Set;if(e?.nodes)for(let r of Object.values(e.nodes))r.data.data.base?.schema&&t.add(r.data.data.base.schema),r.data.data.current?.schema&&n.add(r.data.data.current.schema);return[t,n]}e.s(["extractSchemas",()=>t])},272794,384510,329037,564482,499242,923612,864868,117390,e=>{"use strict";let t,n;var r,i,o,s,a,l,u,c,h=e.i(991047);let d=0;class f{constructor(e,t){this.from=e,this.to=t}}class p{constructor(e={}){this.id=d++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=v.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}p.closedBy=new p({deserialize:e=>e.split(" ")}),p.openedBy=new p({deserialize:e=>e.split(" ")}),p.group=new p({deserialize:e=>e.split(" ")}),p.isolate=new p({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),p.contextHash=new p({perNode:!0}),p.lookAhead=new p({perNode:!0}),p.mounted=new p({perNode:!0});class g{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[p.mounted.id]}}let m=Object.create(null);class v{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):m,n=!!e.top|2*!!e.skipped|4*!!e.error|8*(null==e.name),r=new v(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(p.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(p.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}v.none=new v("",Object.create(null),0,8);class y{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let r=null;for(let t of e){let e=t(n);if(e){r||(r=Object.assign({},n.props));let t=e[1],i=e[0];i.combine&&i.id in r&&(t=i.combine(r[i.id],t)),r[i.id]=t}}t.push(r?new v(n.name,r,n.id,n.flags):n)}return new y(t)}}let b=new WeakMap,w=new WeakMap;(r=u||(u={}))[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays",r[r.EnterBracketed=16]="EnterBracketed";class x{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length)for(let[e,t]of(this.props=Object.create(null),i))this.props["number"==typeof e?e:e.id]=t}toString(){let e=g.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new D(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new D(b.get(this)||this.topNode);return r.moveTo(e,t),b.set(this,r._tree),r}get topNode(){return new E(this,0,0,null)}resolve(e,t=0){let n=O(b.get(this)||this.topNode,e,t,!1);return b.set(this,n),n}resolveInner(e,t=0){let n=O(w.get(this)||this.topNode,e,t,!0);return w.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof E?r:r.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(i||(i=[r])).push(o.resolve(t,n)),e=o}else{let o=g.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new E(o.tree,o.overlay[0].from+e.from,-1,e);(i||(i=[r])).push(O(s,t,n,!1))}}return i?M(i):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,o=e.mode||0,s=(o&u.IncludeAnonymous)>0;for(let e=this.cursor(o|u.IncludeAnonymous);;){let o=!1;if(e.from<=i&&e.to>=r&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:F(v.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new x(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new x(v.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=1024,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new S(n,n.length):n,l=r.types,u=0,c=0;function h(e,t,n,i,o,s,a,l,u){let c=[],h=[];for(;e.length>i;)c.push(e.pop()),h.push(t.pop()+n-o);e.push(d(r.types[a],c,h,s-o,l-s,u)),t.push(o-n)}function d(e,t,n,r,i,o,s){if(o){let e=[p.contextHash,o];s=s?[e].concat(s):[e]}if(i>25){let e=[p.lookAhead,i];s=s?[e].concat(s):[e]}return new x(e,t,n,r,s)}let f=[],g=[];for(;a.pos>0;)!function e(t,n,f,g,m,v){let{id:y,start:b,end:w,size:S}=a,_=c,O=u;if(S<0){if(a.next(),-1==S){let e=o[y];f.push(e),g.push(b-t);return}if(-3==S){u=y;return}if(-4==S){c=y;return}else throw RangeError(`Unrecognized record size: ${S}`)}let C=l[y],E,T,P=b-t;if(w-b<=i&&(T=function(e,t){let n=a.fork(),r=0,o=0,l=0,u=n.end-i,c={size:0,start:0,skip:0};t:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){c.size=r,c.start=o,c.skip=l,l+=4,r+=4,n.next();continue}let a=n.pos-e;if(e<0||a<i||n.start<u)break;let h=4*(n.id>=s),d=n.start;for(n.next();n.pos>a;){if(n.size<0)if(-3==n.size||-4==n.size)h+=4;else break t;else n.id>=s&&(h+=4);n.next()}o=d,r+=e,l+=h}return(t<0||r==e)&&(c.size=r,c.start=o,c.skip=l),c.size>4?c:void 0}(a.pos-n,m))){let e=new Uint16Array(T.size-T.skip),n=a.pos-T.size,i=e.length;for(;a.pos>n;)i=function e(t,n,r){let{id:i,start:o,end:l,size:h}=a;if(a.next(),h>=0&&i<s){let s=r;if(h>4){let i=a.pos-(h-4);for(;a.pos>i;)r=e(t,n,r)}n[--r]=s,n[--r]=l-t,n[--r]=o-t,n[--r]=i}else -3==h?u=i:-4==h&&(c=i);return r}(T.start,e,i);E=new k(e,w-T.start,r),P=T.start-t}else{let t=a.pos-S;a.next();let n=[],o=[],l=y>=s?y:-1,u=0,c=w;for(;a.pos>t;)l>=0&&a.id==l&&a.size>=0?(a.end<=c-i&&(h(n,o,b,u,a.end,c,l,_,O),u=n.length,c=a.end),a.next()):v>2500?function(e,t,n,o){let s=[],l=0,u=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:r}=a;if(r>4)a.next();else if(u>-1&&t<u)break;else u<0&&(u=n-i),s.push(e,t,n),l++,a.next()}if(l){let t=new Uint16Array(4*l),i=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-i,t[n++]=s[e+2]-i,t[n++]=n;n.push(new k(t,s[2]-i,r)),o.push(i-e)}}(b,t,n,o):e(b,t,n,o,l,v+1);if(l>=0&&u>0&&u<n.length&&h(n,o,b,u,b,c,l,_,O),n.reverse(),o.reverse(),l>-1&&u>0){let e=function(e,t){return(n,r,i)=>{let o=0,s=n.length-1,a,l;if(s>=0&&(a=n[s])instanceof x){if(!s&&a.type==e&&a.length==i)return a;(l=a.prop(p.lookAhead))&&(o=r[s]+a.length+l)}return d(e,n,r,i,o,t)}}(C,O);E=F(C,n,o,0,n.length,0,w-b,e,e)}else E=d(C,n,o,w-b,_-w,O)}f.push(E),g.push(P)}(e.start||0,e.bufferStart||0,f,g,-1,0);let m=null!=(t=e.length)?t:f.length?g[0]+f[0].length:0;return new x(l[e.topID],f.reverse(),g.reverse(),m)}(e)}}x.empty=new x(v.none,[],[],0);class S{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new S(this.buffer,this.index)}}class k{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return v.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return i+"("+o.join(",")+")"}findChild(e,t,n,r,i){let{buffer:o}=this,s=-1;for(let a=e;a!=t&&(!_(i,r,o[a+1],o[a+2])||(s=a,!(n>0)));a=o[a+3]);return s}slice(e,t,n){let r=this.buffer,i=new Uint16Array(t-e),o=0;for(let s=e,a=0;s<t;){i[a++]=r[s++],i[a++]=r[s++]-n;let t=i[a++]=r[s++]-n;i[a++]=r[s++]-e,o=Math.max(o,t)}return new k(i,o,this.set)}}function _(e,t,n,r){switch(e){case -2:return n<t;case -1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function O(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof E&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=r?0:u.IgnoreOverlays;if(r)for(let r=e,s=r.parent;s;s=(r=s).parent)r instanceof E&&r.index<0&&(null==(i=s.enter(t,n,o))?void 0:i.from)!=r.from&&(e=s);for(;;){let r=e.enter(t,n,o);if(!r)return e;e=r}}class C{cursor(e=0){return new D(this,e)}getChild(e,t=null,n=null){let r=T(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return T(this,e,t,n)}resolve(e,t=0){return O(this,e,t,!1)}resolveInner(e,t=0){return O(this,e,t,!0)}matchContext(e){return P(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class E extends C{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,i=0){var o;for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=t>0?a.length:-1;e!=c;e+=t){let c=a[e],h=l[e]+s.from;if(i&u.EnterBracketed&&c instanceof x&&(null==(o=g.get(c))?void 0:o.overlay)===null&&(h>=n||h+c.length<=n)||_(r,n,h,h+c.length)){if(c instanceof k){if(i&u.ExcludeBuffers)continue;let o=c.findChild(0,c.buffer.length,t,n-h,r);if(o>-1)return new R(new A(s,c,e,h),null,o)}else if(i&u.IncludeAnonymous||!c.type.isAnonymous||L(c)){let o;if(!(i&u.IgnoreMounts)&&(o=g.get(c))&&!o.overlay)return new E(o.tree,h,e,s);let a=new E(c,h,e,s);return i&u.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?c.children.length-1:0,t,n,r,i)}}}if(i&u.IncludeAnonymous||!s.type.isAnonymous||(e=s.index>=0?s.index+t:t<0?-1:s._parent._tree.children.length,!(s=s._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&u.IgnoreOverlays)&&(r=g.get(this._tree))&&r.overlay){let i=e-this.from,o=n&u.EnterBracketed&&r.bracketed;for(let{from:e,to:n}of r.overlay)if((t>0||o?e<=i:e<i)&&(t<0||o?n>=i:n>i))return new E(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function T(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(null!=n){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return o}for(;;){if(null!=r&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return null==r?o:[]}}function P(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class A{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class R extends C{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new R(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&u.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return i<0?null:new R(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new R(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new R(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let o=n.buffer[this.index+1];e.push(n.slice(r,i,o)),t.push(0)}return new x(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function M(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof E&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new I(i,n)}class I{constructor(e,t){this.heads=e,this.node=t}get next(){return M(this.heads)}}class D{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~u.EnterBracketed,e instanceof E)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof E?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&u.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&u.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&u.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&u.IncludeAnonymous||e instanceof k||!e.type.isAnonymous||L(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)t:for(let r=this.index,i=this.stack.length;i>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=i+1;break t}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new R(this.buffer,t,this.stack[e]);return this.bufferNode=new R(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return P(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return P(this._tree,e,r);let o=n[t.buffer[this.stack[i]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function L(e){return e.children.some(e=>e instanceof k||!e.type.isAnonymous||L(e))}let N=new WeakMap;function B(e,t){if(!e.isAnonymous||t instanceof k||t.type!=e)return 1;let n=N.get(t);if(null==n){for(let r of(n=1,t.children)){if(r.type!=e||!(r instanceof x)){n=1;break}n+=B(e,r)}N.set(t,n)}return n}function F(e,t,n,r,i,o,s,a,l){let u=0;for(let n=r;n<i;n++)u+=B(e,t[n]);let c=Math.ceil(1.5*u/8),h=[],d=[];return!function t(n,r,i,s,a){for(let u=i;u<s;){let i=u,f=r[u],p=B(e,n[u]);for(u++;u<s;u++){let t=B(e,n[u]);if(p+t>=c)break;p+=t}if(u==i+1){if(p>c){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+a);continue}h.push(n[i])}else{let t=r[u-1]+n[u-1].length-f;h.push(F(e,n,r,i,u,f,t,null,l))}d.push(f+a-o)}}(t,n,r,i,0),(a||l)(h,d,s)}class j{constructor(e,t,n,r,i=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|2*!!o}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new j(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let u=s<t.length?t[s]:null,c=u?u.fromA:1e9;if(c-a>=n)for(;o&&o.from<c;){let t=o;if(a>=t.from||c<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new j(e,n,t.tree,t.offset+l,s>0,!!u)}if(t&&r.push(t),o.to>c)break;o=i<e.length?e[i++]:null}if(!u)break;a=u.toA,l=u.toA-u.toB}return r}}class U{startParse(e,t,n){return"string"==typeof e&&(e=new q(e)),n=n?n.length?n.map(e=>new f(e.from,e.to)):[new f(0,0)]:[new f(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class q{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new p({perNode:!0});let W=[],z=[],V="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<V.length;e++)(e%2?z:W).push(t+=V[e]);function H(e){return e>=127462&&e<=127487}function Q(e,t,n){if(t==e.length)return t;t&&K(e.charCodeAt(t))&&X(e.charCodeAt(t-1))&&t--;let r=$(e,t);for(t+=G(r);t<e.length;){let i=$(e,t);if(8205==r||8205==i||n&&function(e){if(e<768)return!1;for(let t=0,n=W.length;;){let r=t+n>>1;if(e<W[r])n=r;else{if(!(e>=z[r]))return!0;t=r+1}if(t==n)return!1}}(i))t+=G(i),r=i;else if(H(i)){let n=0,r=t-2;for(;r>=0&&H($(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function $(e,t){let n=e.charCodeAt(t);if(!X(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return K(r)?(n-55296<<10)+(r-56320)+65536:n}function K(e){return e>=56320&&e<57344}function X(e){return e>=55296&&e<56320}function G(e){return e<65536?1:2}class Z{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=eo(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),J.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=eo(this,e,t);let n=[];return this.decompose(e,t,n,0),J.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new et(this),i=new et(e);for(let e=t,o=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(o+=r.value.length,r.done||o>=n)return!0}}iter(e=1){return new et(this,e)}iterRange(e,t=this.length){return new en(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new er(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new Y(e):J.from(Y.split(e,[])):Z.empty}}class Y extends Z{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.text[i],s=r+o.length;if((t?n:s)>=e)return new ei(r,s,n,o);r=s+1,n++}}decompose(e,t,n,r){var i;let o=e<=0&&t>=this.length?this:new Y((i=this.text,ee(i,[""],e,t)),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=ee(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new Y(t,e.length+o.length));else{let e=t.length>>1;n.push(new Y(t.slice(0,e)),new Y(t.slice(e)))}}else n.push(o)}replace(e,t,n){var r;if(!(n instanceof Y))return super.replace(e,t,n);[e,t]=eo(this,e,t);let i=ee(this.text,ee(n.text,(r=this.text,ee(r,[""],0,e))),t),o=this.length+n.length-(t-e);return i.length<=32?new Y(i,o):J.from(Y.split(i,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=eo(this,e,t);let r="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let s=this.text[o],a=i+s.length;i>e&&o&&(r+=n),e<a&&t>i&&(r+=s.slice(Math.max(0,e-i),t-i)),i=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let i of e)n.push(i),r+=i.length+1,32==n.length&&(t.push(new Y(n,r)),n=[],r=-1);return r>-1&&t.push(new Y(n,r)),t}}class J extends Z{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,r){for(let i=0;;i++){let o=this.children[i],s=r+o.length,a=n+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,n,r);r=s+1,n=a+1}}decompose(e,t,n,r){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e<=a&&t>=o){let i=r&(o<=e|2*(a>=t));o>=e&&a<=t&&!i?n.push(s):s.decompose(e-o,t-o,n,i)}o=a+1}}replace(e,t,n){if([e,t]=eo(this,e,t),n.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let o=this.children[r],s=i+o.length;if(e>=i&&t<=s){let a=o.replace(e-i,t-i,n),l=this.lines-o.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let i=this.children.slice();return i[r]=a,new J(i,this.length-(t-e)+n.length)}return super.replace(i,s,a)}i=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=eo(this,e,t);let r="";for(let i=0,o=0;i<this.children.length&&o<=t;i++){let s=this.children[i],a=o+s.length;o>e&&i&&(r+=n),e<a&&t>o&&(r+=s.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof J))return 0;let n=0,[r,i,o,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,i+=t){if(r==o||i==s)return n;let a=this.children[r],l=e.children[i];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new Y(n,t)}let r=Math.max(32,n>>5),i=r<<1,o=r>>1,s=[],a=0,l=-1,u=[];function c(){0!=a&&(s.push(1==u.length?u[0]:J.from(u,l)),l=-1,a=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>i&&t instanceof J)for(let n of t.children)e(n);else t.lines>o&&(a>o||!a)?(c(),s.push(t)):t instanceof Y&&a&&(n=u[u.length-1])instanceof Y&&t.lines+n.lines<=32?(a+=t.lines,l+=t.length+1,u[u.length-1]=new Y(n.text.concat(t.text),n.length+1+t.length)):(a+t.lines>r&&c(),a+=t.lines,l+=t.length+1,u.push(t))}(t);return c(),1==s.length?s[0]:new J(s,t)}}function ee(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}Z.empty=new Y([""],0);class et{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Y?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,s=r instanceof Y?r.text.length:r.children.length;if(o==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&i)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof Y){let i=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=0==e?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[o+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof Y?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class en{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new et(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class er{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"u">typeof Symbol&&(Z.prototype[Symbol.iterator]=function(){return this.iter()},et.prototype[Symbol.iterator]=en.prototype[Symbol.iterator]=er.prototype[Symbol.iterator]=function(){return this});class ei{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function eo(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}function es(e,t,n=!0,r=!0){return function(e,t,n=!0,r=!0){return(n?Q:function(e,t,n){for(;t>0;){let r=Q(e,t-2,n);if(r<t)return r;t--}return 0})(e,t,r)}(e,t,n,r)}function ea(e,t){let n=e.charCodeAt(t);if(!(n>=55296&&n<56320)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return r>=56320&&r<57344?(n-55296<<10)+(r-56320)+65536:n}function el(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function eu(e){return e<65536?1:2}let ec=/\r\n?|\n/;var eh=((i=eh||(eh={}))[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i);class ed{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,i),r+=i):r+=o,n+=i}}iterChangedRanges(e,t=!1){em(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new ed(e)}composeDesc(e){return this.empty?e:e.empty?this:ey(this,e)}mapDesc(e,t=!1){return e.empty?this:ev(this,e,t)}mapPos(e,t=-1,n=eh.Simple){let r=0,i=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],a=this.sections[o++],l=r+s;if(a<0){if(l>e)return i+(e-r);i+=s}else{if(n!=eh.Simple&&l>=e&&(n==eh.TrackDel&&r<e&&l>e||n==eh.TrackBefore&&r<e||n==eh.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==r||t<0?i:i+a;i+=a}r=l}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],o=this.sections[n++],s=r+i;if(o>=0&&r<=t&&s>=e)return!(r<e)||!(s>t)||"cover";r=s}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new ed(e)}static create(e){return new ed(e)}}class ef extends ed{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return em(this,(t,n,r,i,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return ev(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,i=0;r<t.length;r+=2){let o=t[r],s=t[r+1];if(s>=0){t[r]=s,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(Z.empty);n.push(o?e.slice(i,i+o):Z.empty)}i+=o}return new ef(t,n)}compose(e){return this.empty?e:e.empty?this:ey(this,e,!0)}map(e,t=!1){return e.empty?this:ev(this,e,t,!0)}iterChanges(e,t=!1){em(this,e,t)}get desc(){return ed.create(this.sections)}filter(e){let t=[],n=[],r=[],i=new eb(this);n:for(let o=0,s=0;;){let a=o==e.length?1e9:e[o++];for(;s<a||s==a&&0==i.len;){if(i.done)break n;let e=Math.min(i.len,a-s);ep(r,e,-1);let o=-1==i.ins?-1:0==i.off?i.ins:0;ep(t,e,o),o>0&&eg(n,t,i.text),i.forward(e),s+=e}let l=e[o++];for(;s<l;){if(i.done)break n;let e=Math.min(i.len,l-s);ep(t,e,-1),ep(r,e,-1==i.ins?-1:0==i.off?i.ins:0),i.forward(e),s+=e}}return{changes:new ef(t,n),filtered:ed.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],i=[],o=0,s=null;function a(e=!1){if(!e&&!r.length)return;o<t&&ep(r,t-o,-1);let n=new ef(r,i);s=s?s.compose(n.map(s)):n,r=[],i=[],o=0}return!function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof ef){if(l.length!=t)throw RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:u}=l;if(e>s||e<0||s>t)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let c=u?"string"==typeof u?Z.of(u.split(n||ec)):u:Z.empty,h=c.length;if(e==s&&0==h)return;e<o&&a(),e>o&&ep(r,e-o,-1),ep(r,s-e,h),eg(i,r,c),o=s}}(e),a(!s),s}static empty(e){return new ef(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];if("number"==typeof i)t.push(i,-1);else if(!Array.isArray(i)||"number"!=typeof i[0]||i.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==i.length)t.push(i[0],0);else{for(;n.length<r;)n.push(Z.empty);n[r]=Z.of(i.slice(1)),t.push(i[0],n[r].length)}}return new ef(t,n)}static createSet(e,t){return new ef(e,t)}}function ep(e,t,n,r=!1){if(0==t&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function eg(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Z.empty);e.push(n)}}function em(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let u=i,c=o,h=Z.empty;for(;u+=a,c+=l,l&&r&&(h=h.append(r[s-2>>1])),!n&&s!=e.sections.length&&!(e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,u,o,c,h),i=u,o=c}}}function ev(e,t,n,r=!1){let i=[],o=r?[]:null,s=new eb(e),a=new eb(t);for(let e=-1;;)if(s.done&&a.len||a.done&&s.len)throw Error("Mismatched change set lengths");else if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);ep(i,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(ep(i,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(ep(i,0,s.ins),o&&eg(o,i,s.text),e=s.i),s.forward(n),t-=n}a.next()}else if(s.ins>=0){let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else if(0==a.ins&&a.len<n)n-=a.len,a.next();else break;ep(i,t,e<s.i?s.ins:0),o&&e<s.i&&eg(o,i,s.text),e=s.i,s.forward(s.len-n)}else if(s.done&&a.done)return o?ef.createSet(i,o):ed.create(i);else throw Error("Mismatched change set lengths")}function ey(e,t,n=!1){let r=[],i=n?[]:null,o=new eb(e),s=new eb(t);for(let e=!1;;)if(o.done&&s.done)return i?ef.createSet(r,i):ed.create(r);else if(0==o.ins)ep(r,o.len,0,e),o.next();else if(0!=s.len||s.done)if(o.done||s.done)throw Error("Mismatched change set lengths");else{let t=Math.min(o.len2,s.len),n=r.length;if(-1==o.ins){let n=-1==s.ins?-1:s.off?0:s.ins;ep(r,t,n,e),i&&n&&eg(i,r,s.text)}else -1==s.ins?(ep(r,o.off?0:o.len,t,e),i&&eg(i,r,o.textBit(t))):(ep(r,o.off?0:o.len,s.off?0:s.ins,e),i&&!s.off&&eg(i,r,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||r.length>n),o.forward2(t),s.forward(t)}else ep(r,0,s.ins,e),i&&eg(i,r,s.text),s.next()}class eb{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Z.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Z.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ew{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 0xffffff==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new ew(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ex.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ex.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return ex.range(e.anchor,e.head)}static create(e,t,n){return new ew(e,t,n)}}class ex{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ex.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new ex([this.main],0)}addRange(e,t=!0){return ex.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,ex.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new ex(e.ranges.map(e=>ew.fromJSON(e)),e.main)}static single(e,t=e){return new ex([ex.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=n:i.from<n)return ex.normalized(e.slice(),t);n=i.to}return new ex(e,t)}static cursor(e,t=0,n,r){return ew.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:0xffffff)<<6)}static range(e,t,n,r){let i=(null!=n?n:0xffffff)<<6|(null==r?7:Math.min(6,r));return t<e?ew.create(t,e,48|i):ew.create(e,t,8*(t>e)|i)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],i=e[n-1];if(r.empty?r.from<=i.to:r.from<i.to){let o=i.from,s=Math.max(r.to,i.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?ex.range(s,o):ex.range(o,s))}}return new ex(e,t)}}function eS(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let ek=0;class e_{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ek++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}get reader(){return this}static define(e={}){return new e_(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(!e.combine?eO:(e,t)=>e===t),!!e.static,e.enables)}of(e){return new eC([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new eC(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new eC(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function eO(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class eC{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ek++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,o=e[i]>>1,s=2==this.type,a=!1,l=!1,u=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:((null!=(t=e[n.id])?t:1)&1)==0&&u.push(e[n.id]);return{create:e=>(e.values[o]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||eT(e,u)){let t=n(e);if(s?!eE(t,e.values[o],r):!r(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[i];if(null!=l){let i=eF(t,l);if(this.dependencies.every(n=>n instanceof e_?t.facet(n)===e.facet(n):!(n instanceof eA)||t.field(n,!1)==e.field(n,!1))||(s?eE(a=n(e),i,r):r(a=n(e),i)))return e.values[o]=i,0}else a=n(e);return e.values[o]=a,1}}}}function eE(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function eT(e,t){let n=!1;for(let r of t)1&eB(e,r)&&(n=!0);return n}let eP=e_.define({static:!0});class eA{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let t=new eA(ek++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(eP).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(eP),i=n.facet(eP),o;return(o=r.find(e=>e.field==this))&&o!=i.find(e=>e.field==this)?(e.values[t]=o.create(e),1):null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}}init(e){return[this,eP.of({field:this,create:e})]}get extension(){return this}}function eR(e){return t=>new eI(t,e)}let eM={highest:eR(0),high:eR(1),default:eR(2),low:eR(3),lowest:eR(4)};class eI{constructor(e,t){this.inner=e,this.prec=t}}class eD{of(e){return new eL(this,e)}reconfigure(e){return eD.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class eL{constructor(e,t){this.compartment=e,this.inner=t}}class eN{constructor(e,t,n,r,i,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){var r,i,o;let s,a,l=[],u=Object.create(null),c=new Map;for(let n of(r=e,i=t,o=c,s=[[],[],[],[],[]],a=new Map,!function e(t,n){let r=a.get(t);if(null!=r){if(r<=n)return;let e=s[r].indexOf(t);e>-1&&s[r].splice(e,1),t instanceof eL&&o.delete(t.compartment)}if(a.set(t,n),Array.isArray(t))for(let r of t)e(r,n);else if(t instanceof eL){if(o.has(t.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=i.get(t.compartment)||t.inner;o.set(t.compartment,r),e(r,n)}else if(t instanceof eI)e(t.inner,t.prec);else if(t instanceof eA)s[n].push(t),t.provides&&e(t.provides,n);else if(t instanceof eC)s[n].push(t),t.facet.extensions&&e(t.facet.extensions,2);else{let r=t.extension;if(!r)throw Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(r,n)}}(r,2),s.reduce((e,t)=>e.concat(t))))n instanceof eA?l.push(n):(u[n.facet.id]||(u[n.facet.id]=[])).push(n);let h=Object.create(null),d=[],f=[];for(let e of l)h[e.id]=f.length<<1,f.push(t=>e.slot(t));let p=null==n?void 0:n.config.facets;for(let e in u){let t=u[e],r=t[0].facet,i=p&&p[e]||[];if(t.every(e=>0==e.type))if(h[r.id]=d.length<<1|1,eO(i,t))d.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));d.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(h[e.id]=d.length<<1|1,d.push(e.value)):(h[e.id]=f.length<<1,f.push(t=>e.dynamicSlot(t)));h[r.id]=f.length<<1,f.push(e=>(function(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),o=r.filter(e=>!(1&e)),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<r.length;t++){let o=eF(e,r[t]);if(2==i[t])for(let e of o)n.push(e);else n.push(o)}return t.combine(n)}return{create(e){for(let t of r)eB(e,t);return e.values[s]=a(e),1},update(e,n){if(!eT(e,o))return 0;let r=a(e);return t.compare(r,e.values[s])?0:(e.values[s]=r,1)},reconfigure(e,i){let o=eT(e,r),l=i.config.facets[t.id],u=i.facet(t);if(l&&!o&&eO(n,l))return e.values[s]=u,0;let c=a(e);return t.compare(c,u)?(e.values[s]=u,0):(e.values[s]=c,1)}}})(e,r,t))}}return new eN(e,c,f.map(e=>e(h)),h,d,u)}}function eB(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function eF(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let ej=e_.define(),eU=e_.define({combine:e=>e.some(e=>e),static:!0}),eq=e_.define({combine:e=>e.length?e[0]:void 0,static:!0}),eW=e_.define(),ez=e_.define(),eV=e_.define(),eH=e_.define({combine:e=>!!e.length&&e[0]});class eQ{constructor(e,t){this.type=e,this.value=t}static define(){return new e$}}class e${of(e){return new eQ(this,e)}}class eK{constructor(e){this.map=e}of(e){return new eX(this,e)}}class eX{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new eX(this.type,t)}is(e){return this.type==e}static define(e={}){return new eK(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}eX.reconfigure=eX.define(),eX.appendConfig=eX.define();class eG{constructor(e,t,n,r,i,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=o,this._doc=null,this._state=null,n&&eS(n,t.newLength),i.some(e=>e.type==eG.time)||(this.annotations=i.concat(eG.time.of(Date.now())))}static create(e,t,n,r,i,o){return new eG(e,t,n,r,i,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(eG.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function eZ(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=ef.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):null==(r=e.selection)?void 0:r.map(i),effects:eX.mapEffects(e.effects,i).concat(eX.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function eY(e,t,n){let r=t.selection,i=e0(t.annotations);return t.userEvent&&(i=i.concat(eG.userEvent.of(t.userEvent))),{changes:t.changes instanceof ef?t.changes:ef.of(t.changes||[],n,e.facet(eq)),selection:r&&(r instanceof ex?r:ex.single(r.anchor,r.head)),effects:e0(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}eG.time=eQ.define(),eG.userEvent=eQ.define(),eG.addToHistory=eQ.define(),eG.remote=eQ.define();let eJ=[];function e0(e){return null==e?eJ:Array.isArray(e)?e:[e]}var e1=((o=e1||(e1={}))[o.Word=0]="Word",o[o.Space=1]="Space",o[o.Other=2]="Other",o);let e2=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{t=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class e3{constructor(e,t,n,r,i,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)eB(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return eB(this,n),eF(this,n)}update(...e){return function e(t,n,r){let i=eY(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(r=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(r=!1);let o=!!n[e].sequential;i=eZ(i,eY(t,n[e],o?i.changes.newLength:t.doc.length),o)}let o=eG.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(eV),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=eZ(r,eY(t,o,e.changes.newLength),!0))}return r==e?e:eG.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(t){let n=t.startState,r=!0;for(let e of n.facet(eW)){let n=e(t);if(!1===n){r=!1;break}Array.isArray(n)&&(r=!0===r?n:function(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else{if(!(i<t.length))return n;o=t[i++],s=t[i++]}!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}(r,n))}if(!0!==r){let e,i;if(!1===r)i=t.changes.invertedDesc,e=ef.empty(n.doc.length);else{let n=t.changes.filter(r);e=n.changes,i=n.filtered.mapDesc(n.changes).invertedDesc}t=eG.create(n,e,t.selection&&t.selection.map(i),eX.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let i=n.facet(ez);for(let r=i.length-1;r>=0;r--){let o=i[r](t);t=o instanceof eG?o:Array.isArray(o)&&1==o.length&&o[0]instanceof eG?o[0]:e(n,e0(o),!1)}return t}(o):o)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:i}=n;for(let t of e.effects)t.is(eD.reconfigure)?(n&&(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),n=null),i.set(t.value.compartment,t.value.extension)):t.is(eX.reconfigure)?(n=null,r=t.value):t.is(eX.appendConfig)&&(n=null,r=e0(r).concat(t.value));t=n?e.startState.values.slice():new e3(n=eN.resolve(r,i,this),this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values;let o=e.startState.facet(eU)?e.newSelection:e.newSelection.asSingle();new e3(n,e.newDoc,o,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ex.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],o=e0(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(l);let u=r.mapDesc(a,!0);i.push(s.range.map(u)),r=r.compose(l),o=eX.mapEffects(o,l).concat(eX.mapEffects(e0(s.effects),u))}return{changes:r,selection:ex.create(i,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ef?e:ef.of(e,this.doc.length,this.facet(e3.lineSeparator))}toText(e){return Z.of(e.split(this.facet(e3.lineSeparator)||ec))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(eB(this,t),eF(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof eA&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let i=n[t],o=e[t];r.push(i.init(e=>i.spec.fromJSON(o,e)))}}return e3.create({doc:e.doc,selection:ex.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=eN.resolve(e.extensions||[],new Map),n=e.doc instanceof Z?e.doc:Z.of((e.doc||"").split(t.staticFacet(e3.lineSeparator)||ec)),r=e.selection?e.selection instanceof ex?e.selection:ex.single(e.selection.anchor,e.selection.head):ex.single(0);return eS(r,n.length),t.staticFacet(eU)||(r=r.asSingle()),new e3(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e3.tabSize)}get lineBreak(){return this.facet(e3.lineSeparator)||"\n"}get readOnly(){return this.facet(eH)}phrase(e,...t){for(let t of this.facet(e3.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(ej))for(let o of i(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){var n;let r=this.languageDataAt("wordChars",e);return n=r.length?r[0]:"",e=>{if(!/\S/.test(e))return e1.Space;if(function(e){if(t)return t.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||e2.test(n)))return!0}return!1}(e))return e1.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return e1.Word;return e1.Other}}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let e=es(t,o,!1);if(i(t.slice(e,o))!=e1.Word)break;o=e}for(;s<r;){let e=es(t,s);if(i(t.slice(s,e))!=e1.Word)break;s=e}return o==s?null:ex.range(o+n,s+n)}}function e4(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],o=r[e];if(void 0===o)r[e]=i;else if(o===i||void 0===i);else if(Object.hasOwnProperty.call(n,e))r[e]=n[e](o,i);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}e3.allowMultipleSelections=eU,e3.tabSize=e_.define({combine:e=>e.length?e[0]:4}),e3.lineSeparator=eq,e3.readOnly=eH,e3.phrases=e_.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),e3.languageData=ej,e3.changeFilter=eW,e3.transactionFilter=ez,e3.transactionExtender=eV,eD.reconfigure=eX.define();class e8{eq(e){return this==e}range(e,t=e){return e5.create(e,t,this)}}function e6(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}e8.prototype.startSide=e8.prototype.endSide=0,e8.prototype.point=!1,e8.prototype.mapMode=eh.TrackDel;class e5{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new e5(e,t,n)}}function e9(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class e7{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let o=r,s=i.length;;){if(o==s)return o;let r=o+s>>1,a=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==o)return a>=0?o:s;a>=0?s=r:o=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,i);i<o;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}map(e,t){let n=[],r=[],i=[],o=-1,s=-1;for(let a=0;a<this.value.length;a++){let l=this.value[a],u=this.from[a]+e,c=this.to[a]+e,h,d;if(u==c){let e=t.mapPos(u,l.startSide,l.mapMode);if(null==e||(h=d=e,l.startSide!=l.endSide&&(d=t.mapPos(u,l.endSide))<h))continue}else if((h=t.mapPos(u,l.startSide))>(d=t.mapPos(c,l.endSide))||h==d&&l.startSide>0&&l.endSide<=0)continue;0>(d-h||l.endSide-l.startSide)||(o<0&&(o=h),l.point&&(s=Math.max(s,d-h)),n.push(l),r.push(h-o),i.push(d-o))}return{mapped:n.length?new e7(r,i,n,s):null,pos:o}}}class te{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new te(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:i=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(n&&(t=t.slice().sort(e9)),this.isEmpty)return t.length?te.of(t):this;let s=new tr(this,null,-1).goto(0),a=0,l=[],u=new tt;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];u.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(s.chunkIndex)||i<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||r>s.to||i<s.from||o(s.from,s.to,s.value))&&!u.addInner(s.from,s.to,s.value)&&l.push(e5.create(s.from,s.to,s.value)),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?te.empty:this.nextLayer.update({add:l,filter:o,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i],a=e.touchesRange(o,o+s.length);if(!1===a)r=Math.max(r,s.maxPoint),t.push(s),n.push(e.mapPos(o));else if(!0===a){let{mapped:i,pos:a}=s.map(o,e);i&&(r=Math.max(r,i.maxPoint),t.push(i),n.push(a))}}let i=this.nextLayer.map(e);return 0==t.length?i:new te(n,t,i||te.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],o=this.chunk[r];if(t>=i&&e<=i+o.length&&!1===o.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return ti.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ti.from(e).goto(t)}static compare(e,t,n,r,i=-1){let o=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),a=tn(o,s,n),l=new ts(o,a,i),u=new ts(s,a,i);n.iterGaps((e,t,n)=>ta(l,e,u,t,n,r)),n.empty&&0==n.length&&ta(l,0,u,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=0x3b9ac9ff);let i=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),o=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(i.length!=o.length)return!1;if(!i.length)return!0;let s=tn(i,o),a=new ts(i,s,0).goto(n),l=new ts(o,s,0).goto(n);for(;;){if(a.to!=l.to||!tl(a.active,l.active)||a.point&&(!l.point||!e6(a.point,l.point)))return!1;if(a.to>r)return!0;a.next(),l.next()}}static spans(e,t,n,r,i=-1){let o=new ts(e,null,i).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,n);if(o.point){let n=o.activeForPoint(o.to),i=o.pointFrom<t?n.length+1:o.point.startSide<0?n.length:Math.min(n.length,a);r.point(s,e,o.point,n,i,o.pointRank),a=Math.min(o.openEnd(e),n.length)}else e>s&&(r.span(s,e,o.active,a),a=o.openEnd(e));if(o.to>n)return a+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,t=!1){let n=new tt;for(let r of e instanceof e5?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(e9(t,r)>0)return e.slice().sort(e9);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return te.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=te.empty;r=r.nextLayer)t=new te(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}te.empty=new te([],[],null,-1),te.empty.nextLayer=te.empty;class tt{finishChunk(e){this.chunks.push(new e7(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new tt)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(te.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=te.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function tn(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=r.get(e.chunk[t]);null==o||(n?n.mapPos(o):o)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(o,o+e.chunk[t].length))||i.add(e.chunk[t])}return i}class tr{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class ti{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let i=0;i<e.length;i++)for(let o=e[i];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new tr(o,t,n,i));return 1==r.length?r[0]:new ti(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)to(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)to(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),to(this.heap,0)}}}function to(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),0>n.compare(i))break;e[r]=n,e[t]=i,t=r}}class ts{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ti.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){tu(this.active,e),tu(this.activeTo,e),tu(this.activeRank,e),this.minActive=th(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;tc(this.active,t,n),tc(this.activeTo,t,r),tc(this.activeRank,t,i),e&&tc(e,t,this.cursor.from),this.minActive=th(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&tu(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(e.point)if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}else this.addActive(n),this.cursor.next()}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function ta(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t,u=!!o.boundChange;for(let t=!1;;){let r=e.to+l-n.to,i=r||e.endSide-n.endSide,c=i<0?e.to+l:n.to,h=Math.min(c,s);if(e.point||n.point?(e.point&&n.point&&e6(e.point,n.point)&&tl(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,h,e.point,n.point),t=!1):(t&&o.boundChange(a),h>a&&!tl(e.active,n.active)&&o.compareRange(a,h,e.active,n.active),u&&h<s&&(r||e.openEnd(c)!=n.openEnd(c))&&(t=!0)),c>s)break;a=c,i<=0&&e.next(),i>=0&&n.next()}}function tl(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e6(e[n],t[n]))return!1;return!0}function tu(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function tc(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function th(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)0>(t[i]-r||e[i].endSide-e[n].endSide)&&(n=i,r=t[i]);return n}function td(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=es(e,i));return r}function tf(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=es(e,r)}return!0===r?-1:e.length}e.s(["Annotation",()=>eQ,"ChangeDesc",()=>ed,"ChangeSet",()=>ef,"CharCategory",()=>e1,"Compartment",()=>eD,"EditorSelection",()=>ex,"EditorState",()=>e3,"Facet",()=>e_,"MapMode",()=>eh,"Prec",()=>eM,"RangeSet",()=>te,"RangeSetBuilder",()=>tt,"RangeValue",()=>e8,"StateEffect",()=>eX,"StateField",()=>eA,"Text",()=>Z,"Transaction",()=>eG,"codePointAt",()=>ea,"codePointSize",()=>eu,"combineConfig",()=>e4,"countColumn",()=>td,"findClusterBreak",()=>es,"findColumn",()=>tf,"fromCodePoint",()=>el],384510);let tp="u"<typeof Symbol?"__ͼ":Symbol.for("ͼ"),tg="u"<typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),tm="u">typeof globalThis?globalThis:"u">typeof window?window:{};class tv{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,i,o,s){let a=[],l=/^@(\w+)\b/.exec(t[0]),u=l&&"keyframes"==l[1];if(l&&null==i)return o.push(t[0]+";");for(let n in i){let s=i[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),s,o);else if(s&&"object"==typeof s){if(!l)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(r(n),s,a,u)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+s+";")}(a.length||u)&&o.push((n&&!l&&!s?t.map(n):t).join(", ")+" {"+a.join(" ")+"}")}(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=tm[tp]||1;return tm[tp]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[tg],i=n&&n.nonce;r?i&&r.setNonce(i):r=new tb(e,i),r.mount(Array.isArray(t)?t:[t],e)}}let ty=new Map;class tb{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=ty.get(n);if(t)return e[tg]=t;this.sheet=new r.CSSStyleSheet,ty.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[tg]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),i--,s=-1),-1==s){if(this.modules.splice(i++,0,o),n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}e.s(["StyleModule",()=>tv],329037);for(var tw={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},tx={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tS="u">typeof navigator&&/Mac/.test(navigator.platform),tk="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),t_=0;t_<10;t_++)tw[48+t_]=tw[96+t_]=String(t_);for(var t_=1;t_<=24;t_++)tw[t_+111]="F"+t_;for(var t_=65;t_<=90;t_++)tw[t_]=String.fromCharCode(t_+32),tx[t_]=String.fromCharCode(t_);for(var tO in tw)tx.hasOwnProperty(tO)||(tx[tO]=tw[tO]);function tC(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let tE="u">typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},tT="u">typeof document?document:{documentElement:{style:{}}},tP=/Edge\/(\d+)/.exec(tE.userAgent),tA=/MSIE \d/.test(tE.userAgent),tR=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tE.userAgent),tM=!!(tA||tR||tP),tI=!tM&&/gecko\/(\d+)/i.test(tE.userAgent),tD=!tM&&/Chrome\/(\d+)/.exec(tE.userAgent),tL="webkitFontSmoothing"in tT.documentElement.style,tN=!tM&&/Apple Computer/.test(tE.vendor),tB=tN&&(/Mobile\/\w+/.test(tE.userAgent)||tE.maxTouchPoints>2);var tF={mac:tB||/Mac/.test(tE.platform),windows:/Win/.test(tE.platform),linux:/Linux|X11/.test(tE.platform),ie:tM,ie_version:tA?tT.documentMode||6:tR?+tR[1]:tP?+tP[1]:0,gecko:tI,gecko_version:tI?+(/Firefox\/(\d+)/.exec(tE.userAgent)||[0,0])[1]:0,chrome:!!tD,chrome_version:tD?+tD[1]:0,ios:tB,android:/Android\b/.test(tE.userAgent),webkit:tL,webkit_version:tL?+(/\bAppleWebKit\/(\d+)/.exec(tE.userAgent)||[0,0])[1]:0,safari:tN,safari_version:tN?+(/\bVersion\/(\d+(\.\d+)?)/.exec(tE.userAgent)||[0,0])[1]:0,tabSize:null!=tT.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};function tj(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}let tU=Object.create(null);function tq(e,t,n){if(e==t)return!0;e||(e=tU),t||(t=tU);let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(-1==i.indexOf(o)||e[o]!==t[o]))return!1;return!0}function tW(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,"style"==i?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,"style"==i?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}class tz{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return -1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var tV=((s=tV||(tV={}))[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s);class tH extends e8{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new tQ(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new tK(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:o}=tX(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new tK(e,n,r,t,e.widget||null,!0)}static line(e){return new t$(e)}static set(e,t=!1){return te.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}tH.none=te.empty;class tQ extends tH{constructor(e){let{start:t,end:n}=tX(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?tj(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||tU}eq(e){return this==e||e instanceof tQ&&this.tagName==e.tagName&&tq(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw RangeError("Mark decorations may not be empty");return super.range(e,t)}}tQ.prototype.point=!1;class t$ extends tH{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t$&&this.spec.class==e.spec.class&&tq(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}t$.prototype.mapMode=eh.TrackBefore,t$.prototype.point=!0;class tK extends tH{constructor(e,t,n,r,i,o){super(t,n,i,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?eh.TrackBefore:eh.TrackAfter:eh.TrackDel}get type(){return this.startSide!=this.endSide?tV.WidgetRange:this.startSide<=0?tV.WidgetBefore:tV.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){var t,n;return e instanceof tK&&(t=this.widget,t==(n=e.widget)||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function tX(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function tG(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}tK.prototype.point=!0;class tZ extends e8{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof tZ&&this.tagName==e.tagName&&tq(this.attributes,e.attributes)}static create(e){return new tZ(e.tagName,e.attributes||tU)}static set(e,t=!1){return te.of(e,t)}}function tY(e){return(11==e.nodeType?e.getSelection?e:e.ownerDocument:e).getSelection()}function tJ(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function t0(e,t){if(!t.anchorNode)return!1;try{return tJ(e,t.anchorNode)}catch(e){return!1}}function t1(e){return 3==e.nodeType?nn(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function t2(e,t,n,r){return!!n&&(t8(e,t,n,r,-1)||t8(e,t,n,r,1))}function t3(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function t4(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function t8(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:t6(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=t3(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType||1==(e=e.childNodes[t+(i<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=i<0?t6(e):0}}}function t6(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function t5(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function t9(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||1>Math.abs(t.width-e.offsetWidth))&&(n=1),(r>.995&&r<1.005||!isFinite(r)||1>Math.abs(t.height-e.offsetHeight))&&(r=1),{scaleX:n,scaleY:r}}tZ.prototype.startSide=tZ.prototype.endSide=-1;class t7{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?t6(t):0),n,Math.min(e.focusOffset,n?t6(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let ne=null;function nt(e){if(e.setActive)return e.setActive();if(ne)return e.focus(ne);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==ne?{get preventScroll(){return ne={preventScroll:!0},!0}}:void 0),!ne){ne=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function nn(e,t,r=t){let i=n||(n=document.createRange());return i.setEnd(e,r),i.setStart(e,t),i}function nr(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function ni(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function no(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r>0)return{node:n,offset:r};else if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;r=t6(n=n.childNodes[r-1])}else{if(!n.parentNode||t4(n))return null;r=t3(n),n=n.parentNode}}function ns(e,t){for(let n=e,r=t;;)if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};else if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||t4(n))return null;r=t3(n)+1,n=n.parentNode}}tF.safari&&tF.safari_version>=26&&(ne=!1);class na{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new na(e.parentNode,t3(e),t)}static after(e,t){return new na(e.parentNode,t3(e)+1,t)}}var nl=((a=nl||(nl={}))[a.LTR=0]="LTR",a[a.RTL=1]="RTL",a);let nu=nl.LTR,nc=nl.RTL;function nh(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}let nd=nh("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),nf=nh("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),np=Object.create(null),ng=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);np[t]=n,np[n]=-t}function nm(e){return e<=247?nd[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?nf[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}let nv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ny{get dir(){return this.level%2?nc:nu}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==n)return o;(i<0||(0!=r?r<0?s.from<t:s.to>t:e[i].level>s.level))&&(i=o)}}if(i<0)throw RangeError("Index out of range");return i}}let nb=[];function nw(e){return[new ny(0,e,0)]}let nx="",nS=e_.define(),nk=e_.define(),n_=e_.define(),nO=e_.define(),nC=e_.define(),nE=e_.define(),nT=e_.define(),nP=e_.define(),nA=e_.define(),nR=e_.define({combine:e=>e.some(e=>e)}),nM=e_.define({combine:e=>e.some(e=>e)}),nI=e_.define();class nD{constructor(e,t="nearest",n="nearest",r=5,i=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=o}map(e){return e.empty?this:new nD(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new nD(ex.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}let nL=eX.define({map:(e,t)=>e.map(t)}),nN=eX.define();function nB(e,t,n){let r=e.facet(nO);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}let nF=e_.define({combine:e=>!e.length||e[0]}),nj=0,nU=e_.define({combine:e=>e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})});class nq{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(nU.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(nU.of({plugin:this,arg:e}))}static define(e,t){let{eventHandlers:n,eventObservers:r,provide:i,decorations:o}=t||{};return new nq(nj++,e,n,r,e=>{let t=[];return o&&t.push(nH.of(t=>{let n=t.plugin(e);return n?o(n):tH.none})),i&&t.push(i(e)),t})}static fromClass(e,t){return nq.define((t,n)=>new e(t,n),t)}}class nW{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(nB(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){nB(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null==(t=this.value)?void 0:t.destroy)try{this.value.destroy()}catch(t){nB(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}let nz=e_.define(),nV=e_.define(),nH=e_.define(),nQ=e_.define(),n$=e_.define(),nK=e_.define(),nX=e_.define();function nG(e,t){let n=e.state.facet(nX);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return te.spans(r,t.from,t.to,{point(){},span(e,n,r,o){let s=e-t.from,a=n-t.from,l=i;for(let e=r.length-1;e>=0;e--,o--){let n=r[e].spec.bidiIsolate,i;if(null==n&&(n=function(e,t,n){for(let r=t;r<n;r++){let t=nm(e.charCodeAt(r));if(1==t)break;if(2==t||4==t)return nc}return nu}(t.text,s,a)),o>0&&l.length&&(i=l[l.length-1]).to==s&&i.direction==n)i.to=a,l=i.inner;else{let e={from:s,to:a,direction:n,inner:[]};l.push(e),l=e.inner}}}}),i}let nZ=e_.define();function nY(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(nZ)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(r=Math.max(r,s.top)),null!=s.bottom&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}let nJ=e_.define();class n0{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new n0(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,i=0,o=0;;){let s=Math.min(r<e.length?e[r].fromB:1e9,i<t.length?t[i]:1e9);if(1e9==s)break;let a=s+o,l=s,u=a;for(;;)if(i<t.length&&t[i]<=l){let n=t[i+1];i+=2,l=Math.max(l,n);for(let t=r;t<e.length&&e[t].fromB<=l;t++)o=e[t].toA-e[t].toB;u=Math.max(u,n+o)}else if(r<e.length&&e[r].fromB<=l){let t=e[r++];l=Math.max(l,t.toB),u=Math.max(u,t.toA),o=t.toA-t.toB}else break;n.push(new n0(a,u,s,l))}return n}}class n1{constructor(e,t,n){for(let r of(this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ef.empty(this.startState.doc.length),n))this.changes=this.changes.compose(r.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new n0(e,t,n,i))),this.changedRanges=r}static create(e,t,n){return new n1(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}let n2=[];class n3{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return 1&this.flags}get children(){return n2}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,4&this.flags){this.flags&=-5;let e=this.domAttrs;e&&function(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;null==t[r]&&e.removeAttribute(r)}for(let n in t){let r=t[n];"style"==n?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=t3(this.dom),r=this.length?e>0:t>0;return new na(this.parent.dom,n+ +!!r,0==e||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&2&this.parent.flags&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof n6)return e;return null}static get(e){return e.cmTile}}class n4 extends n3{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(2&this.flags)return;super.sync(e);let t=this.dom,n=null,r,i=(null==e?void 0:e.node)==t?e:null,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=s.dom&&(i.written=!0),s.dom.parentNode==t)for(;r&&r!=s.dom;)r=n8(r);else t.insertBefore(s.dom,r);n=s.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=n8(r);this.length=o}}function n8(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class n6 extends n4{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=n3.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;(n=n.parent).breakAfter&&i++,r=t.pop()}else{let o=n.children[r++];if(o instanceof n5)t.push(r),n=o,r=0;else{let t=i+o.length,n=e(o,i);if(void 0!==n)return n;i=t+o.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,o=-1;if(this.blockTiles((s,a)=>{let l=a+s.length;if(e>=a&&e<=l){if(s.isWidget()&&t>=-1&&t<=1){if(32&s.flags)return!0;16&s.flags&&(n=void 0)}(a<e||e==l&&(t<-1?s.length:s.covers(1)))&&(!n||!s.isWidget()&&n.isWidget())&&(n=s,r=e-a),(l>e||e==a&&(t>1?s.length:s.covers(-1)))&&(!i||!s.isWidget()&&i.isWidget())&&(i=s,o=e-a)}}),!n&&!i)throw Error("No tile at position "+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:o}}}class n5 extends n4{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return!!this.children.length&&(e<0?this.children[0].covers(-1):this.lastChild.covers(1))}get domAttrs(){return this.wrapper.attributes}static of(e,t){let n=new n5(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class n9 extends n4{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,n){let r=new n9(t||document.createElement("div"),e);return t&&n||(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,o=null,s=-1;!function e(a,l){for(let u=0,c=0;u<a.children.length&&c<=l;u++){let h=a.children[u],d=c+h.length;d>=l&&(h.isComposite()?e(h,l-c):(!o||o.isHidden&&(t>0||n&&function(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}(o,h)))&&(d>l||32&h.flags)?(o=h,s=l-c):(c<l||16&h.flags&&!h.isHidden)&&(r=h,i=l-c)),c=d}}(this,e);let a=(t<0?r:o)||r||o;return a?{tile:a,offset:a==r?i:s}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=t1(t);return n[n.length-1]||null}(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new na(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,16&e.flags?1:32&e.flags?-1:t);let i=n.tile.parent,o=!1;for(let e of i.children){if(o)return new na(e.dom,0);e==n.tile&&(o=!0)}}return new na(this.dom,0)}}class n7 extends n4{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let n=new n7(t||document.createElement(e.tagName),e);return t||(n.flags|=4),n}}class re extends n3{constructor(e,t){super(e,t.length),this.text=t}sync(e){2&this.flags||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,o=0;0==e&&t<0||e==n&&t>=0?!(tF.chrome||tF.gecko)&&(e?(r--,o=1):i<n&&(i++,o=-1)):t<0?r--:i<n&&i++;let s=nn(this.dom,r,i).getClientRects();if(!s.length)return null;let a=s[(o?o<0:t>=0)?0:s.length-1];return tF.safari&&!o&&0==a.width&&(a=Array.prototype.find.call(s,e=>e.width)||a),o?t5(a,o<0):a||null}static of(e,t){let n=new re(t||document.createTextNode(e),e);return t||(n.flags|=2),n}}class rt extends n3{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return!(48&this.flags)&&(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return t5(this.dom.getBoundingClientRect(),this.length?0==e:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=!!(16&this.flags)||!(32&this.flags)&&e>0;for(let i=r?t.length-1:0;n=t[i],e>0?0!=i:i!=t.length-1&&!(n.top<n.bottom);i+=r?-1:1);return t5(n,!r)}}get overrideDOMText(){if(!this.length)return Z.empty;let{root:e}=this;if(!e)return Z.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,n,r,i){return!i&&(i=e.toDOM(t),e.editable||(i.contentEditable="false")),new rt(i,n,e,r)}}class rn extends n3{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Z.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class rr{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:o,parents:s}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(i==r.children.length){if(!e&&!s.length)break;n&&n.leave(r),o=!!r.breakAfter,({tile:r,index:i}=s.pop()),i++}else{let a=r.children[i],l=a.breakAfter;(t>0?a.length<=e:a.length<e)&&(!n||!1!==n.skip(a,0,a.length)||!a.isComposite)?(o=!!l,i++,e-=a.length):(s.push({tile:r,index:i}),r=a,i=0,n&&a.isComposite()&&n.enter(a))}else if(i==r.length)o=!!r.breakAfter,({tile:r,index:i}=s.pop()),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;return this.tile=r,this.index=i,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class ri{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}}class ro{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){var i;this.flushBuffer();let o=this.ensureMarks(t,n),s=o.lastChild;s&&s.isText()&&!(8&s.flags)?(this.cache.reused.set(s,2),(o.children[o.children.length-1]=new re(s.dom,s.text+e)).parent=o):o.append(r||re.of(e,null==(i=this.cache.find(re))?void 0:i.dom)),this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?rd(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof n7&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(rd(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=n3.get(n.dom);e&&e.setDOM(rd(n.dom))}let e=n7.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=n3.get(e.text);i&&this.cache.reused.set(i,2);let o=new re(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,t,n){let r=this.afterWidget&&48&e.flags&&(48&this.afterWidget.flags)==(48&e.flags);r||this.flushBuffer();let i=this.ensureMarks(t,n);r||16&e.flags||i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var n;e||(e=rh);let r=n9.start(e,t||(null==(n=this.cache.find(n9))?void 0:n.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var n;let r=this.curLine;for(let i=e.length-1;i>=0;i--){let o=e[i],s;if(t>0&&(s=r.lastChild)&&s instanceof n7&&s.mark.eq(o))r=s,t--;else{let e=n7.of(o,null==(n=this.cache.find(n7,e=>e.mark.eq(o)))?void 0:n.dom);r.append(e),r=e,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!rc(this.curLine,!1)||"BR"!=e.dom.nodeName&&e.isWidget()&&!(tF.ios&&rc(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(rp,0,32)||new rt(rp.toDOM(),0,rp,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new ri(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&0>(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to);)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let n of this.wrappers){let r=t.lastChild;if(n.from<this.pos&&r instanceof n5&&r.wrapper.eq(n.wrapper))t=r;else{let r=n5.of(n.wrapper,null==(e=this.cache.find(n5,e=>e.wrapper.eq(n.wrapper)))?void 0:e.dom);t.append(r),t=r}}return t}blockPosCovered(){let e=this.lastBlock;return null!=e&&!e.breakAfter&&(!e.isWidget()||(160&e.flags)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(rn,void 0,1);return n&&(n.flags=t),n||new rn(t)}flushBuffer(){this.afterWidget&&!(32&this.afterWidget.flags)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class rs{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error("Ran out of text content when drawing inline views");this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}}let ra=[rt,n9,re,n7,rn,n5,n6];for(let e=0;e<ra.length;e++)ra[e].bucket=e;class rl{constructor(e){this.view=e,this.buckets=ra.map(()=>[]),this.index=ra.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],o=this.index[r];for(let e=i.length-1;e>=0;e--){let s=(e+o)%i.length,a=i[s];if((!t||t(a))&&!this.reused.has(a))return i.splice(s,1),s<o&&this.index[r]--,this.reused.set(a,n),a}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,o=0;;i++){if(i==r.length){if(o)return null;o=1,i=0}let s=r[i];if(!this.reused.has(s)&&(0==o?s.widget.compare(e):s.widget.constructor==e.constructor&&e.updateDOM(s.dom,this.view))){if(r.splice(i,1),i<this.index[0]&&this.index[0]--,s.widget==e&&s.length==t&&(497&s.flags)==n)return this.reused.set(s,1),s;return this.reused.set(s,2),new rt(s.dom,t,e,-498&s.flags|n)}}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class ru{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new rl(e),this.text=new rs(e.state.doc),this.builder=new ro(this.cache,new n6(e,e.contentDOM),te.iter(n)),this.cache.reused.set(t,2),this.old=new rr(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,o=0;;){let s=o<e.length?e[o++]:null,a=s?s.fromA:this.old.root.length;if(a>r){let e=a-r;this.preserve(e,!o,!s),r=a,i+=e}if(!s)break;t&&s.fromA<=t.range.fromA&&s.toA>=t.range.toA?(this.forward(s.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,s.toA),this.emit(t.range.toB,s.toB)):(this.forward(s.fromA,s.toA),this.emit(i,s.toB)),i=s.toB,r=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=function(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof n7&&t.push(r.mark)}return t}(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let o=n>0||t<e.length?rt.of(e.widget,this.view,n-t,496&e.flags,this.cache.maybeReuse(e)):this.cache.reuse(e);256&o.flags?(o.flags&=-2,this.builder.addBlockWidget(o)):(this.builder.ensureLine(null),this.builder.addInlineWidget(o,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),t||n!=e.length?(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)):this.builder.addText(e.text,r,i,this.cache.reuse(e)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof rn)this.cache.add(e);else{if(!(e instanceof n7))return!1;this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length}this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof n7&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&(r.length=i=0):e instanceof n7&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,o=te.spans(this.decorations,e,t,{point:(e,t,o,s,a,l)=>{var u,c,h;if(o instanceof tK){if(this.disallowBlockEffectsFor[l]){if(o.block)throw RangeError("Block decorations may not be specified via plugins");if(t>this.view.state.doc.lineAt(e).to)throw RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=s.length,a>s.length)r.continueWidget(t-e);else{let i,l=o.widget||(o.block?rf.block:rf.inline),c=(i=(u=o).isReplace?64*(u.startSide<0)|128*(u.endSide>0):u.startSide>0?32:16,u.block&&(i|=256),i),h=this.cache.findWidget(l,t-e,c)||rt.of(l,this.view,t-e,c);o.block?(o.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(h)):(r.ensureLine(n),r.addInlineWidget(h,s,a))}n=null}else{let e,t;c=n,e=(h=o).spec.attributes,t=h.spec.class,(e||t)&&(c||(c={class:"cm-line"}),e&&tj(e,c),t&&(c.class+=" "+t)),n=c}t>e&&this.text.skip(t-e)},span:(e,t,i,o)=>{for(let s=e;s<t;){let e=this.text.next(Math.min(512,t-s));null==e?(r.addLineStartIfNotCovered(n),r.addBreak(),s++):(r.ensureLine(n),r.addText(e,i,o),s+=e.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=o>i,this.openMarks=o}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=n3.get(r);if(r==this.view.contentDOM)break;e instanceof n7?t.push(e):(null==e?void 0:e.isLine())?n=e:"DIV"!=r.nodeName||n||r==this.view.contentDOM?t.push(n7.of(new tQ({tagName:r.nodeName.toLowerCase(),attributes:function(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}(r)}),r)):n=new n9(r,rh)}return{line:n,marks:t}}}function rc(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}let rh={class:"cm-line"};function rd(e){let t=n3.get(e);return t&&t.setDOM(e.cloneNode()),e}class rf extends tz{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}rf.inline=new rf("span"),rf.block=new rf("div");let rp=new class extends tz{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class rg{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=tH.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new n6(e,e.contentDOM),this.updateInner([new n0(0,0,0,e.state.doc.length)],null)}update(e){var t,n,r,i,o,s,a,l,u;let c,h,d,f=e.changedRanges;this.minWidth>0&&f.length&&(f.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let p=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null==(t=this.domChanged)?void 0:t.newSel)?p=this.domChanged.newSel.head:(n=e.changes,r=this.hasComposition,c=!1,r&&n.iterChangedRanges((e,t)=>{e<r.to&&t>r.from&&(c=!0)}),c||e.selectionSet||(p=e.state.selection.main.head)));let g=p>-1?function(e,t,n){let r=rv(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc;return{range:new n0(l.mapPos(o),l.mapPos(s),o,s),text:i}}(this.view,e.changes,p):null;if(this.domChanged=null,this.hasComposition){let{from:t,to:n}=this.hasComposition;f=new n0(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(f.slice())}this.hasComposition=g?{from:g.range.fromB,to:g.range.toB}:null,(tF.ie||tF.chrome)&&!g&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let m=this.decorations,v=this.blockWrappers;this.updateDeco();let y=(i=m,o=this.decorations,s=e.changes,h=new ry,te.compare(i,o,s,h),h.changes);y.length&&(f=n0.extendWithRanges(f,y));let b=(a=v,l=this.blockWrappers,u=e.changes,d=new rb,te.compare(a,l,u,d),d.changes);return b.length&&(f=n0.extendWithRanges(f,b)),g&&!f.some(e=>e.fromA<=g.range.fromA&&e.toA>=g.range.toA)&&(f=g.range.addToSet(f.slice())),(!(2&this.tile.flags)||0!=f.length)&&(this.updateInner(f,g),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new ru(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=r.run(e,t),rm(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=tF.chrome||tF.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof rw&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){for(let t of(this.editContextFormatting=this.editContextFormatting.map(e.changes),e.transactions))for(let e of t.effects)e.is(nN)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){var n;(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,o=i==r,s=!o&&!(this.view.state.facet(nF)||r.tabIndex>-1)&&t0(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(o||t||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,u,c;if(l.empty?c=u=this.inlineDOMNearPos(l.anchor,l.assoc||1):(c=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),u=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),tF.gecko&&l.empty&&!this.hasComposition&&1==(n=u).node.nodeType&&n.node.firstChild&&(0==n.offset||"false"==n.node.childNodes[n.offset-1].contentEditable)&&(n.offset==n.node.childNodes.length||"false"==n.node.childNodes[n.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(e,u.node.childNodes[u.offset]||null)),u=c=new na(e,0),a=!0}let h=this.view.observer.selectionRange;!a&&h.focusNode&&(t2(u.node,u.offset,h.anchorNode,h.anchorOffset)&&t2(c.node,c.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,l))||(this.view.observer.ignore(()=>{tF.android&&tF.chrome&&r.contains(h.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(h.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let e=tY(this.view.root);if(e)if(l.empty){if(tF.gecko){var t,n;let e=(t=u.node,n=u.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|2*(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable));if(e&&3!=e){let t=(1==e?no:ns)(u.node,u.offset);t&&(u=new na(t.node,t.offset))}}e.collapse(u.node,u.offset),null!=l.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=l.bidiLevel)}else if(e.extend){e.collapse(u.node,u.offset);try{e.extend(c.node,c.offset)}catch(e){}}else{let t=document.createRange();l.anchor>l.head&&([u,c]=[c,u]),t.setEnd(c.node,c.offset),t.setStart(u.node,u.offset),e.removeAllRanges(),e.addRange(t)}s&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new na(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new na(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&t2(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=tY(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return 2&this.tile.dom.compareDocumentPosition(e)?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=0==t6(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!n3.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,o,s=-1,a=!1;return(this.tile.blockTiles((t,l)=>{if(t.isWidget()){if(32&t.flags&&l>=e)return!0;16&t.flags&&(i=!0)}else{let u=l+t.length;if(l<=e&&(n=t,r=e-l,i=u<e),u>=e&&!o&&(o=t,s=e-l,a=l>e),l>e&&o)return!0}}),n||o)?(i&&o?n=null:a&&n&&(o=null),n&&t<0||!o?n.domIn(r,t):o.domIn(s,t)):this.domAtPos(e,t)}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof rw?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);return t.isLine()?function e(t,n){if(t.isComposite())for(let r of t.children){if(r.length>=n){let t=e(r,n);if(t)return t}if((n-=r.length)<0)break}else if(t.isText()&&n<t.length){let e=es(t.text,n);if(e==n)return null;let r=nn(t.dom,n,e).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}(t,n):null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,o=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==nl.LTR,l=0,u=(e,c,h)=>{for(let d=0;d<e.children.length&&!(c>r);d++){let r=e.children[d],f=c+r.length,p=r.dom.getBoundingClientRect(),{height:g}=p;if(h&&!d&&(l+=p.top-h.top),r instanceof n5)f>n&&u(r,c,p);else if(c>=n&&(l>0&&t.push(-l),t.push(g+l),l=0,o)){let e=r.dom.lastChild,t=e?t1(e):[];if(t.length){let e=t[t.length-1],n=a?e.right-p.left:p.right-e.left;n>s&&(s=n,this.minWidth=i,this.minWidthFrom=c,this.minWidthTo=f)}}h&&d==e.children.length-1&&(l+=h.bottom-p.bottom),c=f+r.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return"rtl"==getComputedStyle(t.dom).direction?nl.RTL:nl.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=t1(r.dom);if(1!=e.length)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement("div"),n,r,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=t1(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],o=i?i.from-1:this.view.state.doc.length;if(o>n){let r=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(tH.replace({widget:new rw(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!i)break;n=i.to+1}return tH.set(e)}updateDeco(){let e=1,t=this.view.state.facet(nH).map(t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t),n=!1,r=this.view.state.facet(n$).map((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(te.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(nQ).map(e=>"function"==typeof e?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(nI))try{if(t(this.view,e.range,e))return!0}catch(e){nB(this.view.state,e,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=nY(this.view),o={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,r,i,o,s,a){let l=e.ownerDocument,u=l.defaultView||window;for(let c=e,h=!1;c&&!h;)if(1==c.nodeType){let e,d=c==l.body,f=1,p=1;if(d)e=function(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let t=c.getBoundingClientRect();({scaleX:f,scaleY:p}=t9(c,t)),e={left:t.left,right:t.left+c.clientWidth*f,top:t.top,bottom:t.top+c.clientHeight*p}}let g=0,m=0;if("nearest"==i)t.top<e.top?(m=t.top-(e.top+s),n>0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+s)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+s,n<0&&t.top-m<e.top&&(m=t.top-(e.top+s)));else{let r=t.bottom-t.top,o=e.bottom-e.top;m=("center"==i&&r<=o?t.top+r/2-o/2:"start"==i||"center"==i&&n<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==r?t.left<e.left?(g=t.left-(e.left+o),n>0&&t.right>e.right+g&&(g=t.right-e.right+o)):t.right>e.right&&(g=t.right-e.right+o,n<0&&t.left<e.left+g&&(g=t.left-(e.left+o))):g=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==a?t.left-o:t.right-(e.right-e.left)+o)-e.left,g||m)if(d)u.scrollBy(g,m);else{let e=0,n=0;if(m){let e=c.scrollTop;c.scrollTop+=m/p,n=(c.scrollTop-e)*p}if(g){let t=c.scrollLeft;c.scrollLeft+=g/f,e=(c.scrollLeft-t)*f}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&1>Math.abs(e-g)&&(r="nearest"),n&&1>Math.abs(n-m)&&(i="nearest")}if(d)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),c=c.assignedSlot||c.parentNode}else if(11==c.nodeType)c=c.host;else break}(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==nl.LTR)}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){rm(this.tile)}}function rm(e,t){let n=null==t?void 0:t.get(e);if(1!=n)for(let r of(null==n&&e.destroy(),e.children))rm(r,t)}function rv(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=no(n.focusNode,n.focusOffset),i=ns(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let t=n3.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let e=n3.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}let ry=class{constructor(){this.changes=[]}compareRange(e,t){tG(e,t,this.changes)}comparePoint(e,t){tG(e,t,this.changes)}boundChange(e){tG(e,e,this.changes)}};class rb{constructor(){this.changes=[]}compareRange(e,t){tG(e,t,this.changes)}comparePoint(){}boundChange(e){tG(e,e,this.changes)}}class rw extends tz{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function rx(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==tV.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function rS(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let t=function(e,t,n,r,i){var o;let s=r.head-e.from,a=ny.find(t,s,null!=(o=r.bidiLevel)?o:-1,r.assoc),l=t[a],u=l.side(i,n);if(s==u){let e=a+=i?1:-1;if(e<0||e>=t.length)return null;s=(l=t[a=e]).side(!i,n),u=l.side(i,n)}let c=es(e.text,s,l.forward(i,n));(c<l.from||c>l.to)&&(c=u),nx=e.text.slice(Math.min(s,c),Math.max(s,c));let h=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return h&&c==u&&h.level+ +!i<l.level?ex.cursor(h.side(!i,n)+e.from,h.forward(i,n)?1:-1,h.level):ex.cursor(c+e.from,l.forward(i,n)?-1:1,l.level)}(i,o,s,a,n),u=nx;if(!t){if(i.number==(n?e.state.doc.lines:1))return a;u="\n",i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return t;l=r(u)}a=t}}function rk(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,o)=>{if(t>e&&t<i){let o=r||n||(t-e<i-t?-1:1);t=o<0?e:i,r=o}});if(!r)return t}}function r_(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let t=rk(e,i.from,0);t!=i.from&&(o=ex.cursor(t,-1))}else{let t=rk(e,i.from,-1),n=rk(e,i.to,1);(t!=i.from||n!=i.to)&&(o=ex.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?ex.create(n,t.mainIndex):t}function rO(e,t,n){let r=rk(e.state.facet(nK).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:ex.cursor(r,r<n.from?1:-1)}class rC{constructor(e,t){this.pos=e,this.assoc=t}}function rE(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),o=i.top+e.viewState.paddingTop,{x:s,y:a}=t,l=a-o,u;for(;;){if(l<0)return new rC(0,1);if(l>e.viewState.docHeight)return new rC(e.state.doc.length,-1);if(u=e.elementAtHeight(l),null==r)break;if(u.type==tV.Text){let t=e.docView.coordsAt(r<0?u.from:u.to,r);if(t&&(r<0?t.top<=l+o:t.bottom>=l+o))break}let t=e.viewState.heightOracle.textHeight/2;l=r>0?u.bottom+t:u.top-t}if(e.viewport.from>=u.to||e.viewport.to<=u.from){if(n)return null;if(u.type==tV.Text){let t=function(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;o+=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+tf(s,o,e.state.tabSize)}(e,i,u,s,a);return new rC(t,t==u.from?1:-1)}}if(u.type!=tV.Text)return l<(u.top+u.bottom)/2?new rC(u.from,1):new rC(u.to,-1);let c=e.docView.lineAt(u.from,2);return c&&c.length==u.length||(c=e.docView.lineAt(u.from,-2)),function e(t,n,r,i,o){let s=-1,a=null,l=1e9,u=1e9,c=o,h=o,d=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];if(r.top==r.bottom)continue;let d=r.left>i?r.left-i:r.right<i?i-r.right:0,f=r.top>o?r.top-o:r.bottom<o?o-r.bottom:0;r.top<=h&&r.bottom>=c&&(c=Math.min(r.top,c),h=Math.max(r.bottom,h),f=0),(s<0||0>(f-u||d-l))&&(s>=0&&u&&l<d&&a.top<=h-2&&a.bottom>=c+2?u=0:(s=t,l=d,u=f,a=r))}};if(n.isText()){for(let e=0;e<n.length;){let t=es(n.text,e);if(d(nn(n.dom,e,t).getClientRects(),e),!l&&!u)break;e=t}return i>(a.left+a.right)/2==(rT(t,s+r)==nl.LTR)?new rC(r+es(n.text,s),-1):new rC(r+s,1)}{if(!n.length)return new rC(r,1);for(let e=0;e<n.children.length;e++){let t=n.children[e];if(!(48&t.flags)&&(d((1==t.dom.nodeType?t.dom:nn(t.dom,0,t.length)).getClientRects(),e),!l&&!u))break}let c=n.children[s],h=n.posBefore(c,r);return c.isComposite()||c.isText()?e(t,c,h,Math.max(a.left,Math.min(a.right,i)),o):i>(a.left+a.right)/2==(rT(t,s+r)==nl.LTR)?new rC(h+c.length,-1):new rC(h,1)}}(e,c,u.from,s,a)}function rT(e,t){let n=e.state.doc.lineAt(t);return e.bidiSpans(n)[ny.find(e.bidiSpans(n),t-n.from,-1,1)].dir}class rP{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(e3.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+="￿"}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=n3.get(r),o=r.nextSibling;if(o==t){(null==i?void 0:i.breakAfter)&&!o&&n!=this.view.contentDOM&&this.lineBreak();break}let s=n3.get(o);(i&&s?i.breakAfter:(i?i.breakAfter:t4(r))||t4(o)&&("BR"!=r.nodeName||(null==i?void 0:i.isWidget()))&&this.text.length>e)&&!function(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=n3.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(n||(n=[])).push(t)}if(n)for(let e of n){let t=e.overrideDOMText;if(null==t?void 0:t.length)return!1}return!0}(o,t)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,o=1,s;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=r.exec(t))&&(i=s.index,o=s[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),o>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);n=i+o}}readNode(e){let t=n3.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(!function(e,t,n){for(;;){if(!t||n<t6(t))return!1;if(t==e)return!0;n=t3(t)+1,t=t.parentNode}}(e,n.node,n.offset)?0:t))}}class rA{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class rR{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=function e(t,n,r,i){if(t.isComposite()){let o=-1,s=-1,a=-1,l=-1;for(let u=0,c=i,h=i;u<t.children.length;u++){let i=t.children[u],d=c+i.length;if(c<n&&d>r)return e(i,n,r,c);if(d>=n&&-1==o&&(o=u,s=c),c>r&&i.dom.parentNode==t.dom){a=u,l=h;break}h=d,c=d+i.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(o?t.children[o-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}(e.docView.tile,t,n,0))){let t=i||o?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new rA(n,r)),(i!=n||o!=r)&&t.push(new rA(i,o))),t}(e),n=new rP(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?ex.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!tJ(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!tJ(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((tF.ios||tF.chrome)&&e.state.selection.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),o=s.from-t,a=s.to-i;(0==o||1==o||0==t)&&(0==a||-1==a||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(ex.range(r,n)):this.newSel=ex.single(r,n)}}}function rM(e,t){let n,{newSel:r}=t,i=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:s}=t.bounds,a=i.from,l=null;(8===o||tF.android&&t.text.length<s-r)&&(a=i.to,l="end");let u=rD(e.state.doc.sliceString(r,s,"￿"),t.text,a-r,l);u&&(tF.chrome&&13==o&&u.toB==u.from+2&&"￿￿"==t.text.slice(u.from,u.toB)&&u.toB--,n={from:r+u.from,to:r+u.toA,insert:Z.of(t.text.slice(u.from,u.toB).split("￿"))})}else r&&(!e.hasFocus&&e.state.facet(nF)||rL(r,i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:(tF.mac||tF.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=ex.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Z.of([n.insert.toString().replace("."," ")])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:e.state.doc.lineAt(i.from).to<i.to&&e.docView.lineHasWidget(i.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:e.state.toText(e.inputState.insertingText)}:tF.chrome&&n&&n.from==n.to&&n.from==i.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=ex.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Z.of([" "])}),n)return rI(e,n,r,o);if(!r||rL(r,i))return!1;{let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),"select.pointer"==(n=e.inputState.lastSelectionOrigin)&&(r=r_(e.state.facet(nK).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}}function rI(e,t,n,r=-1){let i;if(tF.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(tF.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&nr(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&nr(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&nr(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>i||(i=function(e,t,n){let r,i=e.state,o=i.selection.main,s=-1;if(t.from==t.to&&t.from<o.from||t.from>o.to){let n=t.from<o.from?-1:1,r=n<0?o.from:o.to,a=rk(i.facet(nK).map(t=>t(e)),r,n);t.from==a&&(s=a)}if(s>-1)r={changes:t,selection:ex.cursor(t.from+t.insert.length,-1)};else if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=o.from<t.from?i.sliceDoc(o.from,t.from):"",s=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=i.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=o.to+10&&t.to>=o.to-10){let l=e.state.sliceDoc(t.from,t.to),u,c=n&&rv(e,n.main.head);if(c){let e=t.insert.length-(t.to-t.from);u={from:c.from,to:c.to-e}}else u=e.state.doc.lineAt(o.head);let h=o.to-t.to;r=i.changeByRange(n=>{if(n.from==o.from&&n.to==o.to)return{changes:s,range:a||n.map(s)};let r=n.to-h,c=r-l.length;if(e.state.sliceDoc(c,r)!=l||r>=u.from&&c<=u.to)return{range:n};let d=i.changes({from:c,to:r,insert:t.insert}),f=n.to-o.to;return{changes:d,range:a?ex.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(d)}})}else r={changes:s,selection:a&&i.selection.replaceRange(a)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}(e,t,n));return e.state.facet(nE).some(n=>n(e,t.from,t.to,s,a))||e.dispatch(a()),!0}function rD(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if("end"==r){let e=Math.max(0,o-Math.min(s,a));n-=s+e-o}if(s<o&&e.length<t.length){let e=n<=o&&n>=s?o-n:0;o-=e,a=o+(a-s),s=o}else if(a<o){let e=n<=o&&n>=a?o-n:0;o-=e,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function rL(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class rN{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,tF.safari&&e.contentDOM.addEventListener("input",()=>null),tF.gecko&&function(e){r8.has(e)||(r8.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}(e.contentDOM.ownerDocument)}handleEvent(e){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(r=n3.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}(this.view,e)||this.ignoreDuringComposition(e)||"keydown"==e.type&&this.keydown(e)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(rB(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(rB(t.value,r))}}for(let e in rz)n(e).handlers.push(rz[e]);for(let e in rV)n(e).observers.push(rV[e]);return t}(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let i=!t[e].handlers.length,o=n[e];o&&!o.handlers.length!=i&&(r.removeEventListener(e,this.handleEvent),o=null),o||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){let t;return this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!!(9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))||((this.tabFocusMode>0&&27!=e.keyCode&&0>rU.indexOf(e.keyCode)&&(this.tabFocusMode=-1),tF.android&&tF.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))?(this.view.observer.delayAndroidKey(e.key,e.keyCode),!0):tF.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=rF.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||rj.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(229!=e.keyCode&&this.view.observer.forceFlush(),!1))}flushIOSKey(e){let t=this.pendingIOSKey;return!(!t||"Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,nr(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&!e.synthetic&&(this.composing>0||!!(tF.safari&&!tF.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function rB(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){nB(n.state,e)}}}let rF=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],rj="dthko",rU=[16,17,18,20,91,92,224,225];function rq(e){return .7*Math.max(0,e)+8}class rW{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t=e.ownerDocument,n,r;for(let i=e.parentNode;i;)if(i==t.body||n&&r)break;else if(1==i.nodeType)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(11==i.nodeType)i=i.host;else break;return{x:n,y:r}}(e.contentDOM),this.atoms=e.state.facet(nK).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(e3.allowMultipleSelections)&&function(e,t){let n=e.state.facet(nS);return n.length?n[0](t):tF.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=tY(e.root);if(!r||0==r.rangeCount)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)&&1==rJ(t)&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&10>(t=this.startEvent,Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))))return;this.select(this.lastEvent=e);let n=0,r=0,i=0,o=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=nY(this.view);e.clientX-l.left<=i+6?n=-rq(i-e.clientX):e.clientX+l.right>=s-6&&(n=rq(e.clientX-s)),e.clientY-l.top<=o+6?r=-rq(o-e.clientY):e.clientY+l.bottom>=a-6&&(r=rq(e.clientY-a)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=r_(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,!1===this.dragging))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}let rz=Object.create(null),rV=Object.create(null),rH=tF.ie&&tF.ie_version<15||tF.ios&&tF.webkit_version<604;function rQ(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function r$(e,t){t=rQ(e.state,nP,t);let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(null!=r1&&n.selection.ranges.every(e=>e.empty)&&r1==o.toString()){let e=-1;r=n.changeByRange(r=>{let a=n.doc.lineAt(r.from);if(a.from==e)return{range:r};e=a.from;let l=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:ex.cursor(r.from+l.length)}})}else r=s?n.changeByRange(e=>{let t=o.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:ex.cursor(e.from+t.length)}}):n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}function rK(e,t,n,r){if(1==r)return ex.cursor(t,n);{if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(0==i.length)return ex.cursor(t);0==o?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=es(i.text,o,!1):a=es(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let e=es(i.text,s,!1);if(r(i.text.slice(e,s))!=l)break;s=e}for(;a<i.length;){let e=es(i.text,a);if(r(i.text.slice(a,e))!=l)break;a=e}return ex.range(s+i.from,a+i.from)}(e.state,t,n);let i=e.docView.lineAt(t,n),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,ex.range(s,a)}}rV.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},rz.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),rV.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},rV.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},rz.mousedown=(e,t)=>{var n,r;let i,o,s;if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let a=null;for(let n of e.state.facet(n_))if(a=n(e,t))break;if(a||0!=t.button||(n=e,r=t,i=n.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),o=rJ(r),s=n.state.selection,a={update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),s=s.map(e.changes))},get(e,t,r){let a=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),l,u=rK(n,a.pos,a.assoc,o);if(i.pos!=a.pos&&!t){let e=rK(n,i.pos,i.assoc,o),t=Math.min(e.from,u.from),r=Math.max(e.to,u.to);u=t<u.from?ex.range(t,r):ex.range(r,t)}return t?s.replaceRange(s.main.extend(u.from,u.to)):r&&1==o&&s.ranges.length>1&&(l=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return ex.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n))}return null}(s,a.pos))?l:r?s.addRange(u):ex.create([u])}}),a){let n=!e.hasFocus;e.inputState.startMouseSelection(new rW(e,t,a,n)),n&&e.observer.ignore(()=>{nt(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}else e.inputState.setSelectionOrigin("select.pointer");return!1};let rX=tF.ie&&tF.ie_version<=11,rG=null,rZ=0,rY=0;function rJ(e){if(!rX)return e.detail;let t=rG,n=rY;return rG=e,rY=Date.now(),rZ=!t||n>Date.now()-400&&2>Math.abs(t.clientX-e.clientX)&&2>Math.abs(t.clientY-e.clientY)?(rZ+1)%3:1}function r0(e,t,n,r){let i;if(!(n=rQ(e.state,nP,n)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=r&&s&&((i=e.state.facet(nk)).length?i[0](t):tF.mac?!t.altKey:!t.ctrlKey)?{from:s.from,to:s.to}:null,l={from:o,insert:n},u=e.state.changes(a?[a,l]:l);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(o,-1),head:u.mapPos(o,1)},userEvent:a?"move.drop":"input.drop"}),e.inputState.draggedContent=null}rz.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=ex.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",rQ(e.state,nA,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1},rz.dragend=e=>(e.inputState.draggedContent=null,!1),rz.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&r0(e,t,r.filter(e=>null!=e).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),o()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return r0(e,t,n,!0),!0}return!1},rz.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=rH?null:t.clipboardData;return n?(r$(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(!function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),r$(e,n.value)},50)}(e),!1)};let r1=null;rz.copy=rz.cut=(e,t)=>{let n=tY(e.root);if(n&&!t0(e.contentDOM,n))return!1;let{text:r,ranges:i,linewise:o}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let o=e.doc.lineAt(r);o.number>i&&(t.push(o.text),n.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),i=o.number}r=!0}return{text:rQ(e,nA,t.join(e.lineBreak)),ranges:n,linewise:r}}(e.state);if(!r&&!o)return!1;r1=o?r:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=rH?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",r),!0):(!function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}(e,r),!1)};let r2=eQ.define();function r3(e,t){let n=[];for(let r of e.facet(nT)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:r2.of(!0)}):null}function r4(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=r3(e.state,t);n?e.dispatch(n):e.update([])}},10)}rV.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),r4(e)},rV.blur=e=>{e.observer.clearSelectionRange(),r4(e)},rV.compositionstart=rV.compositionupdate=e=>{!e.observer.editContext&&(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},rV.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,tF.chrome&&tF.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},rV.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},rz.beforeinput=(e,t)=>{var n,r;let i;if(("insertText"==t.inputType||"insertCompositionText"==t.inputType)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),"insertReplacementText"==t.inputType&&e.observer.editContext){let r=null==(n=t.dataTransfer)?void 0:n.getData("text/plain"),i=t.getTargetRanges();if(r&&i.length){let t=i[0],n=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return rI(e,{from:n,to:o,insert:e.state.toText(r)},null),!0}}if(tF.chrome&&tF.android&&(i=rF.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),"Backspace"==i.key||"Delete"==i.key)){let t=(null==(r=window.visualViewport)?void 0:r.height)||0;setTimeout(()=>{var n;((null==(n=window.visualViewport)?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return tF.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),tF.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout(()=>rV.compositionend(e,t),20),!1};let r8=new Set,r6=["pre-wrap","normal","pre-line","break-spaces"],r5=!1;class r9{constructor(e){this.lineWrapping=e,this.doc=Z.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return r6.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,i,o){let s=r6.indexOf(e)>-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=s||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,a){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class r7{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class ie{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return"number"==typeof this._content?tV.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof tK?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ie(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var it=((l=it||(it={}))[l.ByPos=0]="ByPos",l[l.ByHeight=1]="ByHeight",l[l.ByPosNoHeight=2]="ByPosNoHeight",l);class ir{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=2*!!e|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>.001&&(r5=!0),this.height=e)}replace(e,t,n){return ir.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,o=n.doc;for(let s=r.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:u,toB:c}=r[s],h=i.lineAt(a,it.ByPosNoHeight,n.setDoc(t),0,0),d=h.to>=l?h:i.lineAt(l,it.ByPosNoHeight,n,0,0);for(c+=d.to-l,l=d.to;s>0&&h.from<=r[s-1].toA;)a=r[s-1].fromA,u=r[s-1].fromB,s--,a<h.from&&(h=i.lineAt(a,it.ByPosNoHeight,n,0,0));u+=h.from-a,a=h.from;let f=ih.build(n.setDoc(o),e,u,c);i=ii(i,i.replace(a,l,f))}return i.updateHeight(n,0)}static empty(){return new ia(0,0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,i=0;for(;;)if(t==n)if(r>2*i){let i=e[t-1];i.break?e.splice(--t,1,i.left,null,i.right):e.splice(--t,1,i.left,i.right),n+=1+i.break,r-=i.size}else if(i>2*r){let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,i-=t.size}else break;else if(r<i){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(i+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,n++),new iu(ir.of(e.slice(0,t)),o,ir.of(e.slice(n)))}}function ii(e,t){return e==t?e:(e.constructor!=t.constructor&&(r5=!0),t)}ir.prototype.size=1;let io=tH.replace({});class is extends ir{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new ie(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new ie(r,0,n,this.spaceAbove,io):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let o=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(o):o}forEachLine(e,t,n,r,i,o){e<=i+this.length&&t>=i&&o(this.lineAt(0,it.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ia extends is{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new ie(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof ia||r instanceof il&&4&r.flags)&&10>Math.abs(this.length-r.length)?(r instanceof il?r=new ia(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ir.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class il extends ir{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,o,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);o=t/i,this.length>i+1&&(s=(this.height-t)/(this.length-i-1))}else o=this.height/i;return{firstLine:n,lastLine:r,perLine:o,perChar:s}}blockAt(e,t,n,r){let{firstLine:i,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),o=t.doc.lineAt(i),l=s+o.length*a,u=Math.max(n,e-l/2);return new ie(o.from,o.length,u,l,0)}{let r=Math.max(0,Math.min(o-i,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(i+r);return new ie(a,l,n+s*r,s,0)}}lineAt(e,t,n,r,i){if(t==it.ByHeight)return this.blockAt(e,n,r,i);if(t==it.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new ie(t,r-t,0,0,0)}let{firstLine:o,perLine:s,perChar:a}=this.heightMetrics(n,i),l=n.doc.lineAt(e),u=s+l.length*a,c=l.number-o,h=r+s*c+a*(l.from-i-c);return new ie(l.from,l.length,Math.max(r,Math.min(h,r+this.height-u)),u,0)}forEachLine(e,t,n,r,i,o){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);for(let u=e,c=r;u<=t;){let t=n.doc.lineAt(u);if(u==e){let n=t.number-s;c+=a*n+l*(e-i-n)}let r=a+l*t.length;o(new ie(t.from,t.length,c,r,0)),c+=r,u=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof il?n[n.length-1]=new il(e.length+r):n.push(null,new il(r-1))}if(e>0){let t=n[0];t instanceof il?n[0]=new il(e+t.length):n.unshift(new il(e-1),null)}return ir.of(n)}decomposeLeft(e,t){t.push(new il(e-1),null)}decomposeRight(e,t){t.push(null,new il(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let i=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],o=Math.max(t,r.from),s=-1;for(r.from>t&&n.push(new il(r.from-t-1).updateHeight(e,t));o<=i&&r.more;){let t=e.doc.lineAt(o).length;n.length&&n.push(null);let i=r.heights[r.index++],a=0;i<0&&(a=-i,i=r.heights[r.index++]),-1==s?s=i:Math.abs(i-s)>=.001&&(s=-2);let l=new ia(t,i,a);l.outdated=!1,n.push(l),o+=t+1}o<=i&&n.push(null,new il(i-o).updateHeight(e,o));let a=ir.of(n);return(s<0||Math.abs(a.height-this.height)>=.001||Math.abs(s-this.heightMetrics(e,t).perLine)>=.001)&&(r5=!0),ii(this,a)}return(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class iu extends ir{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let o=r+this.left.height,s=i+this.left.length+this.break,a=t==it.ByHeight?e<o:e<s,l=a?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,o,s);if(this.break||(a?l.to<s:l.from>s))return l;let u=t==it.ByPosNoHeight?it.ByPosNoHeight:it.ByPos;return a?l.join(this.right.lineAt(s,u,n,o,s)):this.left.lineAt(s,u,n,r,i).join(l)}forEachLine(e,t,n,r,i,o){let s=r+this.left.height,a=i+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,i,o),t>=a&&this.right.forEachLine(e,t,n,s,a,o);else{let l=this.lineAt(a,it.ByPos,n,r,i);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,i,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let o=i.length;for(let e of n)i.push(e);if(e>0&&ic(i,o-1),t<this.length){let e=i.length;this.decomposeRight(t,i),ic(i,e)}return ir.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&e>=++n&&t.push(null),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ir.of(this.break?[e,null,t]:[e,t]):(this.left=ii(this.left,e),this.right=ii(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:o}=this,s=t+i.length+this.break,a=null;return(r&&r.from<=t+i.length&&r.more?a=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=s+o.length&&r.more?a=o=o.updateHeight(e,s,n,r):o.updateHeight(e,s,n),a)?this.balanced(i,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ic(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof il&&(r=e[t+1])instanceof il&&e.splice(t-1,3,new il(n.length+1+r.length))}class ih{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof ia?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new ia(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new is(o,r,n)):(o||i||r>=5)&&this.addLineDeco(r,i,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ia(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new il(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ia)return e;let t=new ia(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof ia||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new ia(0,-1,0));let n=e;for(let e of this.nodes)e instanceof ia&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let i=new ih(n,e);return te.spans(t,n,r,i,0),i.finish(n)}}class id{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&tG(e,t,this.changes,5)}}class ip{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return tH.replace({widget:new ig(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class ig extends tz{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class im{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=iw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=nl.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(nV).some(e=>"function"!=typeof e&&"cm-lineWrapping"==e.class);this.heightOracle=new r9(t),this.stateDeco=ix(e),this.heightMap=ir.empty().applyChanges(this.stateDeco,Z.empty,this.heightOracle.setDoc(e.doc),[new n0(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=tH.set(this.lineGaps.map(e=>e.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new iv(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iw:new iS(this.heightOracle,this.heightMap,this.viewports),2*!e.eq(this.scaler)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ik(e,this.scaler))})}update(e,t=null){var n,r;let i;this.state=e.state;let o=this.stateDeco;this.stateDeco=ix(this.state);let s=e.changedRanges,a=n0.extendWithRanges(s,(n=this.stateDeco,r=e?e.changes:ef.empty(this.state.doc.length),i=new id,te.compare(o,n,r,i,0),i.changes)),l=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);r5=!1,this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||r5)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=a.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(nM)&&(this.mustEnforceCursorAssoc=!0)}measure(e){var t;let n,r,i=e.contentDOM,o=window.getComputedStyle(i),s=this.heightOracle,a=o.whiteSpace;this.defaultTextDirection="rtl"==o.direction?nl.RTL:nl.LTR;let l=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent,u=i.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let h=0,d=0;if(u.width&&u.height){let{scaleX:e,scaleY:t}=t9(i,u);(e>.005&&Math.abs(this.scaleX-e)>.005||t>.005&&Math.abs(this.scaleY-t)>.005)&&(this.scaleX=e,this.scaleY=t,h|=16,l=c=!0)}let f=(parseInt(o.paddingTop)||0)*this.scaleY,p=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=p)&&(this.paddingTop=f,this.paddingBottom=p,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=ni(e.scrollDOM);let m=(this.printing?function(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}:function(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();o=Math.max(o,r.left),s=Math.min(s,r.right),a=Math.max(a,r.top),l=Math.min(t==e.parentNode?i.innerHeight:l,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else if(11==t.nodeType)t=t.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}})(i,this.paddingTop),v=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(c=!0)),!this.inView&&!this.scrollTarget&&(n=(t=e.dom).getBoundingClientRect(),r=t.ownerDocument.defaultView||window,!(n.left<r.innerWidth)||!(n.right>0)||!(n.top<r.innerHeight)||!(n.bottom>0)))return 0;let w=u.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),c){let t=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(t)&&(l=!0),l||s.lineWrapping&&Math.abs(w-this.contentDOMWidth)>s.charWidth){let{lineHeight:n,charWidth:r,textHeight:i}=e.docView.measureTextSize();(l=n>0&&s.refresh(a,n,r,i,Math.max(5,w/r),t))&&(e.docView.minWidth=0,h|=16)}for(let n of(v>0&&y>0?d=Math.max(v,y):v<0&&y<0&&(d=Math.min(v,y)),r5=!1,this.viewports)){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(l?ir.empty().applyChanges(this.stateDeco,Z.empty,this.heightOracle,[new n0(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,l,new r7(n.from,r))}r5&&(h|=2)}let x=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(2&h&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(2&h||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new iv(r.lineAt(o-1e3*n,it.ByHeight,i,0,0).from,r.lineAt(s+(1-n)*1e3,it.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=r.lineAt(e,it.ByPos,i,0,0),s;s="center"==t.y?(o.top+o.bottom)/2-n/2:"start"==t.y||"nearest"==t.y&&e<a.from?o.top:o.bottom-n,a=new iv(r.lineAt(s-500,it.ByHeight,i,0,0).from,r.lineAt(s+n+500,it.ByHeight,i,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new iv(this.heightMap.lineAt(n,it.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,it.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,it.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,it.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=s+Math.max(10,Math.min(n,250)))&&r>o-2e3&&i<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new ip(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,o=r<<1;if(this.defaultTextDirection!=nl.LTR&&!n)return[];let s=[],a=(r,o,l,u)=>{if(o-r<i)return;let c=this.state.selection.main,h=[c.from];for(let e of(c.empty||h.push(c.to),h))if(e>r&&e<o){a(r,e-10,l,u),a(e+10,o,l,u);return}let d=function(e,t){for(let n of e)if(t(n))return n}(e,e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-o)<i&&!h.some(t=>e.from<t&&e.to>t));if(!d){if(o<l.to&&t&&n&&t.visibleRanges.some(e=>e.from<=o&&e.to>=o)){let e=t.moveToLineBoundary(ex.cursor(o),!1,!0).head;e>r&&(o=e)}let e=this.gapSize(l,r,o,u),i=n||e<2e6?e:2e6;d=new ip(r,o,e,i)}s.push(d)},l=t=>{var i,s,l;let u,c,h,d,f;if(t.length<o||t.type!=tV.Text)return;let p=(i=t.from,s=t.to,l=this.stateDeco,h=[],d=i,f=0,te.spans(l,i,s,{span(){},point(e,t){e>d&&(h.push({from:d,to:e}),f+=e-d),d=t}},20),d<s&&(h.push({from:d,to:s}),f+=s-d),{total:f,ranges:h});if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let e,n,i=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=g){let r=ib(p,g),o=((this.visibleBottom-this.visibleTop)/2+i)/t.height;e=r-o,n=r+o}else e=(this.visibleTop-t.top-i)/t.height,n=(this.visibleBottom-t.top+i)/t.height;u=iy(p,e),c=iy(p,n)}else{let n,i,o=p.total*this.heightOracle.charWidth,s=r*this.heightOracle.charWidth,a=0;if(o>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=n.size-n.displaySize);let l=this.pixelViewport.left+a,h=this.pixelViewport.right+a;if(null!=g){let e=ib(p,g),t=((h-l)/2+s)/o;n=e-t,i=e+t}else n=(l-s)/o,i=(h+s)/o;u=iy(p,n),c=iy(p,i)}u>t.from&&a(t.from,u,t,p),c<t.to&&a(c,t.to,t,p)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,r){let i=ib(r,n)-ib(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){ip.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=tH.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];te.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(8&r);t++){let i=this.visibleRanges[t],o=n[t];(i.from!=o.from||i.to!=o.to)&&(r|=4,e&&e.mapPos(i.from,-1)==o.from&&e.mapPos(i.to,1)==o.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ik(this.heightMap.lineAt(e,it.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||ik(this.heightMap.lineAt(this.scaler.fromDOM(e),it.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ik(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class iv{constructor(e,t){this.from=e,this.to=t}}function iy({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],o=i-n;if(r<=o)return n+r;r-=o}}function ib(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}let iw={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};function ix(e){let t=e.facet(nH).filter(e=>"function"!=typeof e),n=e.facet(n$).filter(e=>"function"!=typeof e);return n.length&&t.push(te.join(n)),t}class iS{constructor(e,t,n){let r=0,i=0,o=0;for(let s of(this.viewports=n.map(({from:n,to:i})=>{let o=t.lineAt(n,it.ByPos,e,0,0).top,s=t.lineAt(i,it.ByPos,e,0,0).bottom;return r+=s-o,{from:n,to:i,top:o,bottom:s,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r),this.viewports))s.domTop=o+(s.top-i)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),i=s.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(e){return e instanceof iS&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to)}}function ik(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new ie(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>ik(e,t)):e._content)}let i_=e_.define({combine:e=>e.join(" ")}),iO=e_.define({combine:e=>e.indexOf(!0)>-1}),iC=tv.newName(),iE=tv.newName(),iT=tv.newName(),iP={"&light":"."+iE,"&dark":"."+iT};function iA(e,t,n){return new tv(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,t=>{if("&"==t)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+" "+t})}let iR=iA("."+iC,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},iP),iM={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},iI=tF.ie&&tF.ie_version<=11;class iD{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new t7,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(tF.ie&&tF.ie_version<=11||tF.ios&&e.composing)&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&tF.android&&!1!==e.constructor.EDIT_CONTEXT&&!(tF.chrome&&tF.chrome_version<126)&&(this.editContext=new iB(e),e.state.facet(nF)&&(e.contentDOM.editContext=this.editContext.editContext)),iI&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(()=>{var e;(null==(e=this.view.docView)?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){for(let t of(this.gapIntersection.disconnect(),e))this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(nF)?n.root.activeElement!=this.dom:!t0(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(tF.ie&&tF.ie_version<=11||tF.android&&tF.chrome)&&!n.state.selection.main.empty&&r.focusNode&&t2(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=tY(e.root);if(!t)return!1;let n=tF.safari&&11==e.root.nodeType&&e.root.activeElement==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return iN(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?iN(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=t0(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,t6(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:r=t6(n=e)}else{if(n==e)return!0;r=t3(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(11==n.nodeType)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,iM),iI&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),iI&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&nr(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null==(n=this.delayedAndroidKey)?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),-1==t?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&t0(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new rR(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=rM(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!rL(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty("attributes"==e.type),"childList"==e.type){let n=iL(t,e.previousSibling||e.target.previousSibling,-1),r=iL(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(nF)!=e.state.facet(nF)&&(e.view.contentDOM.editContext=e.state.facet(nF)?this.editContext.editContext:null))}destroy(){var e,t,n;for(let r of(this.stop(),null==(e=this.intersection)||e.disconnect(),null==(t=this.gapIntersection)||t.disconnect(),null==(n=this.resizeScroll)||n.disconnect(),this.scrollTargets))r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function iL(e,t,n){for(;t;){let r=n3.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function iN(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return t2(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}class iB{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});for(let n in this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:o}=r,s=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let l=a-s>n.text.length;s==this.from&&i<this.from?s=i:a==this.to&&i>this.to&&(a=i);let u=rD(e.state.sliceDoc(s,a),n.text,(l?r.from:r.to)-s,l?"end":null);if(!u){let t=ex.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));rL(t,r)||e.dispatch({selection:t,userEvent:"select"});return}let c={from:u.from+s,to:u.toA+s,insert:Z.of(n.text.slice(u.from,u.toB).split("\n"))};if((tF.mac||tF.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&"off"==e.contentDOM.getAttribute("autocorrect")&&(c={from:s,to:a,insert:Z.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let t=this.to-this.from+(c.to-c.from+c.insert.length);rI(e,c,ex.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),c.from<c.to&&!c.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),o=this.toEditorPos(n.rangeEnd);t<o;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),o=this.toEditorPos(e.rangeEnd);if(i<o){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+" ":"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${/thin/i.test(r)?1:2}px`;n.push(tH.mark({attributes:{style:e}}).range(i,o))}}}e.dispatch({effects:nN.of(tH.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}},this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=tY(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,o,s,a,l)=>{if(n)return;let u=l.length-(o-i);if(r&&o>=r.to)if(r.from==i&&r.to==o&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(i+=t,(o+=t)<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||o>this.to||this.to-this.from+l.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(o),l.toString()),this.to+=u}t+=u}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent("input.type")&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.reset(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class iF{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;for(let t of(this.dispatchTransactions=e.dispatchTransactions||n&&(e=>e.forEach(e=>n(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new im(e.state||e3.create(e)),e.scrollTo&&e.scrollTo.is(nL)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(nU).map(e=>new nW(e)),this.plugins))t.update(this);this.observer=new iD(this),this.inputState=new rN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new rg(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null==(t=document.fonts)?void 0:t.ready)&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=1==e.length&&e[0]instanceof eG?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,i=this.state;for(let t of e){if(t.startState!=i)throw RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=t.state}if(this.destroyed){this.viewState.state=i;return}let o=this.hasFocus,s=0,a=null;e.some(e=>e.annotation(r2))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,(a=r3(i,o))||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),((u=this.observer.readChange())&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(e3.phrases)!=this.state.facet(e3.phrases))return this.setState(i);r=n1.create(this,i,e),r.flags|=s;let c=this.viewState.scrollTarget;try{for(let t of(this.updateState=2,e)){if(c&&(c=c.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;c=new nD(e.empty?e:ex.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(nL)&&(c=e.value.clip(this.state))}this.viewState.update(r,c),this.bidiCache=iq.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(nJ)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(e=>e.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(i_)!=r.state.facet(i_)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let e of this.state.facet(nC))try{e(r)}catch(e){nB(this.state,e,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!rM(this,u)&&l.force&&nr(this.contentDOM,l.key,l.keyCode)})}setState(e){if(0!=this.updateState)throw Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);for(let t of(this.viewState=new im(e),this.plugins=e.facet(nU).map(e=>new nW(e)),this.pluginMap.clear(),this.plugins))t.update(this);this.docView.destroy(),this.docView=new rg(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(nU),n=e.state.facet(nU);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new nW(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){nB(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(ni(n))i=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,o=e.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(e=>{try{return e.read(this)}catch(e){return nB(this.state,e),iU}}),u=n1.create(this,this.state,[]),c=!1;u.flags|=s,t?t.flags|=s:t=u,this.updateState=2,!u.empty&&(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),(c=this.docView.update(u))&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=iU)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){nB(this.state,e)}if(c&&this.docView.updateSelection(!0),!u.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let e=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-o;if(e>1||e<-1){n.scrollTop=(r+=e)/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(nC))e(t)}get themeClasses(){return iC+" "+(this.state.facet(iO)?iT:iE)+" "+this.state.facet(i_)}updateAttrs(){let e=iW(this,nz,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(nF)?"true":"false",class:"cm-content",style:`${tF.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),iW(this,nV,t);let n=this.observer.ignore(()=>{let n=tW(this.contentDOM,this.contentAttrs,t),r=tW(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(iF.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(nJ);let e=this.state.facet(iF.cspNonce);tv.mount(this.root,this.styleModules.concat(iR).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if((this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e)&&!(this.measureRequests.indexOf(e)>-1)){if(null!=e.key){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return rO(this,e,rS(this,e,t,n))}moveByGroup(e,t){return rO(this,e,rS(this,e,t,t=>{var n;let r,i;return n=e.head,i=(r=this.state.charCategorizer(n))(t),e=>{let t=r(e);return i==e1.Space&&(i=t),i==t}}))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return ex.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let i=rx(e,t.head,t.assoc||-1),o=r&&i.type==tV.Text&&(e.lineWrapping||i.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head):null;if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),s=e.posAtCoords({x:n==(r==nl.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(null!=s)return ex.cursor(s,n?-1:1)}return ex.cursor(n?i.to:i.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return rO(this,e,function(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return ex.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(i,t.assoc||-1),c=e.documentTop;if(u)null==s&&(s=u.left-l.left),a=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(i);null==s&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-t.from))),a=(o<0?t.top:t.bottom)+c}let h=l.left+s,d=null!=r?r:e.viewState.heightOracle.textHeight>>1,f=rE(e,{x:h,y:a+d*o},!1,o);return ex.cursor(f.pos,f.assoc,void 0,s)}(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=rE(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),rE(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r);return t5(n,i[ny.find(i,e-r.from,-1,t)].dir==nl.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(nR)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ij)return nw(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||function e(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.direction!=o.direction||!e(i.inner,o.inner))return!1}return!0}(r.isolates,n=nG(this,e))))return r.order;n||(n=nG(this,e));let r=function(e,t,n){if(!e)return[new ny(0,0,+(t==nc))];if(t==nu&&!n.length&&!nv.test(e))return nw(e.length);if(n.length)for(;e.length>nb.length;)nb[nb.length]=256;let r=[],i=+(t!=nu);return function e(t,n,r,i,o,s,a){let l=n%2?2:1;!function(e,t,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:t,a=o<r.length?r[o].from:n,l=o?256:i;for(let t=s,n=l,r=l;t<a;t++){let i=nm(e.charCodeAt(t));512==i?i=n:8==i&&4==r&&(i=16),nb[t]=4==i?2:i,7&i&&(r=i),n=i}for(let e=s,t=l,r=l;e<a;e++){let i=nb[e];if(128==i)e<a-1&&t==nb[e+1]&&24&t?i=nb[e]=t:nb[e]=256;else if(64==i){let i=e+1;for(;i<a&&64==nb[i];)i++;let o=e&&8==t||i<n&&8==nb[i]?1==r?1:8:256;for(let t=e;t<i;t++)nb[t]=o;e=i-1}else 8==i&&1==r&&(nb[e]=1);t=i,7&i&&(r=i)}}}(t,o,s,i,l),function(e,t,n,r,i){let o=1==i?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let u=s?r[s-1].to:t,c=s<r.length?r[s].from:n;for(let t=u,n,r,s;t<c;t++)if(r=np[n=e.charCodeAt(t)])if(r<0){for(let e=a-3;e>=0;e-=3)if(ng[e+1]==-r){let n=ng[e+2],r=2&n?i:4&n?1&n?o:i:0;r&&(nb[t]=nb[ng[e]]=r),a=e;break}}else if(189==ng.length)break;else ng[a++]=t,ng[a++]=n,ng[a++]=l;else if(2==(s=nb[t])||1==s){let e=s==i;l=+!e;for(let t=a-3;t>=0;t-=3){let n=ng[t+2];if(2&n)break;if(e)ng[t+2]|=2;else{if(4&n)break;ng[t+2]|=4}}}}}(t,o,s,i,l),function(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=i<n.length?n[i].from:t;for(let l=s;l<a;){let s=nb[l];if(256==s){let s=l+1;for(;;)if(s==a){if(i==n.length)break;s=n[i++].to,a=i<n.length?n[i].from:t}else if(256==nb[s])s++;else break;let u=1==o,c=u==((s<t?nb[s]:r)==1)?u?1:2:r;for(let t=s,r=i,o=r?n[r-1].to:e;t>l;)t==o&&(t=n[--r].from,o=r?n[r-1].to:e),nb[--t]=c;l=s}else o=s,l++}}}(o,s,i,l),function t(n,r,i,o,s,a,l){let u=o%2?2:1;if(o%2==s%2)for(let c=r,h=0;c<i;){let r=!0,d=!1;if(h==a.length||c<a[h].from){let e=nb[c];e!=u&&(r=!1,d=16==e)}let f=r||1!=u?null:[],p=r?o:o+1,g=c;r:for(;;)if(h<a.length&&g==a[h].from){if(d)break;let t=a[h];if(!r)for(let e=t.to,n=h+1;;){if(e==i)break r;if(n<a.length&&a[n].from==e)e=a[n++].to;else if(nb[e]==u)break r;else break}h++,f?f.push(t):(t.from>c&&l.push(new ny(c,t.from,p)),e(n,t.direction==nu!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,l),c=t.to),g=t.to}else if(g==i||(r?nb[g]!=u:nb[g]==u))break;else g++;f?t(n,c,g,o+1,s,f,l):c<g&&l.push(new ny(c,g,p)),c=g}else for(let c=i,h=a.length;c>r;){let i=!0,d=!1;if(!h||c>a[h-1].to){let e=nb[c-1];e!=u&&(i=!1,d=16==e)}let f=i||1!=u?null:[],p=i?o:o+1,g=c;r:for(;;)if(h&&g==a[h-1].to){if(d)break;let t=a[--h];if(!i)for(let e=t.from,n=h;;){if(e==r)break r;if(n&&a[n-1].to==e)e=a[--n].from;else if(nb[e-1]==u)break r;else break}f?f.push(t):(t.to<c&&l.push(new ny(t.to,c,p)),e(n,t.direction==nu!=!(p%2)?o+1:o,s,t.inner,t.from,t.to,l),c=t.from),g=t.from}else if(g==r||(i?nb[g-1]!=u:nb[g-1]==u))break;else g--;f?t(n,g,c,o+1,s,f,l):g<c&&l.push(new ny(g,c,p)),c=g}}(t,o,s,n,r,i,a)}(e,i,i,n,0,e.length,r),r}(e.text,t,n);return this.bidiCache.push(new iq(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||tF.safari&&(null==(e=this.inputState)?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{nt(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of(this.root.activeElement==this.contentDOM&&this.contentDOM.blur(),this.plugins))e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return nL.of(new nD("number"==typeof e?ex.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return nL.of(new nD(ex.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nq.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nq.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=tv.newName(),r=[i_.of(n),nJ.of(iA(`.${n}`,e))];return t&&t.dark&&r.push(iO.of(!0)),r}static baseTheme(e){return eM.lowest(nJ.of(iA("."+iC,e,iP)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&n3.get(n)||n3.get(e);return(null==(t=null==r?void 0:r.root)?void 0:t.view)||null}}iF.styleModule=nJ,iF.inputHandler=nE,iF.clipboardInputFilter=nP,iF.clipboardOutputFilter=nA,iF.scrollHandler=nI,iF.focusChangeEffect=nT,iF.perLineTextDirection=nR,iF.exceptionSink=nO,iF.updateListener=nC,iF.editable=nF,iF.mouseSelectionStyle=n_,iF.dragMovesSelection=nk,iF.clickAddsSelectionRange=nS,iF.decorations=nH,iF.blockWrappers=nQ,iF.outerDecorations=n$,iF.atomicRanges=nK,iF.bidiIsolatedRanges=nX,iF.scrollMargins=nZ,iF.darkTheme=iO,iF.cspNonce=e_.define({combine:e=>e.length?e[0]:""}),iF.contentAttributes=nV,iF.editorAttributes=nz,iF.lineWrapping=iF.contentAttributes.of({class:"cm-lineWrapping"}),iF.announce=eX.define();let ij=4096,iU={};class iq{constructor(e,t,n,r,i,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=o}static update(e,t){if(t.empty&&!e.some(e=>e.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:nl.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let o=e[i];o.dir!=r||t.touchesRange(o.from,o.to)||n.push(new iq(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function iW(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],o="function"==typeof t?t(e):t;o&&tj(o,n)}return n}let iz=tF.mac?"mac":tF.windows?"win":tF.linux?"linux":"key";function iV(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}let iH=eM.default(iF.domEventHandlers({keydown:(e,t)=>iY(iK(t.state),e,t,"editor")})),iQ=e_.define({enables:iH}),i$=new WeakMap;function iK(e){let t=e.facet(iQ),n=i$.get(t);return n||i$.set(t,n=function(e,t=iz){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,r,o,s,a)=>{var l,u;let c=n[e]||(n[e]=Object.create(null)),h=r.split(/ (?!$)/).map(e=>(function(e,t){let n,r,i,o,s=e.split(/-(?!$)/),a=s[s.length-1];"Space"==a&&(a=" ");for(let e=0;e<s.length-1;++e){let a=s[e];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))"mac"==t?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+a)}return n&&(a="Alt-"+a),r&&(a="Ctrl-"+a),o&&(a="Meta-"+a),i&&(a="Shift-"+a),a})(e,t));for(let t=1;t<h.length;t++){let n=h.slice(0,t).join(" ");i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=iG={view:t,prefix:n,scope:e};return setTimeout(()=>{iG==r&&(iG=null)},4e3),!0}]})}let d=h.join(" ");i(d,!1);let f=c[d]||(c[d]={preventDefault:!1,stopPropagation:!1,run:(null==(u=null==(l=c._any)?void 0:l.run)?void 0:u.slice())||[]});o&&f.run.push(o),s&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,iZ))}let i=r[t]||r.key;if(i)for(let t of e)o(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&o(t,"Shift-"+i,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce((e,t)=>e.concat(t),[]))),n}function iX(e,t,n){return iY(iK(e.state),t,e,n)}let iG=null,iZ=null;function iY(e,t,n,r){var i;iZ=t;let o=("Esc"==(i=!(tS&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||tk&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?tx:tw)[t.keyCode]||t.key||"Unidentified")&&(i="Escape"),"Del"==i&&(i="Delete"),"Left"==i&&(i="ArrowLeft"),"Up"==i&&(i="ArrowUp"),"Right"==i&&(i="ArrowRight"),"Down"==i&&(i="ArrowDown"),i),s=eu(ea(o,0))==o.length&&" "!=o,a="",l=!1,u=!1,c=!1;iG&&iG.view==n&&iG.scope==r&&(a=iG.prefix+" ",0>rU.indexOf(t.keyCode)&&(u=!0,iG=null));let h=new Set,d=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),u=!0)}return!1},f=e[r],p,g;return f&&(d(f[a+iV(o,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(tF.windows&&t.ctrlKey&&t.altKey)&&!(tF.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=tw[t.keyCode])&&p!=o?d(f[a+iV(p,t,!0)])?l=!0:t.shiftKey&&(g=tx[t.keyCode])!=o&&g!=p&&d(f[a+iV(g,t,!1)])&&(l=!0):s&&t.shiftKey&&d(f[a+iV(o,t,!0)])&&(l=!0),!l&&d(f._any)&&(l=!0)),u&&(l=!0),l&&c&&t.stopPropagation(),iZ=null,l}class iJ{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(!n.empty)return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==nl.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=i0(e),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),f=rx(e,r,1),p=rx(e,i,-1),g=f.type==tV.Text?f:null,m=p.type==tV.Text?p:null;if(g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=i1(e,r,1,g)),m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=i1(e,i,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return y(b(n.from,n.to,g));{let t=g?b(n.from,null,g):w(f,!1),r=m?b(null,n.to,m):w(p,!0),i=[];return(g||f).to<(m||p).from-(g&&m?1:0)||f.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(v(h,t.bottom,d,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==tV.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(i).concat(y(r))}function v(e,n,r,i){return new iJ(t,e-l.left,n-l.top,r-e,i-n)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(v(n[i],e,n[i+1],t));return r}function b(t,n,r){let i=1e9,s=-1e9,a=[];function l(t,n,l,u,c){let f=e.coordsAtPos(t,t==r.to?-2:2),p=e.coordsAtPos(l,l==r.from?2:-2);f&&p&&(i=Math.min(f.top,p.top,i),s=Math.max(f.bottom,p.bottom,s),c==nl.LTR?a.push(o&&n?h:f.left,o&&u?d:p.right):a.push(!o&&u?h:p.left,!o&&n?d:f.right))}let u=null!=t?t:r.from,c=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>u&&r.from<c)for(let i=Math.max(r.from,u),o=Math.min(r.to,c);;){let r=e.state.doc.lineAt(i);for(let s of e.bidiSpans(r)){let e=s.from+r.from,a=s.to+r.from;if(e>=o)break;a>i&&l(Math.max(e,i),null==t&&e<=u,Math.min(a,o),null==n&&a>=c,s.dir)}if((i=r.to+1)>=o)break}return 0==a.length&&l(u,null==t,c,null==n,e.textDirection),{top:i,bottom:s,horizontal:a}}function w(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n);{let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let i=i0(e);return[new iJ(t,r.left-i.left,r.top-i.top,null,r.bottom-r.top)]}}}function i0(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==nl.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function i1(e,t,n,r){let i=e.coordsAtPos(t,2*n);if(!i)return r;let o=e.dom.getBoundingClientRect(),s=(i.top+i.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return null==a||null==l?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}class i2{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(i3)!=e.state.facet(i3)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(i3);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>{var n;return n=this.drawn[t],!(e.constructor==n.constructor&&e.eq(n))})){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,tF.safari&&tF.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}let i3=e_.define();function i4(e){return[nq.define(t=>new i2(t,e)),i3.of(e)]}let i8=e_.define({combine:e=>e4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function i6(e={}){return[i8.of(e),i9,oe,ot,nM.of(!0)]}function i5(e){return e.startState.facet(i8)!=e.state.facet(i8)}let i9=i4({above:!0,markers(e){let{state:t}=e,n=t.facet(i8),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty||n.drawRangeCursor){let t=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=i.empty?i:ex.cursor(i.head,i.head>i.anchor?-1:1);for(let i of iJ.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=i5(e);return n&&i7(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){i7(t.state,e)},class:"cm-cursorLayer"});function i7(e,t){t.style.animationDuration=e.facet(i8).cursorBlinkRate+"ms"}let oe=i4({above:!1,markers:e=>e.state.selection.ranges.map(t=>t.empty?[]:iJ.forRange(e,"cm-selectionBackground",t)).reduce((e,t)=>e.concat(t)),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||i5(e),class:"cm-selectionLayer"}),ot=eM.highest(iF.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),on=eX.define({map:(e,t)=>null==e?null:t.mapPos(e)}),or=eA.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(on)?t.value:e,e))}),oi=nq.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(or);null==n?null!=this.cursor&&(null==(t=this.cursor)||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(or)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(or),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(or)!=e&&this.view.dispatch({effects:on.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function oo(){return[or,oi]}function os(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}class oa{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:o=1e3}=e;if(!t.global)throw RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,i)=>{let o=n(e,t,r);o&&i(r,r+e[0].length,o)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=i,this.maxLength=o}createDeco(e){let t=new tt,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}(e,this.maxLength))os(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return(e.docChanged&&e.changes.iterChanges((t,i,o,s)=>{s>=e.view.viewport.from&&o<=e.view.viewport.to&&(n=Math.min(o,n),r=Math.max(s,r))}),e.viewportMoved||r-n>1e3)?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let o=Math.max(i.from,n),s=Math.min(i.to,r);if(s>=o){let n=e.state.doc.lineAt(o),r=n.to<s?e.state.doc.lineAt(s):n,a=Math.max(i.from,n.from),l=Math.min(i.to,r.to);if(this.boundary){for(;o>n.from;o--)if(this.boundary.test(n.text[o-1-n.from])){a=o;break}for(;s<r.to;s++)if(this.boundary.test(r.text[s-r.from])){l=s;break}}let u=[],c,h=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,h);else os(e.state.doc,this.regexp,a,l,(t,n)=>this.addMatch(n,e,t,h));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:u})}}return t}}let ol=null!=/x/.unicode?"gu":"g",ou=RegExp("[\0-\b\n-\x1f-Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]",ol),oc={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},oh=null,od=e_.define({combine(e){let t=e4(e,{render:null,specialChars:ou,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==oh&&"u">typeof document&&document.body){let t=document.body.style;oh=(null!=(e=t.tabSize)?e:t.MozTabSize)!=null}return oh||!1}())&&(t.specialChars=RegExp(" |"+t.specialChars.source,ol)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,ol)),t}});function of(e={}){return[od.of(e),op||(op=nq.fromClass(class{constructor(e){this.view=e,this.decorations=tH.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(od)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new oa({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=ea(t[0],0);if(9==o){let e=i.lineAt(r),t=n.state.tabSize,o=td(e.text,t,r-e.from);return tH.replace({widget:new om((t-o%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=tH.replace({widget:new og(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(od);e.startState.facet(od)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let op=null;class og extends tz{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){var t;let n=(t=this.code)>=32?"•":10==t?"␤":String.fromCharCode(9216+t),r=e.state.phrase("Control character")+" "+(oc[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class om extends tz{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function ov(){return ob}let oy=tH.line({class:"cm-activeLine"}),ob=nq.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(oy.range(i.from)),t=i.from)}return tH.set(n)}},{decorations:e=>e.decorations});class ow extends tz{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?t1(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=t5(t[0],"rtl"!=n.direction),i=parseInt(n.lineHeight);return r.bottom-r.top>1.5*i?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}}function ox(e){let t=nq.fromClass(class{constructor(t){this.view=t,this.placeholder=e?tH.set([tH.widget({widget:new ow(e),side:1}).range(0)]):tH.none}get decorations(){return this.view.state.doc.length?tH.none:this.placeholder}},{decorations:e=>e.decorations});return"string"==typeof e?[t,iF.contentAttributes.of({"aria-placeholder":e})]:t}function oS(e,t){var n;let r,i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(i),s=i-o.from,a=s>2e3?-1:s==o.length?(n=t.clientX,(r=e.coordsAtPos(e.viewport.from))?Math.round(Math.abs((r.left-n)/e.defaultCharacterWidth)):-1):td(o.text,e.state.tabSize,i-o.from);return{line:o.number,col:a,off:s}}function ok(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return iF.mouseSelectionStyle.of((e,n)=>{let r,i;return t(n)?(r=oS(e,n),i=e.state.selection,{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(r.line).from),n=e.state.doc.lineAt(t);r={line:n.number,col:r.col,off:Math.min(r.off,n.length)},i=i.map(e.changes)}},get(t,n,o){let s=oS(e,t),a=function(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>2e3||n.off>2e3||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=a&&o.push(ex.range(n.from+s,n.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=tf(n.text,s,e.tabSize,!0);if(r<0)o.push(ex.cursor(n.to));else{let t=tf(n.text,a,e.tabSize);o.push(ex.range(n.from+r,n.from+t))}}}return o}(e.state,r,s);return a.length?o?ex.create(a.concat(i.ranges)):ex.create(a):i}}):null})}let o_={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},oO={style:"cursor: crosshair"};function oC(e={}){let[t,n]=o_[e.key||"Alt"],r=nq.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,iF.contentAttributes.of(e=>{var t;return(null==(t=e.plugin(r))?void 0:t.isDown)?oO:null})]}let oE="-10000px";class oT{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],a=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(a=e)}if(a<0)o[n]=this.createTooltipView(r,n?o[n-1]:null),s&&(s[n]=!!r.above);else{let r=o[n]=this.tooltipViews[a];s&&(s[n]=t[a]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)0>o.indexOf(e)&&(this.removeTooltipView(e),null==(n=e.destroy)||n.call(e));return t&&(s.forEach((e,n)=>t[n]=e),t.length=s.length),this.input=r,this.tooltips=i,this.tooltipViews=o,!0}}function oP(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}let oA=e_.define({combine:e=>{var t,n,r;return{position:tF.ios?"absolute":(null==(t=e.find(e=>e.position))?void 0:t.position)||"fixed",parent:(null==(n=e.find(e=>e.parent))?void 0:n.parent)||null,tooltipSpace:(null==(r=e.find(e=>e.tooltipSpace))?void 0:r.tooltipSpace)||oP}}}),oR=new WeakMap,oM=nq.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(oA);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new oT(e,oN,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver)for(let e of(this.intersectionObserver.disconnect(),this.manager.tooltipViews))this.intersectionObserver.observe(e.dom)}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(oA);if(r.position!=this.position&&!this.madeAbsolute){for(let e of(this.position=r.position,this.manager.tooltipViews))e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){for(let e of(this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer(),this.manager.tooltipViews))this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=oE,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;for(let t of(this.view.win.removeEventListener("resize",this.measureSoon),this.manager.tooltipViews))t.dom.remove(),null==(e=t.destroy)||e.call(t);this.parent&&this.container.remove(),null==(t=this.resizeObserver)||t.disconnect(),null==(n=this.intersectionObserver)||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(tF.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||"absolute"==this.position)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=nY(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(oA).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute)for(let e of(this.madeAbsolute=!0,this.position="absolute",this.manager.tooltipViews))e.dom.style.position="absolute";let{visible:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],u=this.manager.tooltipViews[a],{dom:c}=u,h=e.pos[a],d=e.size[a];if(!h||!1!==l.clip&&(h.bottom<=Math.max(n.top,r.top)||h.top>=Math.min(n.bottom,r.bottom)||h.right<Math.max(n.left,r.left)-.1||h.left>Math.min(n.right,r.right)+.1)){c.style.top=oE;continue}let f=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=7*!!f,g=d.right-d.left,m=null!=(t=oR.get(u))?t:d.bottom-d.top,v=u.offset||oL,y=this.view.textDirection==nl.LTR,b=d.width>r.right-r.left?y?r.left:r.right-d.width:y?Math.max(r.left,Math.min(h.left-14*!!f+v.x,r.right-g)):Math.min(Math.max(r.left,h.left-g+14*!!f-v.x),r.right-g),w=this.above[a];!l.strictSide&&(w?h.top-m-p-v.y<r.top:h.bottom+m+p+v.y>r.bottom)&&w==r.bottom-h.bottom>h.top-r.top&&(w=this.above[a]=!w);let x=(w?h.top-r.top:r.bottom-h.bottom)-p;if(x<m&&!1!==u.resize){if(x<this.view.defaultLineHeight){c.style.top=oE;continue}oR.set(u,m),c.style.height=(m=x)/o+"px"}else c.style.height&&(c.style.height="");let S=w?h.top-m-p-v.y:h.bottom+p+v.y,k=b+g;if(!0!==u.overlap)for(let e of s)e.left<k&&e.right>b&&e.top<S+m&&e.bottom>S&&(S=w?e.top-m-2-p:e.bottom+p+2);if("absolute"==this.position?(c.style.top=(S-e.parent.top)/o+"px",oI(c,(b-e.parent.left)/i)):(c.style.top=S/o+"px",oI(c,b/i)),f){let e=h.left+(y?v.x:-v.x)-(b+14-7);f.style.left=e/i+"px"}!0!==u.overlap&&s.push({left:b,top:S,right:k,bottom:S+m}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView)&&(this.inView=this.view.inView,!this.inView))for(let e of this.manager.tooltipViews)e.dom.style.top=oE}},{eventObservers:{scroll(){this.maybeMeasure()}}});function oI(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}let oD=iF.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),oL={x:0,y:0},oN=e_.define({enables:[oM,oD]}),oB=e_.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])});class oF{static create(e){return new oF(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new oT(e,oB,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null==(e=t.destroy)||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r){if(void 0===t)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}let oj=oN.compute([oB],e=>{let t=e.facet(oB);return 0===t.length?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var t;return null!=(t=e.end)?t:e.pos})),create:oF.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class oU{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(null==(r=e.posAtCoords(t)))return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),s=o&&o.dir==nl.RTL?-1:1;i=t.x<n.left?-s:s}let o=this.source(e,r,i);if(null==o?void 0:o.then){let t=this.pending={pos:r};o.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>nB(e.state,t,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(oM),t=e?e.manager.tooltips.findIndex(e=>e.create==oF.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:i}=this;if(r.length&&i&&!function(e,t){let{left:n,right:r,top:i,bottom:o}=e.getBoundingClientRect(),s;if(s=e.querySelector(".cm-tooltip-arrow")){let e=s.getBoundingClientRect();i=Math.min(e.top,i),o=Math.max(e.bottom,o)}return t.clientX>=n-4&&t.clientX<=r+4&&t.clientY>=i-4&&t.clientY<=o+4}(i.dom,e)||this.pending){let{pos:i}=r[0]||this.pending,o=null!=(n=null==(t=r[0])?void 0:t.end)?n:i;(i==o?this.view.posAtCoords(this.lastMove)!=i:!function(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=e.posAtCoords({x:r,y:i},!1);return l>=t&&l<=n}(this.view,i,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function oq(e,t={}){let n=eX.define(),r=eA.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,eh.TrackDel);if(null!=e){let i=Object.assign(Object.create(null),n);i.pos=e,null!=i.end&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(oz)&&(e=[]);return e},provide:e=>oB.from(e)});return{active:r,extension:[r,nq.define(i=>new oU(i,e,r,n,t.hoverTime||300)),oj]}}function oW(e,t){let n=e.plugin(oM);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}let oz=eX.define(),oV=e_.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function oH(e,t){let n=e.plugin(oQ),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}let oQ=nq.fromClass(class{constructor(e){this.input=e.state.facet(oX),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(oV);for(let n of(this.top=new o$(e,!0,t.topContainer),this.bottom=new o$(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top)),this.panels))n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(oV);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new o$(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new o$(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(oX);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],o=[],s=[];for(let n of t){let t=this.specs.indexOf(n),a;t<0?(a=n(e.view),s.push(a)):(a=this.panels[t]).update&&a.update(e),r.push(a),(a.top?i:o).push(a)}for(let e of(this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(o),s))e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>iF.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class o${constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&0>e.indexOf(t)&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=oK(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=oK(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function oK(e){let t=e.nextSibling;return e.remove(),t}let oX=e_.define({enables:oQ});function oG(e,t){let n,r=new Promise(e=>n=e),i=e=>(function(e,t,n){let r=t.content?t.content(e,()=>s(null)):null;if(!r){if(r=tC("form"),t.input){let e=tC("input",t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add("cm-textfield"),e.name||(e.name="input"),r.appendChild(tC("label",(t.label||"")+": ",e))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(tC("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i="FORM"==r.nodeName?[r]:r.querySelectorAll("form");for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener("keydown",e=>{27==e.keyCode?(e.preventDefault(),s(null)):13==e.keyCode&&(e.preventDefault(),s(t))}),t.addEventListener("submit",e=>{e.preventDefault(),s(t)})}let o=tC("div",r,tC("button",{onclick:()=>s(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));function s(t){o.contains(o.ownerDocument.activeElement)&&e.focus(),n(t)}return t.class&&(o.className=t.class),o.classList.add("cm-dialog"),{dom:o,top:t.top,mount:()=>{if(t.focus){let e;(e="string"==typeof t.focus?r.querySelector(t.focus):r.querySelector("input")||r.querySelector("button"))&&"select"in e?e.select():e&&"focus"in e&&e.focus()}}}})(e,t,n);e.state.field(oZ,!1)?e.dispatch({effects:oY.of(i)}):e.dispatch({effects:eX.appendConfig.of(oZ.init(()=>[i]))});let o=oJ.of(i);return{close:o,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(oZ).indexOf(i)>-1&&e.dispatch({effects:o})}),t))}}let oZ=eA.define({create:()=>[],update(e,t){for(let n of t.effects)n.is(oY)?e=[n.value].concat(e):n.is(oJ)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>oX.computeN([e],t=>t.field(e))}),oY=eX.define(),oJ=eX.define();class o0 extends e8{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}o0.prototype.elementClass="",o0.prototype.toDOM=void 0,o0.prototype.mapMode=eh.TrackBefore,o0.prototype.startSide=o0.prototype.endSide=-1,o0.prototype.point=!0;let o1=e_.define(),o2=e_.define(),o3={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>te.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},o4=e_.define();function o8(e){return[o5(),o4.of({...o3,...e})]}let o6=e_.define({combine:e=>e.some(e=>e)});function o5(e){let t=[o9];return e&&!1===e.fixed&&t.push(o6.of(!0)),t}let o9=nq.fromClass(class{constructor(e){for(let t of(this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(o4).map(t=>new sn(e,t)),this.fixed=!e.state.facet(o6),this.gutters))"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(o6)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=te.iter(this.view.state.facet(o1),this.view.viewport.from),r=[],i=this.gutters.map(e=>new st(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let o of e.type)if(o.type==tV.Text&&t){for(let e of(se(n,r,o.from),i))e.line(this.view,o,r);t=!1}else if(o.widget)for(let e of i)e.widget(this.view,o)}else if(e.type==tV.Text)for(let t of(se(n,r,e.from),i))t.line(this.view,e,r);else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(o4),n=e.state.facet(o4),r=e.docChanged||e.heightChanged||e.viewportChanged||!te.eq(e.startState.facet(o1),e.state.facet(o1),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new sn(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),0>i.indexOf(e)&&e.destroy();for(let e of i)"after"==e.config.side?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>iF.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||0==n.gutters.length||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==nl.LTR?{left:r,right:i}:{right:r,left:i}})});function o7(e){return Array.isArray(e)?e:[e]}function se(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class st{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=te.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let t=new sr(e,o,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,o,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];se(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let o=this.gutter;(0!=r.length||o.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(o2)){let i=n(e,t.widget,t);i&&(r||(r=[])).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class sn{constructor(e,t){for(let n in this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:""),t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,o;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,s,r)&&r.preventDefault()});this.markers=o7(t.markers(e)),t.initialSpacer&&(this.spacer=new sr(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=o7(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!te.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class sr{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),!function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)&&this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let i=0,o=0;;){let s=o,a=i<t.length?t[i++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!a)break;a.toDOM&&(l?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),l&&o++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}let si=e_.define(),so=e_.define(),ss=e_.define({combine:e=>e4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})});class sa extends o0{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function sl(e,t){return e.state.facet(ss).formatNumber(t,e.state)}let su=o4.compute([ss],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(si),lineMarker:(e,t,n)=>n.some(e=>e.toDOM)?null:new sa(sl(e,e.state.doc.lineAt(t.from).number)),widgetMarker:(e,t,n)=>{for(let r of e.state.facet(so)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(ss)!=e.state.facet(ss),initialSpacer:e=>new sa(sl(e,sh(e.state.doc.lines))),updateSpacer(e,t){let n=sl(t.view,sh(t.view.state.doc.lines));return n==e.number?e:new sa(n)},domEventHandlers:e.facet(ss).domEventHandlers,side:"before"}));function sc(e={}){return[ss.of(e),o5(),su]}function sh(e){let t=9;for(;t<e;)t=10*t+9;return t}let sd=new class extends o0{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},sf=o1.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(sd.range(i)))}return te.of(t)});function sp(){return sf}e.s(["Decoration",()=>tH,"Direction",()=>nl,"EditorView",()=>iF,"GutterMarker",()=>o0,"ViewPlugin",()=>nq,"WidgetType",()=>tz,"crosshairCursor",()=>oC,"drawSelection",()=>i6,"dropCursor",()=>oo,"getPanel",()=>oH,"getTooltip",()=>oW,"gutter",()=>o8,"highlightActiveLine",()=>ov,"highlightActiveLineGutter",()=>sp,"highlightSpecialChars",()=>of,"hoverTooltip",()=>oq,"keymap",()=>iQ,"lineNumbers",()=>sc,"logException",()=>nB,"placeholder",()=>ox,"rectangularSelection",()=>ok,"runScopeHandlers",()=>iX,"showDialog",()=>oG,"showPanel",()=>oX,"showTooltip",()=>oN],564482);let sg=0;class sm{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=sg++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){if(e instanceof sm&&(t=e),null==t?void 0:t.base)throw Error("Can not derive from a modified tag");let n=new sm("string"==typeof e?e:"?",[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new sy(e);return e=>e.modified.indexOf(t)>-1?e:sy.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}}let sv=0;class sy{constructor(e){this.name=e,this.instances=[],this.id=sv++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var r,i;return n.base==e&&(r=t,i=n.modified,r.length==i.length&&r.every((e,t)=>e==i[t]))});if(n)return n;let r=[],i=new sm(e.name,r,e,t);for(let e of t)e.instances.push(i);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of o)r.push(sy.get(t,e));return i}}function sb(e){let t=Object.create(null);for(let n in e){let r=e[n];for(let e of(Array.isArray(r)||(r=[r]),n.split(" ")))if(e){let n=[],i=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!r)throw RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),(t+=r[0].length)==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){i=0;break}if("/"!=s)throw RangeError("Invalid path: "+e);o=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw RangeError("Invalid path: "+e);let l=new sx(r,i,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return sw.add(t)}let sw=new p({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let o=new sx(i.tags,i.mode,i.context);n?n.next=o:r=o,n=o}return r}});class sx{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function sS(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function sk(e,t,n,r=0,i=e.length){let o=new s_(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}sx.empty=new sx([],2,null);class s_{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:o,from:s,to:a}=e;if(s>=n||a<=t)return;o.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=r,u=function(e){let t=e.type.prop(sw);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||sx.empty,c=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(i,u.tags);if(c&&(l&&(l+=" "),l+=c,1==u.mode&&(r+=(r?" ":"")+c)),this.startSpan(Math.max(t,s),l),u.opaque)return;let h=e.tree&&e.tree.prop(p.mounted);if(h&&h.overlay){let o=e.node.enter(h.overlay[0].from+s,1),u=this.highlighters.filter(e=>!e.scope||e.scope(h.tree.type)),c=e.firstChild();for(let d=0,f=s;;d++){let p=d<h.overlay.length?h.overlay[d]:null,g=p?p.from+s:a,m=Math.max(t,f),v=Math.min(n,g);if(m<v&&c)for(;e.from<v&&(this.highlightRange(e,m,v,r,i),this.startSpan(Math.min(v,e.to),l),!(e.to>=g)&&e.nextSibling()););if(!p||g>n)break;(f=p.to+s)>t&&(this.highlightRange(o.cursor(),Math.max(t,p.from+s),Math.min(n,f),"",u),this.startSpan(Math.min(n,f),l))}c&&e.parent()}else if(e.firstChild()){h&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling())e.parent()}}}let sO=sm.define,sC=sO(),sE=sO(),sT=sO(sE),sP=sO(sE),sA=sO(),sR=sO(sA),sM=sO(sA),sI=sO(),sD=sO(sI),sL=sO(),sN=sO(),sB=sO(),sF=sO(sB),sj=sO(),sU={comment:sC,lineComment:sO(sC),blockComment:sO(sC),docComment:sO(sC),name:sE,variableName:sO(sE),typeName:sT,tagName:sO(sT),propertyName:sP,attributeName:sO(sP),className:sO(sE),labelName:sO(sE),namespace:sO(sE),macroName:sO(sE),literal:sA,string:sR,docString:sO(sR),character:sO(sR),attributeValue:sO(sR),number:sM,integer:sO(sM),float:sO(sM),bool:sO(sA),regexp:sO(sA),escape:sO(sA),color:sO(sA),url:sO(sA),keyword:sL,self:sO(sL),null:sO(sL),atom:sO(sL),unit:sO(sL),modifier:sO(sL),operatorKeyword:sO(sL),controlKeyword:sO(sL),definitionKeyword:sO(sL),moduleKeyword:sO(sL),operator:sN,derefOperator:sO(sN),arithmeticOperator:sO(sN),logicOperator:sO(sN),bitwiseOperator:sO(sN),compareOperator:sO(sN),updateOperator:sO(sN),definitionOperator:sO(sN),typeOperator:sO(sN),controlOperator:sO(sN),punctuation:sB,separator:sO(sB),bracket:sF,angleBracket:sO(sF),squareBracket:sO(sF),paren:sO(sF),brace:sO(sF),content:sI,heading:sD,heading1:sO(sD),heading2:sO(sD),heading3:sO(sD),heading4:sO(sD),heading5:sO(sD),heading6:sO(sD),contentSeparator:sO(sI),list:sO(sI),quote:sO(sI),emphasis:sO(sI),strong:sO(sI),link:sO(sI),monospace:sO(sI),strikethrough:sO(sI),inserted:sO(),deleted:sO(),changed:sO(),invalid:sO(),meta:sj,documentMeta:sO(sj),annotation:sO(sj),processingInstruction:sO(sj),definition:sm.defineModifier("definition"),constant:sm.defineModifier("constant"),function:sm.defineModifier("function"),standard:sm.defineModifier("standard"),local:sm.defineModifier("local"),special:sm.defineModifier("special")};for(let e in sU){let t=sU[e];t instanceof sm&&(t.name=e)}sS([{tag:sU.link,class:"tok-link"},{tag:sU.heading,class:"tok-heading"},{tag:sU.emphasis,class:"tok-emphasis"},{tag:sU.strong,class:"tok-strong"},{tag:sU.keyword,class:"tok-keyword"},{tag:sU.atom,class:"tok-atom"},{tag:sU.bool,class:"tok-bool"},{tag:sU.url,class:"tok-url"},{tag:sU.labelName,class:"tok-labelName"},{tag:sU.inserted,class:"tok-inserted"},{tag:sU.deleted,class:"tok-deleted"},{tag:sU.literal,class:"tok-literal"},{tag:sU.string,class:"tok-string"},{tag:sU.number,class:"tok-number"},{tag:[sU.regexp,sU.escape,sU.special(sU.string)],class:"tok-string2"},{tag:sU.variableName,class:"tok-variableName"},{tag:sU.local(sU.variableName),class:"tok-variableName tok-local"},{tag:sU.definition(sU.variableName),class:"tok-variableName tok-definition"},{tag:sU.special(sU.variableName),class:"tok-variableName2"},{tag:sU.definition(sU.propertyName),class:"tok-propertyName tok-definition"},{tag:sU.typeName,class:"tok-typeName"},{tag:sU.namespace,class:"tok-namespace"},{tag:sU.className,class:"tok-className"},{tag:sU.macroName,class:"tok-macroName"},{tag:sU.propertyName,class:"tok-propertyName"},{tag:sU.operator,class:"tok-operator"},{tag:sU.comment,class:"tok-comment"},{tag:sU.meta,class:"tok-meta"},{tag:sU.invalid,class:"tok-invalid"},{tag:sU.punctuation,class:"tok-punctuation"}]),e.s(["highlightTree",()=>sk,"styleTags",()=>sb,"tagHighlighter",()=>sS,"tags",()=>sU],499242);let sq=new p,sW=new p;class sz{constructor(e,t,n=[],r=""){this.data=e,this.name=r,e3.prototype.hasOwnProperty("tree")||Object.defineProperty(e3.prototype,"tree",{get(){return sQ(this)}}),this.parser=t,this.extension=[s1.of(this),e3.languageData.of((e,t,n)=>{let r=sV(e,t,n),i=r.type.prop(sq);if(!i)return[];let o=e.facet(i),s=r.type.prop(sW);if(s){let i=r.resolve(t-r.from,n);for(let t of s)if(t.test(i,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(o)}}return o})].concat(n)}isActiveAt(e,t,n=-1){return sV(e,t,n).type.prop(sq)==this.data}findRegions(e){let t=e.facet(s1);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(sq)==this.data)return void n.push({from:t,to:t+e.length});let i=e.prop(p.mounted);if(i){if(i.tree.prop(sq)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof x&&r(i,e.positions[n]+t)}};return r(sQ(e),0),n}get allowsNesting(){return!0}}function sV(e,t,n){let r=e.facet(s1),i=sQ(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,u.ExcludeBuffers|u.EnterBracketed))e.type.isTop&&(i=e);return i}sz.setState=eX.define();class sH extends sz{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,e_.define({combine:t?e=>e.concat(t):void 0}));return new sH(n,e.parser.configure({props:[sq.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new sH(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function sQ(e){let t=e.field(sz.state,!1);return t?t.tree:x.empty}class s${constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let sK=null;class sX{constructor(e,t,n=[],r,i,o,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new sX(e,t,[],x.empty,0,n,[],null)}startParse(){return this.parser.startParse(new s$(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=x.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(j.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!=(n=this.parse.stoppedAt)?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(j.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=sK;sK=this;try{return e()}finally{sK=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sG(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:i,viewport:o,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=j.applyChanges(n,t),r=x.empty,i=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(s=[],this.skipped)){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&s.push({from:n,to:r})}}return new sX(this.parser,t,n,r,i,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=sG(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends U{createParse(t,n,r){let i=r[0].from,o=r[r.length-1].to;return{parsedPos:i,advance(){let t=sK;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new x(v.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return sK}}function sG(e,t,n){return j.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class sZ{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new sZ(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=sX.create(e.facet(s1).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new sZ(n)}}sz.state=eA.define({create:sZ.init,update(e,t){for(let e of t.effects)if(e.is(sz.setState))return e.value;return t.startState.facet(s1)!=t.state.facet(s1)?sZ.init(t.state):e.apply(t)}});let sY=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"u">typeof requestIdleCallback&&(sY=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let sJ="u">typeof navigator&&(null==(c=navigator.scheduling)?void 0:c.isInputPending)?()=>navigator.scheduling.isInputPending():null,s0=nq.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(sz.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(sz.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=sY(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(sz.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!sJ?Math.max(25,e.timeRemaining()-5):1e9),s=i.context.treeLen<r&&n.doc.length>r+1e3,a=i.context.work(()=>sJ&&sJ()||Date.now()>o,r+1e5*!s);this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:sz.setState.of(new sZ(i.context))})),this.chunkBudget>0&&!(a&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>nB(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),s1=e_.define({combine:e=>e.length?e[0]:null,enables:e=>[sz.state,s0,iF.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class s2{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}let s3=e_.define(),s4=e_.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function s8(e){let t=e.facet(s4);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function s6(e,t){let n="",r=e.tabSize,i=e.facet(s4)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function s5(e,t){for(let n of(e instanceof e3&&(e=new s9(e)),e.state.facet(s3))){let r=n(e,t);if(void 0!==r)return r}let n=sQ(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return ae(r,e,n)}(e,n,t):null}class s9{constructor(e,t={}){this.state=e,this.options=t,this.unit=s8(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;if(null!=r&&r>=n.from&&r<=n.to)if(i&&r==e)return{text:"",from:e};else if(t<0?r<e:r<=e)return{text:n.text.slice(r-n.from),from:r};else return{text:n.text.slice(0,r-n.from),from:n.from};return n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(i+=o-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return td(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let s7=new p;function ae(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(s7);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(p.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>ai(e,!0,1,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?at:null}(r.node);if(e)return e(an.create(t,n,r))}return 0}function at(){return 0}class an extends s9{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new an(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return ae(this.context.next,this.base,this.pos)}}function ar({closing:e,align:t=!0,units:n=1}){return r=>ai(r,t,n,e)}function ai(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=null==i||i<=o.from?o.to:Math.min(o.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=s)return null;let e=/^ */.exec(o.text.slice(n.to-o.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}function ao({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}function as(){return e3.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let o=n.sliceString(i.from,r);if(!t.some(e=>e.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=s5(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=s6(s,n);r!=i&&l.push({from:t.from,to:t.from+r.length,insert:i})}return l.length?[e,{changes:l,sequential:!0}]:e})}let aa=e_.define(),al=new p;function au(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function ac(e,t,n){for(let r of e.facet(aa)){let i=r(e,t,n);if(i)return i}return function(e,t,n){let r=sQ(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let i=s.node;if(i.to<=n||i.from>n)continue;if(o&&i.from<t)break;let a=i.type.prop(al);if(a&&(i.to<r.length-50||r.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(i))){let r=a(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function ah(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let ad=eX.define({map:ah}),af=eX.define({map:ah});function ap(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let ag=eA.define({create:()=>tH.none,update(e,t){for(let n of(t.isUserEvent("delete")&&t.changes.iterChangedRanges((t,n)=>e=am(e,t,n)),e=e.map(t.changes),t.effects))if(n.is(ad)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(aS),i=r?tH.replace({widget:new aC(r(t.state,n.value))}):aO;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(af)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=am(e,t.selection.main.head)),e},provide:e=>iF.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(aO.range(r,i))}return tH.set(t,!0)}});function am(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function av(e,t,n){var r;let i=null;return null==(r=e.field(ag,!1))||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function ay(e,t){return e.field(ag,!1)?t:t.concat(eX.appendConfig.of(ak()))}function ab(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return iF.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}let aw=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of ap(e)){let n=ac(e.state,t.from,t.to);if(n)return e.dispatch({effects:ay(e.state,[ad.of(n),ab(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(ag,!1))return!1;let t=[];for(let n of ap(e)){let r=av(e.state,n.from,n.to);r&&t.push(af.of(r),ab(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=ac(t,i.from,i.to);o&&n.push(ad.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:ay(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(ag,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(af.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],ax={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},aS=e_.define({combine:e=>e4(e,ax)});function ak(e){let t=[ag,aA];return e&&t.push(aS.of(e)),t}function a_(e,t){let{state:n}=e,r=n.facet(aS),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=av(e.state,n.from,n.to);r&&e.dispatch({effects:af.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}let aO=tH.replace({widget:new class extends tz{toDOM(e){return a_(e,null)}}});class aC extends tz{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return a_(e,this.value)}}let aE={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class aT extends o0{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function aP(e={}){let t={...aE,...e},n=new aT(t,!0),r=new aT(t,!1),i=nq.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(s1)!=e.state.facet(s1)||e.startState.field(ag,!1)!=e.state.field(ag,!1)||sQ(e.startState)!=sQ(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new tt;for(let i of e.viewportLineBlocks){let o=av(e.state,i.from,i.to)?r:ac(e.state,i.from,i.to)?n:null;o&&t.add(i.from,i.from,o)}return t.finish()}}),{domEventHandlers:o}=t;return[i,o8({class:"cm-foldGutter",markers(e){var t;return(null==(t=e.plugin(i))?void 0:t.markers)||te.empty},initialSpacer:()=>new aT(t,!1),domEventHandlers:{...o,click:(e,t,n)=>{if(o.click&&o.click(e,t,n))return!0;let r=av(e.state,t.from,t.to);if(r)return e.dispatch({effects:af.of(r)}),!0;let i=ac(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:ad.of(i)}),!0)}}}),ak()]}let aA=iF.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class aR{constructor(e,t){let n;function r(e){let t=tv.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof sz?e=>e.prop(sq)==o.data:o?e=>e==o:void 0,this.style=sS(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new tv(n):null,this.themeType=t.themeType}static define(e,t){return new aR(e,t||{})}}let aM=e_.define(),aI=e_.define({combine:e=>e.length?[e[0]]:null});function aD(e){let t=e.facet(aM);return t.length?t:e.facet(aI)}function aL(e,t){let n=[aB],r;return e instanceof aR&&(e.module&&n.push(iF.styleModule.of(e.module)),r=e.themeType),(null==t?void 0:t.fallback)?n.push(aI.of(e)):r?n.push(aM.computeN([iF.darkTheme],t=>t.facet(iF.darkTheme)==("dark"==r)?[e]:[])):n.push(aM.of(e)),n}function aN(e,t,n){let r=aD(e),i=null;if(r){for(let e of r)if(!e.scope||n&&e.scope(n)){let n=e.style(t);n&&(i=i?i+" "+n:n)}}return i}let aB=eM.high(nq.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=sQ(e.state),this.decorations=this.buildDeco(e,aD(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=sQ(e.state),n=aD(e.state),r=n!=aD(e.startState),{viewport:i}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return tH.none;let n=new tt;for(let{from:r,to:i}of e.visibleRanges)sk(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=tH.mark({class:r})))},r,i);return n.finish()}},{decorations:e=>e.decorations})),aF=aR.define([{tag:sU.meta,color:"#404740"},{tag:sU.link,textDecoration:"underline"},{tag:sU.heading,textDecoration:"underline",fontWeight:"bold"},{tag:sU.emphasis,fontStyle:"italic"},{tag:sU.strong,fontWeight:"bold"},{tag:sU.strikethrough,textDecoration:"line-through"},{tag:sU.keyword,color:"#708"},{tag:[sU.atom,sU.bool,sU.url,sU.contentSeparator,sU.labelName],color:"#219"},{tag:[sU.literal,sU.inserted],color:"#164"},{tag:[sU.string,sU.deleted],color:"#a11"},{tag:[sU.regexp,sU.escape,sU.special(sU.string)],color:"#e40"},{tag:sU.definition(sU.variableName),color:"#00f"},{tag:sU.local(sU.variableName),color:"#30a"},{tag:[sU.typeName,sU.namespace],color:"#085"},{tag:sU.className,color:"#167"},{tag:[sU.special(sU.variableName),sU.macroName],color:"#256"},{tag:sU.definition(sU.propertyName),color:"#00c"},{tag:sU.comment,color:"#940"},{tag:sU.invalid,color:"#f00"}]),aj=iF.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),aU="()[]{}",aq=e_.define({combine:e=>e4(e,{afterCursor:!0,brackets:aU,maxScanDistance:1e4,renderMatch:aV})}),aW=tH.mark({class:"cm-matchingBracket"}),az=tH.mark({class:"cm-nonmatchingBracket"});function aV(e){let t=[],n=e.matched?aW:az;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let aH=[eA.define({create:()=>tH.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(aq);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=aG(t.state,e.head,-1,r)||e.head>0&&aG(t.state,e.head-1,1,r)||r.afterCursor&&(aG(t.state,e.head,1,r)||e.head<t.state.doc.length&&aG(t.state,e.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,t.state)))}return tH.set(n,!0)},provide:e=>iF.decorations.from(e)}),aj];function aQ(e={}){return[aq.of(e),aH]}let a$=new p;function aK(e,t,n){let r=e.prop(t<0?p.openedBy:p.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function aX(e){let t=e.type.prop(a$);return t?t(e.node):e}function aG(e,t,n,r={}){let i=r.maxScanDistance||1e4,o=r.brackets||aU,s=sQ(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let r=aK(e.type,n,o);if(r&&e.from<e.to){let i=aX(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},u=0,c=null==a?void 0:a.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(0==u&&o.indexOf(c.type.name)>-1&&c.from<c.to){let e=aX(c);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(aK(c.type,n,s))u++;else if(aK(c.type,-n,s)){if(0==u){let e=aX(c);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling())return{start:l,matched:!1}}(0,0,n,e,i,r,o)}}return function(e,t,n,r,i,o,s){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let u={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),h=0;for(let e=0;!c.next().done&&e<=o;){let o=c.value;n<0&&(e+=o.length);let a=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=s.indexOf(o[e]);if(!(t<0)&&r.resolveInner(a+e,1).type==i)if(t%2==0==n>0)h++;else{if(1==h)return{start:u,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};h--}}n>0&&(e+=o.length)}return c.done?{start:u,matched:!1}:null}(e,t,n,s,a.type,i,o)}let aZ=Object.create(null),aY=[v.none],aJ=[],a0=Object.create(null),a1=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])a1[e]=function(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||sU[n];r?"function"==typeof r?t.length?t=t.map(r):a2(n,`Modifier ${n} used at start of tag`):t.length?a2(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:a2(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(e=>e.id),o=a0[i];if(o)return o.id;let s=a0[i]=v.define({id:aY.length,name:r,props:[sb({[r]:n})]});return aY.push(s),s.id}(aZ,t);function a2(e,t){aJ.indexOf(e)>-1||(aJ.push(e),console.warn(t))}nl.RTL,nl.LTR,e.s(["HighlightStyle",()=>aR,"IndentContext",()=>s9,"LRLanguage",()=>sH,"LanguageSupport",()=>s2,"bracketMatching",()=>aQ,"continuedIndent",()=>ao,"defaultHighlightStyle",()=>aF,"delimitedIndent",()=>ar,"foldGutter",()=>aP,"foldInside",()=>au,"foldKeymap",()=>aw,"foldNodeProp",()=>al,"getIndentUnit",()=>s8,"getIndentation",()=>s5,"highlightingFor",()=>aN,"indentNodeProp",()=>s7,"indentOnInput",()=>as,"indentString",()=>s6,"indentUnit",()=>s4,"language",()=>s1,"matchBrackets",()=>aG,"syntaxHighlighting",()=>aL,"syntaxTree",()=>sQ],923612);var a3=e.i(139507);class a4{constructor(e,t,n,r,i,o,s,a,l,u=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=u,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new a4(e,[],t,n,n,0,[],0,r?new a8(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=65535&e,{parser:i}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=i.dynamicPrecedence(r);if(s&&(this.score+=s),0==n){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(n-1)*3-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,u=this.reducePos-l;u>=2e3&&!(null==(t=this.p.parser.nodeSet.types[r])?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=u));let c=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-c;if(r<i.minRepeatTerm||131072&e){let e=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,l,e,h+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=i.getGoto(e,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,l)}storeNode(e,t,n,r=4,i=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,r=this.buffer.length;if(0==r&&e.parent&&(r=e.bufferBase-e.parent.bufferBase,e=e.parent),r>0&&0==e.buffer[r-4]&&e.buffer[r-1]>-1){if(t==n)return;if(e.buffer[r-2]>=t){e.buffer[r-2]=n;return}}}if(i&&this.pos!=n){let i=this.buffer.length;if(i>0&&(0!=this.buffer[i-4]||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}else this.buffer.push(e,t,n,r)}shift(e,t,n,r){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:i}=this.p;this.pos=r,!i.stateFlag(e,1)&&(r>n||t<=i.maxNode)&&(this.reducePos=r),this.pushState(e,Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,r,4)}else this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4)}apply(e,t,n,r){65536&e?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new a4(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new a6(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>1&t&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=65535&t,i=this.stack.length-3*n;if(i<0||0>e.getGoto(this.stack[i],r,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-i;if(n>1){let r=65535&t,i=this.stack.length-3*n;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(null!=e)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new a8(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return!(e<=this.lookAhead)&&(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class a8{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class a6{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}}class a5{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new a5(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new a5(this.stack,this.pos,this.index)}}function a9(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),o+=i,n)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class a7{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}let le=new a7;class lt{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=le,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=le,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class ln{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;li(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}ln.prototype.contextual=ln.prototype.fallback=ln.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?a9(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(li(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&r++,null==i)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}).prototype.contextual=ln.prototype.fallback=ln.prototype.extend=!1;class lr{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function li(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;t:for(;(a&e[s])!=0;){let n=e[s+1];for(let r=s+3;r<n;r+=2)if((e[r+1]&a)>0){let n=e[r];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,r){let i=lo(n,r,t);return i<0||lo(n,r,e)<i}(n,t.token.value,i,o))){t.acceptToken(n);break}}let r=t.next,u=0,c=e[s+2];if(t.next<0&&c>u&&65535==e[n+3*c-3]){s=e[n+3*c-1];continue}for(;u<c;){let i=u+c>>1,o=n+i+(i<<1),a=e[o],l=e[o+1]||65536;if(r<a)c=i;else if(r>=l)u=i+1;else{s=e[o+2],t.advance();continue t}}break}}function lo(e,t,n){for(let r=t,i;65535!=(i=e[r]);r++)if(i==n)return r-t;return -1}let ls=void 0!==a3.default&&a3.default.env&&/\bparse\b/.test(a3.default.env.LOG),la=null;function ll(e,t,n){let r=e.cursor(u.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class lu{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ll(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ll(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(i instanceof x){if(o==e){if(o<this.safeFrom)return null;let e=o+i.length;if(e<=this.safeTo){let t=i.prop(p.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,o+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+i.length}}}class lc{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new a7)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,o=r.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let r=0;r<i.length;r++){if((1<<r&o)==0)continue;let l=i[r],u=this.tokens[r];if((!n||l.fallback)&&((l.contextual||u.start!=e.pos||u.mask!=o||u.context!=s)&&(this.updateCachedToken(u,l,e),u.mask=o,u.context=s),u.lookAhead>u.end+25&&(a=Math.max(u.lookAhead,a)),0!=u.value)){let r=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!l.extend&&(n=u,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||((n=new a7).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new a7,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){(1&i)==0?e.value=i>>1:e.extended=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let a=o.stateSlot(i,e?2:1);;a+=3){if(65535==s[a])if(1==s[a+1])a=lm(s,a+2);else{0==r&&2==s[a+1]&&(r=this.putAction(lm(s,a+2),t,n,r));break}s[a]==t&&(r=this.putAction(lm(s,a+1),t,n,r))}return r}}class lh{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new lt(t,r),this.tokens=new lc(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[a4.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>4*e.bufferLength?new lu(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,r=this.minStackPos,i=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<n.length;o++){let s=n[o];for(;;){if(this.tokens.mainToken=null,s.pos>r)i.push(s);else{if(this.advanceStack(s,i,n))continue;e||(e=[],t=[]),e.push(s);let r=this.tokens.getMainToken(s);t.push(r.value,r.end)}break}}if(!i.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return ls&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw ls&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+r);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,i);if(n)return ls&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(i.length>e)for(i.sort((e,t)=>t.score-e.score);i.length>e;)i.pop();i.some(e=>e.reducePos>r)&&this.recovering--}else if(i.length>1){e:for(let e=0;e<i.length-1;e++){let t=i[e];for(let n=e+1;n<i.length;n++){let r=i[n];if(t.sameState(r)||t.buffer.length>500&&r.buffer.length>500)if((t.score-r.score||t.buffer.length-r.buffer.length)>0)i.splice(n--,1);else{i.splice(e--,1);continue e}}}i.length>12&&(i.sort((e,t)=>t.score-e.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let e=1;e<i.length;e++)i[e].pos<this.minStackPos&&(this.minStackPos=i[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,o=ls?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let s=this.fragments.nodeAt(r);s;){let r=this.parser.nodeSet.types[s.type.id]==s.type?i.getGoto(e.state,s.type.id):-1;if(r>-1&&s.length&&(!t||(s.prop(p.contextHash)||0)==n))return e.useNode(s,r),ls&&console.log(o+this.stackID(e)+` (via reuse of ${i.getName(s.type.id)})`),!0;if(!(s instanceof x)||0==s.children.length||s.positions[0]>0)break;let a=s.children[0];if(a instanceof x&&0==s.positions[0])s=a;else break}}let s=i.stateSlot(e.state,4);if(s>0)return e.reduce(s),ls&&console.log(o+this.stackID(e)+` (via always-reduce ${i.getName(65535&s)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let s=0;s<a.length;){let l=a[s++],u=a[s++],c=a[s++],h=s==a.length||!n,d=h?e:e.split(),f=this.tokens.mainToken;if(d.apply(l,u,f?f.start:d.pos,c),ls&&console.log(o+this.stackID(d)+` (via ${(65536&l)==0?"shift":`reduce of ${i.getName(65535&l)}`} for ${i.getName(u)} @ ${r}${d==e?"":", split"})`),h)return!0;d.pos>r?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return ld(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=t[o<<1],l=t[(o<<1)+1],u=ls?this.stackID(s)+" -> ":"";if(s.deadEnd&&(i||(i=!0,s.restart(),ls&&console.log(u+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let c=s.split(),h=u;for(let e=0;e<10&&c.forceReduce()&&(ls&&console.log(h+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));e++)ls&&(h=this.stackID(c)+" -> ");for(let e of s.recoverByInsert(a))ls&&console.log(u+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),ls&&console.log(u+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),ld(s,n)):(!r||r.score<c.score)&&(r=c)}return r}stackToTree(e){return e.close(),x.build({buffer:a5.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(la||(la=new WeakMap)).get(e);return t||la.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function ld(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class lf{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}}let lp=e=>e;class lg extends U{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=p[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let o=t[n+-r];for(let s=-r;s>0;s--)i(t[n++],e,o);n++}}}this.nodeSet=new y(t.map((t,i)=>v.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=a9(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(lv),this.states=a9(e.states,Uint32Array),this.data=a9(e.stateData),this.goto=a9(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new ln(o,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new lh(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return -1;for(let i=r[t+1];;){let t=r[i++],o=1&t,s=r[i++];if(o&&n)return s;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return s;if(o)return -1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),o;;i+=3){if(65535==(o=n[i]))if(1==n[i+1])o=n[i=lm(n,i+2)];else if(2==n[i+1])return lm(n,i+2);else break;if(o==t||0==o)return lm(n,i+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==r;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=lm(this.data,n+2);else break;r=t(lm(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n])if(1==this.data[n+1])n=lm(this.data,n+2);else break;if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(lg.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let i=e.specializers.find(e=>e.from==n.external);if(!i)return n;let o=Object.assign(Object.assign({},n),{external:i.to});return t.specializers[r]=lv(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;65535!=(i=this.data[n++]);)(r||(r=new Uint8Array(this.maxTerm+1)))[i]=1;return new lf(e,n,r)}static deserialize(e){return new lg(e)}}function lm(e,t){return e[t]|e[t+1]<<16}function lv(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}class ly{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=sQ(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(lk(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,n){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function lb(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function lw(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=lb(t)+lb(n)+"*$";return[RegExp("^"+r),new RegExp(r)]}(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}class lx{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function lS(e){return e.selection.main.from}function lk(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],o="$"!=r[r.length-1];return i||o?RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,null!=(n=e.flags)?n:e.ignoreCase?"i":""):e}let l_=eQ.define(),lO=new WeakMap;function lC(e){if(!Array.isArray(e))return e;let t=lO.get(e);return t||lO.set(e,t=lw(e)),t}let lE=eX.define(),lT=eX.define();class lP{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=ea(e,t),r=eu(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(ea(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(1==t.length){let r=ea(e,0),i=eu(r),o=i==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,i])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let i=0,o=Math.min(e.length,200);i<o&&l<a;){let o=ea(e,i);(o==t[l]||o==n[l])&&(r[l++]=i),i+=eu(o)}if(l<a)return null}let u=0,c=0,h=!1,d=0,f=-1,p=-1,g=/[a-z]/.test(e),m=!0;for(let r=0,l=Math.min(e.length,200),v=0;r<l&&c<a;){let l=ea(e,r);s<0&&(u<a&&l==t[u]&&(i[u++]=r),d<a&&(l==t[d]||l==n[d]?(0==d&&(f=r),p=r+1,d++):d=0));let y,b=l<255?l>=48&&l<=57||l>=97&&l<=122?2:+(l>=65&&l<=90):(y=el(l))!=y.toLowerCase()?1:2*(y!=y.toUpperCase());(!r||1==b&&g||0==v&&0!=b)&&(t[c]==l||n[c]==l&&(h=!0)?o[c++]=r:o.length&&(m=!1)),v=b,r+=eu(l)}return c==a&&0==o[0]&&m?this.result(-100+(h?-200:0),o,e):d==a&&0==f?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):d==a?this.ret(-900-e.length,[f,p]):c==a?this.result(-100+(h?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?eu(ea(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}}class lA{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}let lR=e_.define({combine:e=>e4(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:lI,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>lM(e(n),t(n)),optionClass:(e,t)=>n=>lM(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function lM(e,t){return e?t?e+" "+t:e:t}function lI(e,t,n,r,i,o){let s=e.textDirection==nl.RTL,a=s,l=!1,u="top",c,h,d=t.left-i.left,f=i.right-t.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d<Math.min(p,f)?a=!1:!a&&f<Math.min(p,d)&&(a=!0),p<=(a?d:f))c=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,h=Math.min(400,a?d:f);else{l=!0,h=Math.min(400,(s?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=g||e>t.top?c=n.bottom-t.top:(u="bottom",c=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${c/m}px; max-width: ${h/v}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function lD(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class lL{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:i,selected:o}=r.open,s=e.state.facet(lR);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement("span");i.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>s&&i.appendChild(document.createTextNode(o.slice(s,t)));let a=i.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<o.length&&i.appendChild(document.createTextNode(o.slice(s))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=lD(i.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(lR).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:lT.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:o,disabled:s}=n.open;r.open&&r.open.options==i||(this.range=lD(i.length,o,e.state.facet(lR).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),s!=(null==(t=r.open)?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=lD(t.options.length,t.selected,this.view.state.facet(lR).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o="string"==typeof i?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>nB(this.view.state,e,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let r,i,o,s=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),s=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby")):n--;return s&&(t=this.list,n=s,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=r.height/t.offsetHeight,i.top<r.top?t.scrollTop-=(r.top-i.top)/o:i.bottom>r.bottom&&(t.scrollTop+=(i.bottom-r.bottom)/o)),s}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(lR).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",e=>{e.target==r&&e.preventDefault()});let i=null;for(let o=n.from;o<n.to;o++){let{completion:s,match:a}=e[o],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;e!=i&&(o>n.from||0==n.from)&&(i=e,"string"!=typeof l&&l.header?r.appendChild(l.header(l)):r.appendChild(document.createElement("completion-section")).textContent=e)}let u=r.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let c=this.optionClass(s);for(let e of(c&&(u.className=c),this.optionContent)){let t=e(s,this.view.state,this.view,a);t&&u.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function lN(e){return 100*(e.boost||0)+10*!!e.apply+5*!!e.info+ +!!e.type}class lB{constructor(e,t,n,r,i,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new lB(this.options,lq(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i,o){if(r&&!o&&e.some(e=>e.isPending))return r.setDisabled();let s=function(e,t){let n=[],r=null,i=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},s=t.facet(lR);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)o(new lx(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),a,l=s.filterStrict?new lA(n):new lP(n);for(let t of r.result.options)if(a=l.match(t.label)){let n=t.displayLabel?e?e(t,a.matched):[]:a.matched,s=a.score+(t.boost||0);if(o(new lx(t,r.source,n,s)),"object"==typeof t.section&&"dynamic"===t.section.rank){let{name:e}=t.section;i||(i=Object.create(null)),i[e]=Math.max(s,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0;for(let n of r.sort((e,t)=>("dynamic"===e.rank&&"dynamic"===t.rank?i[t.name]-i[e.name]:0)||("number"==typeof e.rank?e.rank:1e9)-("number"==typeof t.rank?t.rank:1e9)||(e.name<t.name?-1:1)))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let a=[],l=null,u=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||u(e.completion,t.completion))){let t=e.completion;l&&l.label==t.label&&l.detail==t.detail&&(null==l.type||null==t.type||l.type==t.type)&&l.apply==t.apply&&l.boost==t.boost?lN(e.completion)>lN(l)&&(a[a.length-1]=e):a.push(e),l=e.completion}return a}(e,t);if(!s.length)return r&&e.some(e=>e.isPending)?r.setDisabled():null;let a=t.facet(lR).selectOnOpen?0:-1;if(r&&r.selected!=a&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){a=t;break}}return new lB(s,lq(n,a),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:lG,above:i.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new lB(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new lB(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class lF{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new lF(lW,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(lR),r=(n.override||t.languageDataAt("autocomplete",lS(t)).map(lC)).map(t=>(this.active.find(e=>e.source==t)||new lV(t,+!!this.active.some(e=>0!=e.state))).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open,o=e.effects.some(e=>e.is(lQ));for(let s of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)||o?i=lB.build(r,t,this.id,i,n,o):i&&i.disabled&&!r.some(e=>e.isPending)&&(i=null),!i&&r.every(e=>!e.isPending)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new lV(e.source,0):e)),e.effects))s.is(l$)&&(i=i&&i.setSelected(s.value,this.id));return r==this.active&&i==this.open?this:new lF(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?lj:lU}}let lj={"aria-autocomplete":"list"},lU={};function lq(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let lW=[];function lz(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(l_);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:16*!!e.docChanged}class lV{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return 1==this.state}update(e,t){let n=lz(e,t),r=this;for(let t of((8&n||16&n&&this.touches(e))&&(r=new lV(r.source,0)),4&n&&0==r.state&&(r=new lV(this.source,1)),r=r.updateFor(e,n),e.effects))if(t.is(lE))r=new lV(r.source,1,t.value);else if(t.is(lT))r=new lV(r.source,0);else if(t.is(lQ))for(let e of t.value)e.source==r.source&&(r=e);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(lS(e.state))}}class lH extends lV{constructor(e,t,n,r,i,o){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(3&t))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let i=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),s=lS(e.state);if(s>o||!r||2&t&&(lS(e.startState)==this.from||s<this.limit))return new lV(this.source,4&t?1:0);let a=e.changes.mapPos(this.limit);return!function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):lk(e,!0).test(i)}(r.validFor,e.state,i,o)?r.update&&(r=r.update(r,i,o,new ly(e.state,s,!1)))?new lH(this.source,this.explicit,a,r,r.from,null!=(n=r.to)?n:lS(e.state)):new lV(this.source,1,this.explicit):new lH(this.source,this.explicit,a,r,i,o)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new lH(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new lV(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}let lQ=eX.define({map:(e,t)=>e.map(e=>e.map(t))}),l$=eX.define(),lK=eA.define({create:()=>lF.start(),update:(e,t)=>e.update(t),provide:e=>[oN.from(e,e=>e.tooltip),iF.contentAttributes.from(e,e=>e.attrs)]});function lX(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(lK).active.find(e=>e.source==t.source);return r instanceof lH&&("string"==typeof n?e.dispatch({...function(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r))return{range:a};let l=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:l},range:ex.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}(e.state,n,r.from,r.to),annotations:l_.of(t.completion)}):n(e,t.completion,r.from,r.to),!0)}let lG=e=>new lL(e,lK,lX);function lZ(e,t="option"){return n=>{let r=n.state.field(lK,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(lR).interactionDelay)return!1;let i=1,o;"page"==t&&(o=oW(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:l$.of(a)}),!0}}let lY=e=>!!e.state.field(lK,!1)&&(e.dispatch({effects:lE.of(!0)}),!0);class lJ{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let l0=nq.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(lK).active))t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(lK),n=e.state.facet(lR);if(!e.selectionSet&&!e.docChanged&&e.startState.field(lK)==t)return;let r=e.transactions.some(e=>{let t=lz(e,n);return 8&t||(e.selection||e.docChanged)&&!(3&t)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){nB(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(lE)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(lK);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(lR).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=lS(t),r=new ly(t,n,e.explicit,this.view),i=new lJ(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(e=>{i.context.aborted||(i.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:lT.of(null)}),nB(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(lR).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(lR),r=this.view.state.field(lK);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(void 0===o.done)continue;if(this.running.splice(i--,1),o.done){let r=lS(o.updates.length?o.updates[0].startState:this.view.state),i=Math.min(r,o.done.from+ +!o.active.explicit),s=new lH(o.active.source,o.active.explicit,i,o.done,o.done.from,null!=(e=o.done.to)?e:r);for(let e of o.updates)s=s.update(e,n);if(s.hasResult()){t.push(s);continue}}let s=r.active.find(e=>e.source==o.active.source);if(s&&s.isPending)if(null==o.done){let e=new lV(o.active.source,0);for(let t of o.updates)e=e.update(t,n);e.isPending||t.push(e)}else this.startQuery(s)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:lQ.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(lK,!1);if(t&&t.tooltip&&this.view.state.facet(lR).closeOnBlur){let n=t.open&&oW(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:lT.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:lE.of(!1)}),20),this.composing=0}}}),l1="object"==typeof navigator&&/Win/.test(navigator.platform),l2=eM.highest(iF.domEventHandlers({keydown(e,t){let n=t.state.field(lK,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(l1&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&lX(t,r),!1}})),l3=iF.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),l4=tH.widget({widget:new class extends tz{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),l8=tH.mark({class:"cm-snippetField"});class l6{constructor(e,t){this.ranges=e,this.active=t,this.deco=tH.set(e.map(e=>(e.from==e.to?l4:l8).range(e.from,e.to)),!0)}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new l6(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}let l5=eX.define({map:(e,t)=>e&&e.map(t)}),l9=eX.define(),l7=eA.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(l5))return n.value;if(n.is(l9)&&e)return new l6(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>iF.decorations.from(e,e=>e?e.deco:tH.none)});function ue(e){return({state:t,dispatch:n})=>{var r;let i=t.field(l7,!1);if(!i||e<0&&0==i.active)return!1;let o=i.active+e,s=e>0&&!i.ranges.some(t=>t.field==o+e);return n(t.update({selection:(r=i.ranges,ex.create(r.filter(e=>e.field==o).map(e=>ex.range(e.from,e.to)))),effects:l5.of(s?null:new l6(i.ranges,o)),scrollIntoView:!0})),!0}}let ut=[{key:"Tab",run:ue(1),shift:ue(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(l7,!1)&&(t(e.update({effects:l5.of(null)})),!0)}],un={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ur=eX.define({map(e,t){let n=t.mapPos(e,-1,eh.TrackAfter);return null==n?void 0:n}}),ui=new class extends e8{};ui.startSide=1,ui.endSide=-1;let uo=eA.define({create:()=>te.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(ur)&&(e=e.update({add:[ui.range(n.value,n.value+1)]}));return e}}),us="()[]{}<>«»»«[]{}";function ua(e){for(let t=0;t<us.length;t+=2)if(us.charCodeAt(t)==e)return us.charAt(t+1);return el(e<128?e:e+1)}function ul(e,t){return e.languageDataAt("closeBrackets",t)[0]||un}let uu="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),uc=iF.inputHandler.of((e,t,n,r)=>{if((uu?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||2==r.length&&1==eu(ea(r,0))||t!=i.from||n!=i.to)return!1;let o=function(e,t){let n=ul(e,e.selection.main.head),r=n.brackets||un.brackets;for(let i of r){let o=ua(ea(i,0));if(t==i)return o==i?function(e,t,n,r){let i=r.stringPrefixes||un.stringPrefixes,o=null,s=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:ur.of(r.to+t.length),range:ex.range(r.anchor+t.length,r.head+t.length)};let s=r.head,a=uf(e.doc,s),l;if(a==t){if(up(e,s))return{changes:{insert:t+t,from:s},effects:ur.of(s+t.length),range:ex.cursor(s+t.length)};else if(ud(e,s)){let r=n&&e.sliceDoc(s,s+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:s,to:s+r.length,insert:r},range:ex.cursor(s+r.length)}}}else if(n&&e.sliceDoc(s-2*t.length,s)==t+t&&(l=ug(e,s-2*t.length,i))>-1&&up(e,l))return{changes:{insert:t+t+t+t,from:s},effects:ur.of(s+t.length),range:ex.cursor(s+t.length)};else if(e.charCategorizer(s)(a)!=e1.Word&&ug(e,s,i)>-1&&!function(e,t,n,r){let i=sQ(e).resolveInner(t,-1),o=r.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&r.indexOf(s.slice(0,a))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=i.to==t&&i.parent;if(!l)break;i=l}return!1}(e,s,t,i))return{changes:{insert:t+t,from:s},effects:ur.of(s+t.length),range:ex.cursor(s+t.length)};return{range:o=r}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,r.indexOf(i+i+i)>-1,n):function(e,t,n,r){let i=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:ur.of(o.to+t.length),range:ex.range(o.anchor+t.length,o.head+t.length)};let s=uf(e.doc,o.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:o.head},effects:ur.of(o.head+t.length),range:ex.cursor(o.head+t.length)}:{range:i=o}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,i,o,n.before||un.before);if(t==o&&ud(e,e.selection.main.from))return function(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&uf(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:ex.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,o)}return null}(e.state,r);return!!o&&(e.dispatch(o),!0)}),uh=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=ul(e,e.selection.main.head).brackets||un.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){var i,o;let r,s=(i=e.doc,o=t.head,eu(ea(r=i.sliceString(o-2,o),0))==r.length?r:r.slice(1));for(let r of n)if(r==s&&uf(e.doc,t.head)==ua(ea(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:ex.cursor(t.head-r.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function ud(e,t){let n=!1;return e.field(uo).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function uf(e,t){let n=e.sliceString(t,t+2);return n.slice(0,eu(ea(n,0)))}function up(e,t){let n=sQ(e).resolveInner(t+1);return n.parent&&n.from==t}function ug(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=e1.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=e1.Word)return n}return -1}let um=[{key:"Ctrl-Space",run:lY},{mac:"Alt-`",run:lY},{mac:"Alt-i",run:lY},{key:"Escape",run:e=>{let t=e.state.field(lK,!1);return!!t&&!!t.active.some(e=>0!=e.state)&&(e.dispatch({effects:lT.of(null)}),!0)}},{key:"ArrowDown",run:lZ(!0)},{key:"ArrowUp",run:lZ(!1)},{key:"PageDown",run:lZ(!0,"page")},{key:"PageUp",run:lZ(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(lK,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(lR).interactionDelay)&&lX(e,t.open.options[t.open.selected])}}],uv=eM.highest(iQ.computeN([lR],e=>e.facet(lR).defaultKeymap?[um]:[]));function uy(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function ub(e,t,n){for(let r=!1;;){if(e.next<0)return;if(e.next==t&&!r)return void e.advance();r=n&&!r&&92==e.next,e.advance()}}function uw(e,t){for(;95==e.next||uy(e.next);)null!=t&&(t+=String.fromCharCode(e.next)),e.advance();return t}function ux(e,t){for(;48==e.next||49==e.next;)e.advance();t&&e.next==t&&e.advance()}function uS(e,t){for(;;){if(46==e.next){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(69==e.next||101==e.next)for(e.advance(),(43==e.next||45==e.next)&&e.advance();e.next>=48&&e.next<=57;)e.advance()}function uk(e){for(;!(e.next<0||10==e.next);)e.advance()}function u_(e,t){for(let n=0;n<t.length;n++)if(t.charCodeAt(n)==e)return!0;return!1}let uO=" \r\n";function uC(e,t,n){let r=Object.create(null);for(let t of(r.true=r.false=5,r.null=r.unknown=6,e.split(" ")))t&&(r[t]=20);for(let e of t.split(" "))e&&(r[e]=21);for(let e of(n||"").split(" "))e&&(r[e]=24);return r}let uE="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",uT="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",uP={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:uC(uT,uE)};function uA(e){return new lr(t=>{let{next:n}=t;if(t.advance(),u_(n,uO)){for(;u_(t.next,uO);)t.advance();t.acceptToken(36)}else if(36==n&&e.doubleDollarQuotedStrings){let e=uw(t,"");36==t.next&&(t.advance(),function(e,t){t:for(;;){if(e.next<0)return;if(36==e.next){e.advance();for(let n=0;n<t.length;n++){if(e.next!=t.charCodeAt(n))continue t;e.advance()}if(36==e.next)return void e.advance()}else e.advance()}}(t,e),t.acceptToken(3))}else if(39==n||34==n&&e.doubleQuotedStrings)ub(t,n,e.backslashEscapes),t.acceptToken(3);else if(35==n&&e.hashComments||47==n&&47==t.next&&e.slashComments)uk(t),t.acceptToken(1);else if(45!=n||45!=t.next||e.spaceAfterDashes&&32!=t.peek(1)){if(47==n&&42==t.next){t.advance();for(let e=1;;){let n=t.next;if(t.next<0)break;if(t.advance(),42==n&&47==t.next){if(e--,t.advance(),!e)break}else 47==n&&42==t.next&&(e++,t.advance())}t.acceptToken(2)}else if((101==n||69==n)&&39==t.next)t.advance(),ub(t,39,!0),t.acceptToken(3);else if((110==n||78==n)&&39==t.next&&e.charSetCasts)t.advance(),ub(t,39,e.backslashEscapes),t.acceptToken(3);else if(95==n&&e.charSetCasts)for(let n=0;;n++){if(39==t.next&&n>1){t.advance(),ub(t,39,e.backslashEscapes),t.acceptToken(3);break}if(!uy(t.next))break;t.advance()}else if(e.plsqlQuotingMechanism&&(113==n||81==n)&&39==t.next&&t.peek(1)>0&&!u_(t.peek(1),uO)){let e=t.peek(1);t.advance(2),function(e,t){let n="[{<(".indexOf(String.fromCharCode(t)),r=n<0?t:"]}>)".charCodeAt(n);for(;;){if(e.next<0)return;if(e.next==r&&39==e.peek(1))return void e.advance(2);e.advance()}}(t,e),t.acceptToken(3)}else if(u_(n,e.identifierQuotes))ub(t,91==n?93:n,!1),t.acceptToken(19);else if(40==n)t.acceptToken(7);else if(41==n)t.acceptToken(8);else if(123==n)t.acceptToken(9);else if(125==n)t.acceptToken(10);else if(91==n)t.acceptToken(11);else if(93==n)t.acceptToken(12);else if(59==n)t.acceptToken(13);else if(e.unquotedBitLiterals&&48==n&&98==t.next)t.advance(),ux(t),t.acceptToken(22);else if((98==n||66==n)&&(39==t.next||34==t.next)){let n=t.next;t.advance(),e.treatBitsAsBytes?(ub(t,n,e.backslashEscapes),t.acceptToken(23)):(ux(t,n),t.acceptToken(22))}else if(48==n&&(120==t.next||88==t.next)||(120==n||88==n)&&39==t.next){let e=39==t.next;for(t.advance();(i=t.next)>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70;)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(46==n&&t.next>=48&&t.next<=57)uS(t,!0),t.acceptToken(4);else if(46==n)t.acceptToken(14);else if(n>=48&&n<=57)uS(t,!1),t.acceptToken(4);else if(u_(n,e.operatorChars)){for(;u_(t.next,e.operatorChars);)t.advance();t.acceptToken(15)}else if(u_(n,e.specialVar)){var r,i;if(t.next==n&&t.advance(),39==t.next||34==t.next||96==t.next){let e=t.next;t.advance(),ub(t,e,!1)}else uw(t);t.acceptToken(17)}else if(58==n||44==n)t.acceptToken(16);else if(uy(n)){let i=uw(t,String.fromCharCode(n));t.acceptToken(46==t.next||46==t.peek(-i.length-1)?18:null!=(r=e.words[i.toLowerCase()])?r:18)}}else uk(t),t.acceptToken(1)})}let uR=uA(uP),uM=lg.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,nodeProps:[["isolate",-4,1,2,3,19,""]],skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,uR],topRules:{Script:[0,25]},tokenPrec:0});function uI(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function uD(e,t){let n=e.sliceString(t.from,t.to),r=/^([`'"\[])(.*)([`'"\]])$/.exec(n);return r?r[2]:n}function uL(e){return e&&("Identifier"==e.name||"QuotedIdentifier"==e.name)}function uN(e,t){for(let n=[];;){if(!t||"."!=t.name)return n;let r=uI(t);if(!uL(r))return n;n.unshift(uD(e,r)),t=uI(r)}}let uB=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" ")),uF=/^\w*$/,uj=/^[`'"\[]?\w*[`'"\]]?$/;function uU(e){return e.self&&"string"==typeof e.self.label}class uq{constructor(e,t){this.idQuote=e,this.idCaseInsensitive=t,this.list=[],this.children=void 0}child(e){let t=this.children||(this.children=Object.create(null)),n=t[e];return n||(e&&!this.list.some(t=>t.label==e)&&this.list.push(uW(e,"type",this.idQuote,this.idCaseInsensitive)),t[e]=new uq(this.idQuote,this.idCaseInsensitive))}maybeChild(e){return this.children?this.children[e]:null}addCompletion(e){let t=this.list.findIndex(t=>t.label==e.label);t>-1?this.list[t]=e:this.list.push(e)}addCompletions(e){for(let t of e)this.addCompletion("string"==typeof t?uW(t,"property",this.idQuote,this.idCaseInsensitive):t)}addNamespace(e){Array.isArray(e)?this.addCompletions(e):uU(e)?this.addNamespace(e.children):this.addNamespaceObject(e)}addNamespaceObject(e){for(let t of Object.keys(e)){let n=e[t],r=null,i=t.replace(/\\?\./g,e=>"."==e?"\0":e).split("\0"),o=this;uU(n)&&(r=n.self,n=n.children);for(let e=0;e<i.length;e++)r&&e==i.length-1&&o.addCompletion(r),o=o.child(i[e].replace(/\\\./g,"."));o.addNamespace(n)}}}function uW(e,t,n,r){return RegExp("^[a-z_][a-z_\\d]*$",r?"i":"").test(e)?{label:e,type:t}:{label:e,type:t,apply:n+e+uz(n)}}function uz(e){return"["===e?"]":e}let uV=uM.configure({props:[s7.add({Statement:ao()}),al.add({Statement:(e,t)=>({from:Math.min(e.from+100,t.doc.lineAt(e.from).to),to:e.to}),BlockComment:e=>({from:e.from+2,to:e.to-2})}),sb({Keyword:sU.keyword,Type:sU.typeName,Builtin:sU.standard(sU.name),Bits:sU.number,Bytes:sU.string,Bool:sU.bool,Null:sU.null,Number:sU.number,String:sU.string,Identifier:sU.name,QuotedIdentifier:sU.special(sU.string),SpecialVar:sU.special(sU.name),LineComment:sU.lineComment,BlockComment:sU.blockComment,Operator:sU.operator,"Semi Punctuation":sU.punctuation,"( )":sU.paren,"{ }":sU.brace,"[ ]":sU.squareBracket})]});class uH{constructor(e,t,n){this.dialect=e,this.language=t,this.spec=n}get extension(){return this.language.extension}configureLanguage(e,t){return new uH(this.dialect,this.language.configure(e,t),this.spec)}static define(e){let t=function(e,t,n,r){let i={};for(let t in uP)i[t]=(e.hasOwnProperty(t)?e:uP)[t];return t&&(i.words=uC(t,n||"",r)),i}(e,e.keywords,e.types,e.builtin),n=sH.define({name:"sql",parser:uV.configure({tokenizers:[{from:uR,to:uA(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new uH(t,n,e)}}function uQ(e,t){return{label:e,type:t,boost:-1}}function u$(e={}){var t,n,r,i,o,s,a;let l,u,c=e.dialect||uK;return new s2(c.language,[e.schema?(e.dialect||uK).language.data.of({autocomplete:e.schema?(t=e.schema,n=e.tables,r=e.schemas,i=e.defaultTable,o=e.defaultSchema,l=new uq((null==(a=null==(s=e.dialect||uK)?void 0:s.spec.identifierQuotes)?void 0:a[0])||'"',!!(null==s?void 0:s.spec.caseInsensitiveIdentifiers)),u=o?l.child(o):null,l.addNamespace(t),n&&(u||l).addCompletions(n),r&&l.addCompletions(r),u&&l.addCompletions(u.list),i&&l.addCompletions((u||l).child(i).list),e=>{var t,n;let r,o,{parents:s,from:a,quoted:c,empty:h,aliases:d}=(t=e.state,n=e.pos,r=sQ(t).resolveInner(n,-1),o=function(e,t){let n;for(let e=t;!n;e=e.parent){if(!e)return null;"Statement"==e.name&&(n=e)}let r=null;for(let t=n.firstChild,i=!1,o=null;t;t=t.nextSibling){let n="Keyword"==t.name?e.sliceString(t.from,t.to).toLowerCase():null,s=null;if(i)if("as"==n&&o&&uL(t.nextSibling))s=uD(e,t.nextSibling);else if(n&&uB.has(n))break;else o&&uL(t)&&(s=uD(e,t));else i="from"==n;s&&(r||(r=Object.create(null)),r[s]=function(e,t){if("CompositeIdentifier"==t.name){let n=[];for(let r=t.firstChild;r;r=r.nextSibling)uL(r)&&n.push(uD(e,r));return n}return[uD(e,t)]}(e,o)),o=/Identifier$/.test(t.name)?t:null}return r}(t.doc,r),"Identifier"==r.name||"QuotedIdentifier"==r.name||"Keyword"==r.name?{from:r.from,quoted:"QuotedIdentifier"==r.name?t.doc.sliceString(r.from,r.from+1):null,parents:uN(t.doc,uI(r)),aliases:o}:"."==r.name?{from:n,quoted:null,parents:uN(t.doc,r),aliases:o}:{from:n,quoted:null,parents:[],empty:!0,aliases:o});if(h&&!e.explicit)return null;d&&1==s.length&&(s=d[s[0]]||s);let f=l;for(let e of s){for(;!f.children||!f.children[e];)if(f==l&&u)f=u;else{if(f!=u||!i)return null;f=f.child(i)}let t=f.maybeChild(e);if(!t)return null;f=t}let p=f.list;if(f==l&&d&&(p=p.concat(Object.keys(d).map(e=>({label:e,type:"constant"})))),!c)return{from:a,options:p,validFor:uF};{let t=c[0],n=uz(t);return{from:a,to:e.state.sliceDoc(e.pos,e.pos+1)==n?e.pos+1:void 0,options:p.map(e=>({...e,label:e.label[0]==t?e.label:t+e.label+n,apply:void 0})),validFor:uj}}}):()=>null}):[],c.language.data.of({autocomplete:function(e,t=!1,n){var r,i,o,s;return r=e.dialect.words,i=n||uQ,o=["QuotedIdentifier","String","LineComment","BlockComment","."],s=lw(Object.keys(r).map(e=>{var n;return i(t?e.toUpperCase():e,21==(n=r[e])?"type":20==n?"keyword":"variable")})),e=>{for(let t=sQ(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return s(e)}}(c,e.upperCaseKeywords,e.keywordCompletion)})])}let uK=uH.define({}),uX=uH.define({charSetCasts:!0,doubleDollarQuotedStrings:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:uT+"abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:uE+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"});e.s(["PostgreSQL",()=>uX,"sql",()=>u$],864868);class uG{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}}function uZ(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(uJ(t)||-1==t)return n}}function uY(e){return 32==e||9==e}function uJ(e){return 10==e||13==e}function u0(e){var t;return e<0||uY(t=e)||uJ(t)}uG.top=new uG(null,-1,0);let u1=new class{constructor(e){this.start=e.start,this.shift=e.shift||lp,this.reduce=e.reduce||lp,this.reuse=e.reuse||lp,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:uG.top,reduce:(e,t)=>3==e.type&&(20==t||34==t)?e.parent:e,shift(e,t,n,r){if(3==t)return new uG(e,uZ(r,r.pos),1);if(65==t||5==t)return new uG(e,uZ(r,r.pos),2);if(63==t)return e.parent;if(19==t||33==t)return new uG(e,0,3);if(13==t&&4==e.type)return e.parent;if(47==t){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new uG(e,e.depth+ +t[0],4)}return e},hash:e=>e.hash});function u2(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&u0(e.peek(n+3))}let u3=new lr((e,t)=>{if(-1==e.next&&t.canShift(64))return e.acceptToken(64);let n=e.peek(-1);if((uJ(n)||n<0)&&3!=t.context.type){if(u2(e,45))if(!t.canShift(63))return e.acceptToken(1,3);else e.acceptToken(63);if(u2(e,46))if(!t.canShift(63))return e.acceptToken(2,3);else e.acceptToken(63);let n=0;for(;32==e.next;)n++,e.advance();!(n<t.context.depth)&&(n!=t.context.depth||1!=t.context.type||45==e.next&&u0(e.peek(1)))||-1==e.next||uJ(e.next)||35==e.next||e.acceptToken(63,-n)}},{contextual:!0}),u4=new lr((e,t)=>{if(3==t.context.type){63==e.next&&(e.advance(),u0(e.next)&&e.acceptToken(7));return}if(45==e.next)e.advance(),u0(e.next)&&e.acceptToken(1==t.context.type&&t.context.depth==uZ(e,e.pos-1)?4:3);else if(63==e.next)e.advance(),u0(e.next)&&e.acceptToken(2==t.context.type&&t.context.depth==uZ(e,e.pos-1)?6:5);else{let n=e.pos;for(;;)if(uY(e.next)){if(e.pos==n)return;e.advance()}else if(33==e.next)u5(e);else if(38==e.next)u9(e);else if(42==e.next){u9(e);break}else if(39==e.next||34==e.next){if(u7(e,!0))break;return}else if(91==e.next||123==e.next){if(!function(e){for(let t=[],n=e.pos+1024;;)if(91==e.next||123==e.next)t.push(e.next),e.advance();else if(39==e.next||34==e.next){if(!u7(e,!0))return!1}else if(93==e.next||125==e.next){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||uJ(e.next))return!1;e.advance()}}(e))return;break}else{cn(e,!0,!1,0);break}for(;uY(e.next);)e.advance();if(58==e.next){if(e.pos==n&&t.canShift(29))return;u0(e.peek(1))&&e.acceptTokenTo(2==t.context.type&&t.context.depth==uZ(e,n)?66:65,n)}}},{contextual:!0});function u8(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function u6(e,t){var n;return 37==e.next?(e.advance(),u8(e.next)&&e.advance(),u8(e.next)&&e.advance(),!0):(!!((n=e.next)>32)&&!!(n<127)&&34!=n&&37!=n&&44!=n&&60!=n&&62!=n&&92!=n&&94!=n&&96!=n&&123!=n&&124!=n&&125!=n||!!t&&44==e.next)&&(e.advance(),!0)}function u5(e){if(e.advance(),60==e.next){for(e.advance();;)if(!u6(e,!0)){62==e.next&&e.advance();break}}else for(;u6(e,!1););}function u9(e){for(e.advance();!u0(e.next)&&"f"!=ce(e.tag);)e.advance()}function u7(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let o=e.next;if(o<0)break;if(e.advance(),o==n)if(39==o)if(39==e.next)e.advance();else break;else break;else if(92==o&&34==n)e.next>=0&&e.advance();else if(uJ(o)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function ce(e){return e<33?"u":e>125?"s":"iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif"[e-33]}function ct(e,t){let n=ce(e);return"u"!=n&&!(t&&"f"==n)}function cn(e,t,n,r){if(!("s"==ce(e.next)||(63==e.next||58==e.next||45==e.next)&&ct(e.peek(1),n)))return!1;e.advance();let i=e.pos;for(;;){var o;let s=e.next,a=0,l=r+1;for(;uY(o=s)||uJ(o);){if(uJ(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(58==s?ct(e.peek(a+1),n):35==s?32!=e.peek(a-1):ct(s,n)))||!n&&l<=r||0==l&&!n&&(u2(e,45,a)||u2(e,46,a)))break;if(t&&"f"==ce(s))return!1;for(let t=a;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}let cr=new lr((e,t)=>{if(33==e.next)u5(e),e.acceptToken(12);else if(38==e.next||42==e.next){let t=38==e.next?10:11;u9(e),e.acceptToken(t)}else 39==e.next||34==e.next?(u7(e,!1),e.acceptToken(9)):cn(e,!1,3==t.context.type,t.context.depth)&&e.acceptToken(8)}),ci=new lr((e,t)=>{let n=4==t.context.type?t.context.depth:-1,r=e.pos;t:for(;;){let i=0,o=e.next;for(;32==o;)o=e.peek(++i);if(!i&&(u2(e,45,i)||u2(e,46,i))||!uJ(o)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break t;let t=uJ(e.next);if(e.advance(),t)continue t;r=e.pos}}e.acceptTokenTo(13,r)}),co=sb({DirectiveName:sU.keyword,DirectiveContent:sU.attributeValue,"DirectiveEnd DocEnd":sU.meta,QuotedLiteral:sU.string,BlockLiteralHeader:sU.special(sU.string),BlockLiteralContent:sU.content,Literal:sU.content,"Key/Literal Key/QuotedLiteral":sU.definition(sU.propertyName),"Anchor Alias":sU.labelName,Tag:sU.typeName,Comment:sU.lineComment,": , -":sU.separator,"?":sU.punctuation,"[ ]":sU.squareBracket,"{ }":sU.brace}),cs=lg.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:u1,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[co],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[u3,u4,cr,ci,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),ca=sH.define({name:"yaml",parser:cs.configure({props:[s7.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if("BlockLiteralContent"==t.name&&t.from<t.to)return e.baseIndentFor(t);if("BlockLiteral"==t.name)return e.baseIndentFor(t)+e.unit;if("BlockSequence"==t.name||"BlockMapping"==t.name)return e.column(t.from,1);if("QuotedLiteral"==t.name)break;if("Literal"==t.name){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)break}}return null},FlowMapping:ar({closing:"}"}),FlowSequence:ar({closing:"]"})}),al.add({"FlowMapping FlowSequence":au,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function cl(){return new s2(ca)}sU.meta,e.s(["yaml",()=>cl],117390);var cu=e.i(511334),cc=e=>{var{theme:t,settings:n={},styles:r=[]}=e,i={".cm-gutters":{}},o={};n.background&&(o.backgroundColor=n.background),n.backgroundImage&&(o.backgroundImage=n.backgroundImage),n.foreground&&(o.color=n.foreground),n.fontSize&&(o.fontSize=n.fontSize),(n.background||n.foreground)&&(i["&"]=o),n.fontFamily&&(i["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(i[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(i[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(i[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(i[".cm-content"]={caretColor:n.caret},i[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var s={};return n.gutterActiveForeground&&(s.color=n.gutterActiveForeground),n.lineHighlight&&(i[".cm-activeLine"]={backgroundColor:n.lineHighlight},s.backgroundColor=n.lineHighlight),i[".cm-activeLineGutter"]=s,n.selection&&(i["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(i["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch}),[iF.theme(i,{dark:"dark"===t}),aL(aR.define(r))]},ch={background:"#fff",foreground:"#24292e",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},cd=[{tag:[sU.standard(sU.tagName),sU.tagName],color:"#116329"},{tag:[sU.comment,sU.bracket],color:"#6a737d"},{tag:[sU.className,sU.propertyName],color:"#6f42c1"},{tag:[sU.variableName,sU.attributeName,sU.number,sU.operator],color:"#005cc5"},{tag:[sU.keyword,sU.typeName,sU.typeOperator,sU.typeName],color:"#d73a49"},{tag:[sU.string,sU.meta,sU.regexp],color:"#032f62"},{tag:[sU.name,sU.quote],color:"#22863a"},{tag:[sU.heading,sU.strong],color:"#24292e",fontWeight:"bold"},{tag:[sU.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[sU.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[sU.atom,sU.bool,sU.special(sU.variableName)],color:"#e36209"},{tag:[sU.url,sU.escape,sU.regexp,sU.link],color:"#032f62"},{tag:sU.link,textDecoration:"underline"},{tag:sU.strikethrough,textDecoration:"line-through"},{tag:sU.invalid,color:"#cb2431"}],cf=(e=>{var{theme:t="light",settings:n={},styles:r=[]}=e||{};return cc({theme:t,settings:(0,cu.default)({},ch,n),styles:[...cd,...r]})})(),cp={background:"#0d1117",foreground:"#c9d1d9",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},cg=[{tag:[sU.standard(sU.tagName),sU.tagName],color:"#7ee787"},{tag:[sU.comment,sU.bracket],color:"#8b949e"},{tag:[sU.className,sU.propertyName],color:"#d2a8ff"},{tag:[sU.variableName,sU.attributeName,sU.number,sU.operator],color:"#79c0ff"},{tag:[sU.keyword,sU.typeName,sU.typeOperator,sU.typeName],color:"#ff7b72"},{tag:[sU.string,sU.meta,sU.regexp],color:"#a5d6ff"},{tag:[sU.name,sU.quote],color:"#7ee787"},{tag:[sU.heading,sU.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[sU.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[sU.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[sU.atom,sU.bool,sU.special(sU.variableName)],color:"#ffab70"},{tag:sU.link,textDecoration:"underline"},{tag:sU.strikethrough,textDecoration:"line-through"},{tag:sU.invalid,color:"#f97583"}],cm=(e=>{var{theme:t="dark",settings:n={},styles:r=[]}=e||{};return cc({theme:t,settings:(0,cu.default)({},cp,n),styles:[...cg,...r]})})(),cv=e.i(318680),cy=e.i(600943);function cb(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}let cw=cb(function(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:o}of n){let n=r.length,s=1e9,a=ck(t,e).line;if(a){for(let n=e;n<=o;){let l=t.doc.lineAt(n);if(l.from>i&&(e==o||o>l.from)){i=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),r.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(s<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=s);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:s}of r)(s||!o)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null},0),cx=cb(c_,0),cS=cb((e,t)=>c_(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function ck(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function c_(e,t,n=t.selection.ranges){let r=n.map(e=>ck(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let o,s,a=e.sliceDoc(r-50,r),l=e.sliceDoc(i,i+50),u=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,h=a.length-u;if(a.slice(h-t.length,h)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?o=s=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+50),s=e.sliceDoc(i-50,i));let d=/^\s*/.exec(o)[0].length,f=/\s*$/.exec(s)[0].length,p=s.length-f-n.length;return o.slice(d,d+t.length)==t&&s.slice(p,p+n.length)==n?{open:{pos:r+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:i-f-n.length,margin:+!!/\s/.test(s.charAt(p-1))}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:o,close:s}=n;e.push({from:o.pos-i.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+i.close.length})}return{changes:e}}return null}let cO=eQ.define(),cC=eQ.define(),cE=e_.define(),cT=e_.define({combine:e=>e4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),cP=eA.define({create:()=>cW.empty,update(e,t){let n=t.state.facet(cT),r=t.annotation(cO);if(r){let i=cL.fromTransaction(t,r.selection),o=r.side,s=0==o?e.undone:e.done;return s=i?cN(s,s.length,n.minDepth,i):cj(s,t.startState.selection),new cW(0==o?r.rest:s,0==o?s:r.rest)}let i=t.annotation(cC);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(eG.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=cL.fromTransaction(t),s=t.annotation(eG.time),a=t.annotation(eG.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new cW(e.done.map(cL.fromJSON),e.undone.map(cL.fromJSON))});function cA(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(cP,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}let cR=cA(0,!1),cM=cA(1,!1),cI=cA(0,!0),cD=cA(1,!0);class cL{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new cL(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new cL(e.changes&&ef.fromJSON(e.changes),[],e.mapped&&ed.fromJSON(e.mapped),e.startSelection&&ex.fromJSON(e.startSelection),e.selectionsAfter.map(ex.fromJSON))}static fromTransaction(e,t){let n=cF;for(let t of e.startState.facet(cE)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new cL(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,cF)}static selection(e){return new cL(void 0,cF,void 0,void 0,e)}}function cN(e,t,n,r){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(r),i}function cB(e,t){return e.length?t.length?e.concat(t):e:t}let cF=[];function cj(e,t){if(!e.length)return[cL.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),cN(e,e.length-1,1e9,n.setSelAfter(r)))}}function cU(e,t){if(!e.length)return e;let n=e.length,r=cF;for(;n;){let i=function(e,t,n){let r=cB(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):cF,n);if(!e.changes)return cL.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new cL(i,eX.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[cL.selection(r)]:cF}let cq=/^(input\.type|delete)($|\.)/;class cW{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new cW(this.done,this.undone):this}addChanges(e,t,n,r,i){var o,s;let a,l,u=this.done,c=u[u.length-1];return new cW(u=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||cq.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(o=c.changes,s=e.changes,a=[],l=!1,o.iterChangedRanges((e,t)=>a.push(e,t)),s.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<a.length;){let t=a[e++],i=a[e++];r>=t&&n<=i&&(l=!0)}}),l))||"input.type.compose"==n)?cN(u,u.length-1,r.minDepth,new cL(e.changes.compose(c.changes),cB(eX.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,cF)):cN(u,u.length,r.minDepth,e),cF,t,n)}addSelection(e,t,n,r){var i;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:cF;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new cW(cj(this.done,e),this.undone,t,n)}addMapping(e){return new cW(cU(this.done,e),cU(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],o=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length){let n,s;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:cO.of({side:e,rest:(n=r[r.length-1],(s=r.slice())[r.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),s),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!i.changes)return null;let n=1==r.length?cF:r.slice(0,r.length-1);return i.mapped&&(n=cU(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:cO.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}cW.empty=new cW(cF,cF);let cz=[{key:"Mod-z",run:cR,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:cM,preventDefault:!0},{linux:"Ctrl-Shift-z",run:cM,preventDefault:!0},{key:"Mod-u",run:cI,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:cD,preventDefault:!0}];function cV(e,t){return ex.create(e.ranges.map(t),e.mainIndex)}function cH(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function cQ({state:e,dispatch:t},n){let r=cV(e.selection,n);return!r.eq(e.selection,!0)&&(t(cH(e,r)),!0)}function c$(e,t){return ex.cursor(t?e.to:e.from)}function cK(e,t){return cQ(e,n=>n.empty?e.moveByChar(n,t):c$(n,t))}function cX(e){return e.textDirectionAt(e.state.selection.main.head)==nl.LTR}let cG=e=>cK(e,!cX(e)),cZ=e=>cK(e,cX(e));function cY(e,t){return cQ(e,n=>n.empty?e.moveByGroup(n,t):c$(n,t))}function cJ(e,t,n){let r,i,o=sQ(e).resolveInner(t.head),s=n?p.closedBy:p.openedBy;for(let r=t.head;;){let t=n?o.childAfter(r):o.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,s)?r=n?t.to:t.from:o=t}return i=o.type.prop(s)&&(r=n?aG(e,o.from,1):aG(e,o.to,-1))&&r.matched?n?r.end.to:r.end.from:n?o.to:o.from,ex.cursor(i,n?-1:1)}function c0(e,t){return cQ(e,n=>{if(!n.empty)return c$(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let c1=e=>c0(e,!1),c2=e=>c0(e,!0);function c3(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(iF.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function c4(e,t){let n,r=c3(e),{state:i}=e,o=cV(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):c$(n,t));if(o.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+r.marginTop,l=s.bottom-r.marginBottom;t&&t.top>a&&t.bottom<l&&(n=iF.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(cH(i,o),{effects:n}),!0}let c8=e=>c4(e,!1),c6=e=>c4(e,!0);function c5(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=ex.cursor(r.from+n))}return i}function c9(e,t){let n=cV(e.state.selection,e=>{let n=t(e);return ex.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(cH(e.state,n)),!0)}function c7(e,t){return c9(e,n=>e.moveByChar(n,t))}let he=e=>c7(e,!cX(e)),ht=e=>c7(e,cX(e));function hn(e,t){return c9(e,n=>e.moveByGroup(n,t))}function hr(e,t){return c9(e,n=>e.moveVertically(n,t))}let hi=e=>hr(e,!1),ho=e=>hr(e,!0);function hs(e,t){return c9(e,n=>e.moveVertically(n,t,c3(e).height))}let ha=e=>hs(e,!1),hl=e=>hs(e,!0),hu=({state:e,dispatch:t})=>(t(cH(e,{anchor:0})),!0),hc=({state:e,dispatch:t})=>(t(cH(e,{anchor:e.doc.length})),!0),hh=({state:e,dispatch:t})=>(t(cH(e,{anchor:e.selection.main.anchor,head:0})),!0),hd=({state:e,dispatch:t})=>(t(cH(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function hf(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let o=n.doc.lineAt(r.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<o.from||r.head>o.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(cH(n,ex.create(i,i.length-1))),!0)}function hp(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:o}=r;if(i==o){let s=t(r);s<i?(n="delete.backward",s=hg(e,s,!1)):s>i&&(n="delete.forward",s=hg(e,s,!0)),i=Math.min(i,s),o=Math.max(o,s)}else i=hg(e,i,!1),o=hg(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:ex.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?iF.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function hg(e,t,n){if(e instanceof iF)for(let r of e.state.facet(iF.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let hm=(e,t,n)=>hp(e,r=>{let i=r.from,{state:o}=e,s=o.doc.lineAt(i),a,l;if(n&&!t&&i>s.from&&i<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,i-s.from))){if(" "==a[a.length-1])return i-1;let e=td(a,o.tabSize)%s8(o)||s8(o);for(let t=0;t<e&&" "==a[a.length-1-t];t++)i--;l=i}else(l=es(s.text,i-s.from,t,t)+s.from)==i&&s.number!=(t?o.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,i-s.from))&&(l=es(s.text,l-s.from,!1,!1)+s.from);return l}),hv=e=>hm(e,!1,!0),hy=e=>hm(e,!0,!1),hb=(e,t)=>hp(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let e=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let a=es(o.text,r-o.from,t)+o.from,l=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),u=s(l);if(null!=e&&u!=e)break;(" "!=l||r!=n.head)&&(e=u),r=a}return r}),hw=e=>hb(e,!1);function hx(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function hS(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of hx(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),s=o.length+1;if(n)for(let n of(r.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))i.push(ex.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)));else for(let n of(r.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))i.push(ex.range(n.anchor-s,n.head-s))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:ex.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function hk(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of hx(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let h_=hC(!1),hO=hC(!0);function hC(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,o=t.doc.lineAt(r),s=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=sQ(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(p.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=o.to?o:t.doc.lineAt(i)).to);let a=new s9(t,{simulateBreak:r,simulateDoubleBreak:!!s}),l=s5(a,r);for(null==l&&(l=td(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;s?{from:r,to:i}=s:r>o.from&&r<o.from+100&&!/\S/.test(o.text.slice(0,r))&&(r=o.from);let u=["",s6(t,l)];return s&&u.push(s6(t,a.lineIndent(o.from,-1))),{changes:{from:r,to:i,insert:Z.of(u)},range:ex.cursor(r+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function hE(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let s=e.doc.lineAt(o);s.number>n&&(r.empty||r.to>s.from)&&(t(s,i,r),n=s.number),o=s.to+1}let o=e.changes(i);return{changes:i,range:ex.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let hT=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(hE(e,(t,n)=>{n.push({from:t.from,insert:e.facet(s4)})}),{userEvent:"input.indent"})),!0),hP=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(hE(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=td(r,e.tabSize),o=0,s=s6(e,Math.max(0,i-s8(e)));for(;o<r.length&&o<s.length&&r.charCodeAt(o)==s.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:s.slice(o)})}),{userEvent:"delete.dedent"})),!0),hA=[{key:"Ctrl-b",run:cG,shift:he,preventDefault:!0},{key:"Ctrl-f",run:cZ,shift:ht},{key:"Ctrl-p",run:c1,shift:hi},{key:"Ctrl-n",run:c2,shift:ho},{key:"Ctrl-a",run:e=>cQ(e,t=>ex.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>c9(e,t=>ex.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>cQ(e,t=>ex.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>c9(e,t=>ex.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:hy},{key:"Ctrl-h",run:hv},{key:"Ctrl-k",run:e=>hp(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:hw},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Z.of(["",""])},range:ex.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:es(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:es(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(i,n))},range:ex.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:c6}],hR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>cQ(e,t=>cJ(e.state,t,!cX(e))),shift:e=>c9(e,t=>cJ(e.state,t,!cX(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>cQ(e,t=>cJ(e.state,t,cX(e))),shift:e=>c9(e,t=>cJ(e.state,t,cX(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>hS(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>hk(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>hS(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>hk(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>hf(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>hf(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=ex.create([n.main]):n.main.empty||(r=ex.create([ex.cursor(n.main.head)])),!!r&&(t(cH(e,r)),!0)}},{key:"Mod-Enter",run:hO},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=hx(e).map(({from:t,to:n})=>ex.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:ex.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=cV(e.selection,t=>{let n=sQ(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return ex.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(cH(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:hP},{key:"Mod-]",run:hT},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new s9(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=hE(e,(t,i,o)=>{let s=s5(r,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=s6(e,s);(a!=l||o.from<t.from+a.length)&&(n[t.from]=s,i.push({from:t.from,to:t.from+a.length,insert:l}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(hx(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=cV(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=cV(e.selection,t=>{let r=aG(e,t.head,-1)||aG(e,t.head,1)||t.head>0&&aG(e,t.head-1,1)||t.head<e.doc.length&&aG(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return ex.cursor(i)}),!!n&&(t(cH(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=ck(e.state,n.from);return r.line?cw(e):!!r.block&&cS(e)}},{key:"Alt-A",run:cx},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:cG,shift:he,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>cY(e,!cX(e)),shift:e=>hn(e,!cX(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>cQ(e,t=>c5(e,t,!cX(e))),shift:e=>c9(e,t=>c5(e,t,!cX(e))),preventDefault:!0},{key:"ArrowRight",run:cZ,shift:ht,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>cY(e,cX(e)),shift:e=>hn(e,cX(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>cQ(e,t=>c5(e,t,cX(e))),shift:e=>c9(e,t=>c5(e,t,cX(e))),preventDefault:!0},{key:"ArrowUp",run:c1,shift:hi,preventDefault:!0},{mac:"Cmd-ArrowUp",run:hu,shift:hh},{mac:"Ctrl-ArrowUp",run:c8,shift:ha},{key:"ArrowDown",run:c2,shift:ho,preventDefault:!0},{mac:"Cmd-ArrowDown",run:hc,shift:hd},{mac:"Ctrl-ArrowDown",run:c6,shift:hl},{key:"PageUp",run:c8,shift:ha},{key:"PageDown",run:c6,shift:hl},{key:"Home",run:e=>cQ(e,t=>c5(e,t,!1)),shift:e=>c9(e,t=>c5(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:hu,shift:hh},{key:"End",run:e=>cQ(e,t=>c5(e,t,!0)),shift:e=>c9(e,t=>c5(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:hc,shift:hd},{key:"Enter",run:h_,shift:h_},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:hv,shift:hv,preventDefault:!0},{key:"Delete",run:hy,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:hw,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>hb(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>hp(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>hp(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(hA.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),hM={key:"Tab",run:hT,shift:hP},hI="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class hD{constructor(e,t,n=0,r=e.length,i,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(hI(e)):hI,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return ea(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=el(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=eu(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let o=r.charCodeAt(e),s=this.match(o,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(s)return this.value=s,this;break}i==n&&e<t.length&&t.charCodeAt(e)==o&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],o=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"u">typeof Symbol&&(hD.prototype[Symbol.iterator]=function(){return this});let hL={from:-1,to:-1,match:/.*/.exec("")},hN="gm"+(null==/x/.unicode?"":"u");class hB{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=hL,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new hU(e,t,n,r,i);this.re=new RegExp(t,hN+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=hq(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=hq(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let hF=new WeakMap;class hj{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=hF.get(e);if(!r||r.from>=n||r.to<=t){let r=new hj(t,e.sliceString(t,n));return hF.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to<n&&(i+=e.sliceString(r.to,n)),hF.set(e,new hj(o,i)),new hj(t,i.slice(t-o,n-o))}}class hU{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=hL,this.matchPos=hq(e,r),this.re=new RegExp(t,hN+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=hj.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=hq(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hj.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function hq(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}"u">typeof Symbol&&(hB.prototype[Symbol.iterator]=hU.prototype[Symbol.iterator]=function(){return this});let hW={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hz=e_.define({combine:e=>e4(e,hW,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),hV=tH.mark({class:"cm-selectionMatch"}),hH=tH.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function hQ(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=e1.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=e1.Word)}let h$=nq.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(hz),{state:n}=e,r=n.selection;if(r.ranges.length>1)return tH.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return tH.none;let e=n.wordAt(i.head);if(!e)return tH.none;s=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return tH.none;if(t.wholeWords){var a,l,u;if(o=n.sliceDoc(i.from,i.to),!(hQ(s=n.charCategorizer(i.head),n,i.from,i.to)&&(a=s,l=i.from,u=i.to,a(n.sliceDoc(l,l+1))==e1.Word&&a(n.sliceDoc(u-1,u))==e1.Word)))return tH.none}else if(!(o=n.sliceDoc(i.from,i.to)))return tH.none}let c=[];for(let r of e.visibleRanges){let e=new hD(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||hQ(s,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?c.push(hH.range(r,o)):(r>=i.to||o<=i.from)&&c.push(hV.range(r,o)),c.length>t.maxMatches))return tH.none}}return tH.set(c)}},{decorations:e=>e.decorations}),hK=iF.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),hX=e_.define({combine:e=>e4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new dg(e),scrollToMatch:e=>iF.scrollIntoView(e)})});class hG{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,hN),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new h3(this):new hJ(this)}getCursor(e,t=0,n){let r=e.doc?e:e3.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?h0(this,r,t,n):hY(this,r,t,n)}}class hZ{constructor(e){this.spec=e}}function hY(e,t,n,r){var i,o,s,a;let l;return e.wholeWord&&(s=t.doc,a=t.charCategorizer(t.selection.main.head),l=(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=s.sliceString(r,Math.min(s.length,t+2))),(a(h1(n,e-r))!=e1.Word||a(h2(n,e-r))!=e1.Word)&&(a(h2(n,t-r))!=e1.Word||a(h1(n,t-r))!=e1.Word))),e.test&&(i=e.test,o=l,l=(e,n,r,s)=>(!o||!!o(e,n,r,s))&&i(e>=s&&n<=s+r.length?r.slice(e-s,n-s):t.doc.sliceString(e,n),t,e,n)),new hD(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),l)}class hJ extends hZ{constructor(e){super(e)}nextMatch(e,t,n){let r=hY(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=hY(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=hY(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=hY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=hY(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function h0(e,t,n,r){var i,o,s;let a;return e.wholeWord&&(s=t.charCategorizer(t.selection.main.head),a=(e,t,n)=>!n[0].length||(s(h1(n.input,n.index))!=e1.Word||s(h2(n.input,n.index))!=e1.Word)&&(s(h2(n.input,n.index+n[0].length))!=e1.Word||s(h1(n.input,n.index+n[0].length))!=e1.Word)),e.test&&(i=e.test,o=a,a=(e,n,r)=>(!o||o(e,n,r))&&i(r[0],t,e,n)),new hB(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:a},n,r)}function h1(e,t){return e.slice(es(e,t,!1),t)}function h2(e,t){return e.slice(t,es(e,t))}class h3 extends hZ{nextMatch(e,t,n){let r=h0(this.spec,e,n,e.doc.length).next();return r.done&&(r=h0(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=h0(this.spec,e,i,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(i==t||s.from>i+10))return s;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=h0(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=h0(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let h4=eX.define(),h8=eX.define(),h6=eA.define({create:e=>new h5(du(e).create(),null),update(e,t){for(let n of t.effects)n.is(h4)?e=new h5(n.value.create(),e.panel):n.is(h8)&&(e=new h5(e.query,n.value?dl:null));return e},provide:e=>oX.from(e,e=>e.panel)});class h5{constructor(e,t){this.query=e,this.panel=t}}let h9=tH.mark({class:"cm-searchMatch"}),h7=tH.mark({class:"cm-searchMatch cm-searchMatch-selected"}),de=nq.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(h6))}update(e){let t=e.state.field(h6);(t!=e.startState.field(h6)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return tH.none;let{view:n}=this,r=new tt;for(let t=0,i=n.visibleRanges,o=i.length;t<o;t++){let{from:s,to:a}=i[t];for(;t<o-1&&a>i[t+1].from-500;)a=i[++t].to;e.highlight(n.state,s,a,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?h7:h9)})}return r.finish()}},{decorations:e=>e.decorations});function dt(e){return t=>{let n=t.state.field(h6,!1);return n&&n.query.spec.valid?e(t,n):dd(t)}}let dn=dt((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=ex.single(r.from,r.to),o=e.state.facet(hX);return e.dispatch({selection:i,effects:[dy(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),dh(e),!0}),dr=dt((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=ex.single(i.from,i.to),s=e.state.facet(hX);return e.dispatch({selection:o,effects:[dy(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),dh(e),!0}),di=dt((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:ex.create(n.map(e=>ex.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),ds=dt((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=o,a=[],l,u,c=[];s.from==r&&s.to==i&&(u=n.toText(t.getReplacement(s)),a.push({from:s.from,to:s.to,insert:u}),s=t.nextMatch(n,s.from,s.to),c.push(iF.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let h=e.state.changes(a);return s&&(l=ex.single(s.from,s.to).map(h),c.push(dy(e,s)),c.push(n.facet(hX).scrollToMatch(l.main,e))),e.dispatch({changes:h,selection:l,effects:c,userEvent:"input.replace"}),!0}),da=dt((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:iF.announce.of(r),userEvent:"input.replace.all"}),!0});function dl(e){return e.state.facet(hX).createPanel(e)}function du(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let u=e.facet(hX);return new hG({search:(null!=(n=null==t?void 0:t.literal)?n:u.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!=(r=null==t?void 0:t.caseSensitive)?r:u.caseSensitive,literal:null!=(i=null==t?void 0:t.literal)?i:u.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:u.regexp,wholeWord:null!=(s=null==t?void 0:t.wholeWord)?s:u.wholeWord})}function dc(e){let t=oH(e,dl);return t&&t.dom.querySelector("[main-field]")}function dh(e){let t=dc(e);t&&t==e.root.activeElement&&t.select()}let dd=e=>{let t=e.state.field(h6,!1);if(t&&t.panel){let n=dc(e);if(n&&n!=e.root.activeElement){let r=du(e.state,t.query.spec);r.valid&&e.dispatch({effects:h4.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[h8.of(!0),t?h4.of(du(e.state,t.query.spec)):eX.appendConfig.of(dw)]});return!0},df=e=>{let t=e.state.field(h6,!1);if(!t||!t.panel)return!1;let n=oH(e,dl);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:h8.of(!1)}),!0},dp=[{key:"Mod-f",run:dd,scope:"editor search-panel"},{key:"F3",run:dn,shift:dr,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:dn,shift:dr,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:df,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let t=new hD(e.doc,e.sliceDoc(r,i));!t.next().done;){if(o.length>1e3)return!1;t.value.from==r&&(s=o.length),o.push(ex.range(t.value.from,t.value.to))}return t(e.update({selection:ex.create(o,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=oG(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i)return void e.dispatch({effects:r});let o=t.doc.lineAt(t.selection.main.head),[,s,a,l,u]=i,c=l?+l.slice(1):0,h=a?+a:o.number;if(a&&u){let e=h/100;s&&(e=e*("-"==s?-1:1)+o.number/t.doc.lines),h=Math.round(t.doc.lines*e)}else a&&s&&(h=h*("-"==s?-1:1)+o.number);let d=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),f=ex.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[r,iF.scrollIntoView(f.from,{y:"center"})],selection:f})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=ex.create(n.ranges.map(t=>e.wordAt(t.head)||ex.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new hD(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new hD(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(ex.range(i.from,i.to),!1),effects:iF.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class dg{constructor(e){this.view=e;let t=this.query=e.state.field(h6).query.spec;function n(e,t,n){return tC("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=tC("input",{value:t.search,placeholder:dm(e,"Find"),"aria-label":dm(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=tC("input",{value:t.replace,placeholder:dm(e,"Replace"),"aria-label":dm(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=tC("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=tC("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=tC("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=tC("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>dn(e),[dm(e,"next")]),n("prev",()=>dr(e),[dm(e,"previous")]),n("select",()=>di(e),[dm(e,"all")]),tC("label",null,[this.caseField,dm(e,"match case")]),tC("label",null,[this.reField,dm(e,"regexp")]),tC("label",null,[this.wordField,dm(e,"by word")]),...e.state.readOnly?[]:[tC("br"),this.replaceField,n("replace",()=>ds(e),[dm(e,"replace")]),n("replaceAll",()=>da(e),[dm(e,"replace all")])],tC("button",{name:"close",onclick:()=>df(e),"aria-label":dm(e,"close"),type:"button"},["×"])])}commit(){let e=new hG({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:h4.of(e)}))}keydown(e){iX(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?dr:dn)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ds(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(h4)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(hX).top}}function dm(e,t){return e.state.phrase(t)}let dv=/[\s\.,:;?!]/;function dy(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-30),s=Math.min(i,n+30),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let e=0;e<30;e++)if(!dv.test(a[e+1])&&dv.test(a[e])){a=a.slice(e);break}}if(s!=i){for(let e=a.length-1;e>a.length-30;e--)if(!dv.test(a[e-1])&&dv.test(a[e])){a=a.slice(0,e);break}}return iF.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}let db=iF.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),dw=[h6,eM.low(de),db];class dx{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class dS{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(dI).markerFilter;r&&(e=r(e,n));let i=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new tt,s=[],a=0,l=n.doc.iter(),u=0,c=n.doc.length;for(let e=0;;){let t,n,r=e==i.length?null:i[e];if(!r&&!s.length)break;if(s.length)t=a,n=s.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if((t=r.from)>c)break;n=r.to,s.push(r),e++}for(;e<i.length;){let r=i[e];if(r.from==t&&(r.to>r.from||r.to==t))s.push(r),e++,n=Math.min(r.to,n);else{n=Math.min(r.from,n);break}}n=Math.min(n,c);let h=!1;if(s.some(e=>e.from==t&&(e.to==n||n==c))&&!(h=t==n)&&n-t<10){let e=t-(u+l.value.length);e>0&&(l.next(e),u=t);for(let e=t;;){if(e>=n){h=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let d=dW(s);if(h)o.add(t,t,tH.widget({widget:new dB(d),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,tH.mark({class:"cm-lintRange cm-lintRange-"+d+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>n)}))}if((a=n)==c)break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1)}let h=o.finish();return new dS(h,t,dk(h))}}function dk(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&0>i.diagnostics.indexOf(t)))if(r){if(0>i.diagnostics.indexOf(r.diagnostic))return!1;r=new dx(r.from,n,r.diagnostic)}else r=new dx(e,n,t||i.diagnostics[0])}),r}function d_(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(dI).hideOn(e,n,r);if(null!=i)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(dO))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}let dO=eX.define(),dC=eX.define(),dE=eX.define(),dT=eA.define({create:()=>new dS(tH.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=dk(n,e.selected.diagnostic,i)||dk(n,null,i)}!n.size&&i&&t.state.facet(dI).autoPanel&&(i=null),e=new dS(n,i,r)}for(let n of t.effects)if(n.is(dO)){let r=t.state.facet(dI).autoPanel?n.value.length?dj.open:null:e.panel;e=dS.init(n.value,r,t.state)}else n.is(dC)?e=new dS(e.diagnostics,n.value?dj.open:null,e.selected):n.is(dE)&&(e=new dS(e.diagnostics,e.panel,n.value));return e},provide:e=>[oX.from(e,e=>e.panel),iF.decorations.from(e,e=>e.diagnostics)]}),dP=tH.mark({class:"cm-lintRange cm-lintRange-active"});function dA(e,t){return tC("ul",{class:"cm-tooltip-lint"},t.map(t=>dN(e,t,!1)))}let dR=e=>{let t=e.state.field(dT,!1);return!!t&&!!t.panel&&(e.dispatch({effects:dC.of(!1)}),!0)},dM=[{key:"Mod-Shift-m",run:e=>{var t,n;let r=e.state.field(dT,!1);r&&r.panel||e.dispatch({effects:(t=e.state,n=[dC.of(!0)],t.field(dT,!1)?n:n.concat(eX.appendConfig.of(dH)))});let i=oH(e,dj.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(dT,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return(!!r.value||!!(r=t.diagnostics.iter(0)).value&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],dI=e_.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...e4(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:dD,tooltipFilter:dD,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})})});function dD(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function dL(e){let t=[];if(e)i:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue i}}t.push("")}return t}function dN(e,t,n){var r;let i=n?dL(t.actions):[];return tC("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},tC("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(r=t.actions)?void 0:r.map((n,r)=>{let o=!1,s=r=>{if(r.preventDefault(),o)return;o=!0;let i=dk(e.state.field(dT).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:a}=n,l=i[r]?a.indexOf(i[r]):-1,u=l<0?a:[a.slice(0,l),tC("u",a.slice(l,l+1)),a.slice(l+1)];return tC("button",{type:"button",class:"cm-diagnosticAction"+(n.markClass?" "+n.markClass:""),onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${i[r]})"`}.`},u)}),t.source&&tC("div",{class:"cm-diagnosticSource"},t.source))}class dB extends tz{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return tC("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class dF{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=dN(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class dj{constructor(e){this.view=e,this.items=[];let t=t=>{if(27==t.keyCode)dR(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],r=dL(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=dk(this.view.state.field(dT).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=tC("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=tC("div",{class:"cm-panel-lint"},this.list,tC("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>dR(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(dT).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(dT),n=0,r=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,s,{spec:a})=>{for(let e of a.diagnostics){if(o.has(e))continue;o.add(e);let s=-1,a;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){s=t;break}s<0?(a=new dF(this.view,e),this.items.splice(n,0,a),r=!0):(a=this.items[s],s>n&&(this.items.splice(n,s-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),i=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new dF(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=dk(this.view.state.field(dT).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:dE.of(t)})}static open(e){return new dj(e)}}function dU(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let dq=iF.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:dU("#d11")},".cm-lintRange-warning":{backgroundImage:dU("orange")},".cm-lintRange-info":{backgroundImage:dU("#999")},".cm-lintRange-hint":{backgroundImage:dU("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function dW(e){let t="hint",n=1;for(let i of e){var r;let e="error"==(r=i.severity)?4:"warning"==r?3:"info"==r?2:1;e>n&&(n=e,t=i.severity)}return t}let dz=eX.define(),dV=eA.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=d_(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(dz)?t.value:e,e)),provide:e=>oN.from(e)}),dH=[dT,iF.decorations.compute([dT],e=>{let{selected:t,panel:n}=e.field(dT);return t&&n&&t.from!=t.to?tH.set([dP.range(t.from,t.to)]):tH.none}),oq(function(e,t,n){let{diagnostics:r}=e.state.field(dT),i,o=-1,s=-1;r.between(t-(n<0),t+ +(n>0),(e,r,{spec:a})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=a.diagnostics,o=e,s=r,!1});let a=e.state.facet(dI).tooltipFilter;return(i&&a&&(i=a(i,e.state)),i)?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create:()=>({dom:dA(e,i)})}:null},{hideOn:d_}),dq],dQ=e_.define({combine:e=>e4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});var d$=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(uh)),!1!==e.defaultKeymap&&(n=n.concat(hR)),!1!==e.searchKeymap&&(n=n.concat(dp)),!1!==e.historyKeymap&&(n=n.concat(cz)),!1!==e.foldKeymap&&(n=n.concat(aw)),!1!==e.completionKeymap&&(n=n.concat(um)),!1!==e.lintKeymap&&(n=n.concat(dM));var r=[];return!1!==e.lineNumbers&&r.push(sc()),!1!==e.highlightActiveLineGutter&&r.push(sf),!1!==e.highlightSpecialChars&&r.push(of()),!1!==e.history&&r.push(function(e={}){return[cP,cT.of(e),iF.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?cR:"historyRedo"==e.inputType?cM:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(aP()),!1!==e.drawSelection&&r.push(i6()),!1!==e.dropCursor&&r.push(oo()),!1!==e.allowMultipleSelections&&r.push(e3.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(as()),!1!==e.syntaxHighlighting&&r.push(aL(aF,{fallback:!0})),!1!==e.bracketMatching&&r.push(aQ()),!1!==e.closeBrackets&&r.push([uc,uo]),!1!==e.autocompletion&&r.push(function(e={}){return[l2,lK,lR.of(e),l0,uv,l3]}()),!1!==e.rectangularSelection&&r.push(ok()),!1!==t&&r.push(oC()),!1!==e.highlightActiveLine&&r.push(ob),!1!==e.highlightSelectionMatches&&r.push([hK,h$]),e.tabSize&&"number"==typeof e.tabSize&&r.push(s4.of(" ".repeat(e.tabSize))),r.concat([iQ.of(n.flat())]).filter(Boolean)};let dK="#e06c75",dX="#abb2bf",dG="#7d8799",dZ="#d19a66",dY="#2c313a",dJ="#282c34",d0="#353a42",d1="#528bff",d2=[iF.theme({"&":{color:dX,backgroundColor:dJ},".cm-content":{caretColor:d1},".cm-cursor, .cm-dropCursor":{borderLeftColor:d1},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:dX},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:dJ,color:dG,border:"none"},".cm-activeLineGutter":{backgroundColor:dY},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:d0},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:d0,borderBottomColor:d0},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:dY,color:dX}}},{dark:!0}),aL(aR.define([{tag:sU.keyword,color:"#c678dd"},{tag:[sU.name,sU.deleted,sU.character,sU.propertyName,sU.macroName],color:dK},{tag:[sU.function(sU.variableName),sU.labelName],color:"#61afef"},{tag:[sU.color,sU.constant(sU.name),sU.standard(sU.name)],color:dZ},{tag:[sU.definition(sU.name),sU.separator],color:dX},{tag:[sU.typeName,sU.className,sU.number,sU.changed,sU.annotation,sU.modifier,sU.self,sU.namespace],color:"#e5c07b"},{tag:[sU.operator,sU.operatorKeyword,sU.url,sU.escape,sU.regexp,sU.link,sU.special(sU.string)],color:"#56b6c2"},{tag:[sU.meta,sU.comment],color:dG},{tag:sU.strong,fontWeight:"bold"},{tag:sU.emphasis,fontStyle:"italic"},{tag:sU.strikethrough,textDecoration:"line-through"},{tag:sU.link,color:dG,textDecoration:"underline"},{tag:sU.heading,fontWeight:"bold",color:dK},{tag:[sU.atom,sU.bool,sU.special(sU.variableName)],color:dZ},{tag:[sU.processingInstruction,sU.string,sU.inserted],color:"#98c379"},{tag:sU.invalid,color:"#ffffff"}]))];var d3=iF.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),d4=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:i="light",placeholder:o="",basicSetup:s=!0}=e,a=[];switch(t&&a.unshift(iQ.of([hM])),s&&("boolean"==typeof s?a.unshift(d$()):a.unshift(d$(s))),o&&a.unshift(ox(o)),i){case"light":a.push(d3);break;case"dark":a.push(d2);break;case"none":break;default:a.push(i)}return!1===n&&a.push(iF.editable.of(!1)),r&&a.push(e3.readOnly.of(!0)),[...a]};class d8{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error("TimeoutLatch callback error:",e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class d6{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),0===this.latches.size&&this.stop()}start(){null===this.interval&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){null!==this.interval&&(clearInterval(this.interval),this.interval=null)}}var d5=null,d9=eQ.define(),d7=[],fe=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ft=(0,cy.forwardRef)((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,autoFocus:c,theme:d="light",height:f,minHeight:p,maxHeight:g,width:m,minWidth:v,maxWidth:y,basicSetup:b,placeholder:w,indentWithTab:x,editable:S,readOnly:k,root:_,initialState:O}=e,C=(0,cv.default)(e,fe),E=(0,cy.useRef)(null),{state:T,view:P,container:A,setContainer:R}=function(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=d7,autoFocus:l,theme:u="light",height:c=null,minHeight:h=null,maxHeight:d=null,width:f=null,minWidth:p=null,maxWidth:g=null,placeholder:m="",editable:v=!0,readOnly:y=!1,indentWithTab:b=!0,basicSetup:w=!0,root:x,initialState:S}=e,[k,_]=(0,cy.useState)(),[O,C]=(0,cy.useState)(),[E,T]=(0,cy.useState)(),P=(0,cy.useState)(()=>({current:null}))[0],A=(0,cy.useState)(()=>({current:null}))[0],R=iF.theme({"&":{height:c,minHeight:h,maxHeight:d,width:f,minWidth:p,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),M=[iF.updateListener.of(e=>{e.docChanged&&"function"==typeof r&&!e.transactions.some(e=>e.annotation(d9))&&(P.current?P.current.reset():(P.current=new d8(()=>{if(A.current){var e=A.current;A.current=null,e()}P.current=null},200),("u"<typeof window?new d6:(!d5&&(d5=new d6),d5)).add(P.current)),r(e.state.doc.toString(),e)),i&&i({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)})}),R,...d4({theme:u,editable:v,readOnly:y,placeholder:m,indentWithTab:b,basicSetup:w})];return s&&"function"==typeof s&&M.push(iF.updateListener.of(s)),M=M.concat(a),(0,cy.useLayoutEffect)(()=>{if(k&&!E){var e={doc:t,selection:n,extensions:M},r=S?e3.fromJSON(S.json,e,S.fields):e3.create(e);if(T(r),!O){var i=new iF({state:r,parent:k,root:x});C(i),o&&o(i,r)}}return()=>{O&&(T(void 0),C(void 0))}},[k,E]),(0,cy.useEffect)(()=>{e.container&&_(e.container)},[e.container]),(0,cy.useEffect)(()=>()=>{O&&(O.destroy(),C(void 0)),P.current&&(P.current.cancel(),P.current=null)},[O]),(0,cy.useEffect)(()=>{l&&O&&O.focus()},[l,O]),(0,cy.useEffect)(()=>{O&&O.dispatch({effects:eX.reconfigure.of(M)})},[u,a,c,h,d,f,p,g,m,v,y,b,w,r,s]),(0,cy.useEffect)(()=>{if(void 0!==t){var e=O?O.state.doc.toString():"";if(O&&t!==e){var n=P.current&&!P.current.isDone,r=()=>{O&&t!==O.state.doc.toString()&&O.dispatch({changes:{from:0,to:O.state.doc.toString().length,insert:t||""},annotations:[d9.of(!0)]})};n?A.current=r:r()}}},[t,O]),{state:E,setState:T,view:O,setView:C,container:k,setContainer:_}}({root:_,value:r,autoFocus:c,theme:d,height:f,minHeight:p,maxHeight:g,width:m,minWidth:v,maxWidth:y,basicSetup:b,placeholder:w,indentWithTab:x,editable:S,readOnly:k,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:u,extensions:o,initialState:O});(0,cy.useImperativeHandle)(t,()=>({editor:E.current,state:T,view:P}),[E,A,T,P]);var M=(0,cy.useCallback)(e=>{E.current=e,R(e)},[R]);if("string"!=typeof r)throw Error("value must be typeof string but got "+typeof r);var I="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,h.jsx)("div",(0,cu.default)({ref:M,className:""+I+(n?" "+n:"")},C))});function fn({value:e,onChange:t,language:n="sql",readOnly:r=!1,lineNumbers:i=!0,wordWrap:o=!0,fontSize:s=14,height:a="100%",className:l="",theme:u="light",keyBindings:c=[]}){let d=(0,cy.useMemo)(()=>{let e=[iF.theme({"&":{fontSize:`${s}px`},".cm-content":{fontFamily:"'JetBrains Mono', 'Fira Code', monospace"},".cm-gutters":{fontFamily:"'JetBrains Mono', 'Fira Code', monospace"}})],t=function(e){switch(e){case"sql":return u$({dialect:uX});case"yaml":return cl();default:return null}}(n);return t&&e.push(t),o&&e.push(iF.lineWrapping),c.length>0&&e.push(eM.highest(iQ.of(c))),e},[n,s,o,c]),f=(0,cy.useMemo)(()=>"dark"===u?cm:cf,[u]);return(0,h.jsx)(ft,{value:e,onChange:e=>{t&&t(e)},extensions:d,readOnly:r,basicSetup:{lineNumbers:i,foldGutter:!0,highlightActiveLineGutter:!r,highlightActiveLine:!r,tabSize:2},height:a,className:`${l} no-track-pii-safe`,theme:f})}ft.displayName="CodeMirror",e.s(["CodeEditor",()=>fn],272794)},448492,e=>{"use strict";var t=e.i(991047),n=e.i(283276),r=e.i(242397),i=e.i(721394),o=e.i(941647),s=e.i(367745),a=e.i(600943),l=e.i(895299),u=e.i(280490),c=e.i(457918),h=e.i(178675),d=e.i(896772),f=e.i(568029),p=e.i(633921),g=e.i(272794);function m({value:e,onChange:u,onRun:f,onRunBase:m,onRunDiff:v,label:y,CustomEditor:b,options:w={},manifestData:x,schemas:S,...k}){let{featureToggles:_}=(0,c.useRecceInstanceContext)(),O=(0,h.useIsDark)(),C="";x&&(C=x.generated_at?(0,p.formatTimeToNow)(x.generated_at):"");let E=(0,a.useMemo)(()=>{let e=[];return f&&e.push({key:"Mod-Enter",run:()=>(f(),!0)}),m&&e.push({key:"Alt-Enter",run:()=>(m(),!0)}),v&&e.push({key:"Mod-Shift-Enter",run:()=>(v(),!0)}),e},[f,m,v]);return(0,t.jsxs)(t.Fragment,{children:[(y??f??m)&&(0,t.jsxs)(i.default,{direction:"row",sx:{bgcolor:O?(0,o.alpha)(d.colors.neutral[700],.5):(0,o.alpha)(d.colors.neutral[100],.5),height:"40px",minHeight:"40px",fontSize:"14px",alignItems:"center",m:0,p:"0px 16px",flex:"0 0 40px"},children:[(0,t.jsx)(s.default,{component:"strong",sx:{fontWeight:"bold"},className:"no-track-pii-safe",children:y?y.toUpperCase():""}),x&&(0,t.jsxs)("span",{className:"ml-1",children:["(",S&&(0,t.jsxs)("span",{className:"no-track-pii-safe",children:[S,", "]}),(0,t.jsx)("span",{children:C}),")"]}),(0,t.jsx)(n.default,{sx:{flexGrow:1}}),(f??m)&&(0,t.jsx)(r.default,{size:"xsmall",variant:"outlined",onClick:f??m,sx:{bgcolor:"background.paper",p:"6px 12px"},disabled:_.disableDatabaseQuery,startIcon:(0,t.jsx)(l.FaPlay,{}),children:"Run Query"})]}),b??(0,t.jsx)(g.CodeEditor,{value:e,onChange:e=>{u&&u(e)},language:"sql",readOnly:w.readOnly??!1,lineNumbers:"off"!==w.lineNumbers,wordWrap:"off"!==w.wordWrap,fontSize:w.fontSize??16,keyBindings:E,theme:O?"dark":"light",className:"no-track-pii-safe max-h-dvh h-full"})]})}function v({value:e,baseValue:n,onChange:r,onChangeBase:o,onRun:s,onRunBase:a,onRunDiff:l,options:c={},labels:h,SetupGuide:d,...p}){let g,v,y=h?h[0]:"Base",b=h?h[1]:"Current",{envInfo:w,lineageGraph:x}=(0,u.useLineageGraphContext)();w?.dbt?.base&&w.dbt.current&&(g=w.dbt.base,v=w.dbt.current);let[S,k]=(0,f.extractSchemas)(x);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(i.default,{direction:"row",sx:{height:"100%",gap:0},children:[(0,t.jsx)(i.default,{sx:{height:"100%",width:"50%",gap:0,borderRight:"1px solid",borderRightColor:"divider"},children:(0,t.jsx)(m,{label:y,value:n??"",onChange:o,onRunBase:a,options:c,CustomEditor:d,manifestData:g??void 0,schemas:Array.from(S).join(", "),...p})}),(0,t.jsx)(i.default,{sx:{height:"100%",width:"50%",gap:0},children:(0,t.jsx)(m,{label:b,value:e,onChange:r,onRun:s,options:c,manifestData:v??void 0,schemas:Array.from(k).join(", "),...p})})]})})}e.s(["DualSqlEditor",()=>v,"default",0,m])}]);